1
0
Fork 0

SG_ name space additions.

This commit is contained in:
curt 2001-03-24 03:34:04 +00:00
parent 29f155ae4a
commit 0e8b7763b1
7 changed files with 22 additions and 22 deletions

View file

@ -119,8 +119,8 @@ static FGPolygon rwy_section_tex_coords( const FGPolygon& in_poly,
// 3. Convert from polar to cartesian coordinates
//
x = cos( course * DEG_TO_RAD ) * dist;
y = sin( course * DEG_TO_RAD ) * dist;
x = cos( course * SGD_DEGREES_TO_RADIANS ) * dist;
y = sin( course * SGD_DEGREES_TO_RADIANS ) * dist;
cout << " x = " << x << " y = " << y << endl;
cout << " min = " << min << endl;
cout << " max = " << max << endl;
@ -1607,8 +1607,8 @@ void build_airport( string airport_raw, string_list& runways_raw,
*/
SGBucket b( apt_lon, apt_lat );
Point3D center_geod( b.get_center_lon() * DEG_TO_RAD,
b.get_center_lat() * DEG_TO_RAD, 0 );
Point3D center_geod( b.get_center_lon() * SGD_DEGREES_TO_RADIANS,
b.get_center_lat() * SGD_DEGREES_TO_RADIANS, 0 );
Point3D gbs_center = sgGeodToCart( center_geod );
cout << b.gen_base_path() << "/" << b.gen_index_str() << endl;
@ -1953,8 +1953,8 @@ void build_airport( string airport_raw, string_list& runways_raw,
// calculate wgs84 mapping of nodes
point_list wgs84_nodes;
for ( i = 0; i < (int)geod_nodes.size(); ++i ) {
p.setx( geod_nodes[i].x() * DEG_TO_RAD );
p.sety( geod_nodes[i].y() * DEG_TO_RAD );
p.setx( geod_nodes[i].x() * SGD_DEGREES_TO_RADIANS );
p.sety( geod_nodes[i].y() * SGD_DEGREES_TO_RADIANS );
p.setz( geod_nodes[i].z() );
wgs84_nodes.push_back( sgGeodToCart( p ) );
}
@ -1962,8 +1962,8 @@ void build_airport( string airport_raw, string_list& runways_raw,
cout << "Done with wgs84 node mapping" << endl;
// calculate normal(s) for this airport
p.setx( base_tris.get_pt(0, 0).x() * DEG_TO_RAD );
p.sety( base_tris.get_pt(0, 0).y() * DEG_TO_RAD );
p.setx( base_tris.get_pt(0, 0).x() * SGD_DEGREES_TO_RADIANS );
p.sety( base_tris.get_pt(0, 0).y() * SGD_DEGREES_TO_RADIANS );
p.setz( 0 );
Point3D tmp = sgGeodToCart( p );
// cout << "geod = " << p << endl;

View file

@ -91,7 +91,7 @@ bool test_point(Point3D Pa, Point3D Pb, Point3D Pc) {
a1 = calc_angle(a, b, origin);
a2 = calc_angle(origin, b, c);
// printf("a1 = %.2f a2 = %.2f\n", a1 * RAD_TO_DEG, a2 * RAD_TO_DEG);
// printf("a1 = %.2f a2 = %.2f\n", a1 * SGD_RADIANS_TO_DEGREES, a2 * SGD_RADIANS_TO_DEGREES);
return ( (a1 + a2) < SG_PI );
}

View file

@ -98,7 +98,7 @@ FGPolygon gen_area(Point3D origin, double angle, const FGPolygon& cart_list) {
double lat2, lon2, az2;
geo_direct_wgs_84 ( 0, origin.y(), origin.x(),
rad_list.get_pt(0, i).y() * RAD_TO_DEG,
rad_list.get_pt(0, i).y() * SGD_RADIANS_TO_DEGREES,
rad_list.get_pt(0, i).x(),
&lat2, &lon2, &az2 );
@ -145,7 +145,7 @@ FGPolygon gen_runway_area( const FGRunway& runway,
// }
// rotate, transform, and convert points to lon, lat in degrees
result_list = gen_area(origin, runway.heading * DEG_TO_RAD, tmp_list);
result_list = gen_area(origin, runway.heading * SGD_DEGREES_TO_RADIANS, tmp_list);
// display points
// cout << "Results in radians." << endl;
@ -190,7 +190,7 @@ FGPolygon gen_runway_w_mid( const FGRunway& runway,
// }
// rotate, transform, and convert points to lon, lat in degrees
result_list = gen_area(origin, runway.heading * DEG_TO_RAD, tmp_list);
result_list = gen_area(origin, runway.heading * SGD_DEGREES_TO_RADIANS, tmp_list);
// display points
// cout << "Results in radians." << endl;

View file

@ -166,7 +166,7 @@ void FGClipper::move_slivers( FGPolygon& in, FGPolygon& out ) {
out.erase();
double angle_cutoff = 10.0 * DEG_TO_RAD;
double angle_cutoff = 10.0 * SGD_DEGREES_TO_RADIANS;
double area_cutoff = 0.000008;
double min_angle;
double area;

View file

@ -47,8 +47,8 @@ void FGGenOutput::calc_gbs( FGConstruct& c ) {
SGBucket b = c.get_bucket();
Point3D p( b.get_center_lon() * DEG_TO_RAD,
b.get_center_lat() * DEG_TO_RAD,
Point3D p( b.get_center_lon() * SGD_DEGREES_TO_RADIANS,
b.get_center_lat() * SGD_DEGREES_TO_RADIANS,
0 );
gbs_center = sgGeodToCart(p);
@ -80,9 +80,9 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
SGBucket b = c.get_bucket();
double clat = b.get_center_lat();
double clat_rad = clat * DEG_TO_RAD;
double clat_rad = clat * SGD_DEGREES_TO_RADIANS;
double cos_lat = cos( clat_rad );
double local_radius = cos_lat * EQUATORIAL_RADIUS_M;
double local_radius = cos_lat * SG_EQUATORIAL_RADIUS_M;
double local_perimeter = 2.0 * local_radius * SG_PI;
double degree_width = local_perimeter / 360.0;
@ -93,7 +93,7 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
// cout << "local_perimeter = " << local_perimeter << endl;
// cout << "degree_width = " << degree_width << endl;
double perimeter = 2.0 * EQUATORIAL_RADIUS_M * SG_PI;
double perimeter = 2.0 * SG_EQUATORIAL_RADIUS_M * SG_PI;
double degree_height = perimeter / 360.0;
// cout << "degree_height = " << degree_height << endl;

View file

@ -558,8 +558,8 @@ static void build_wgs_84_point_list( FGConstruct& c, const FGArray& array ) {
geod = raw_nodes[i];
// convert to radians
radians = Point3D( geod.x() * DEG_TO_RAD,
geod.y() * DEG_TO_RAD,
radians = Point3D( geod.x() * SGD_DEGREES_TO_RADIANS,
geod.y() * SGD_DEGREES_TO_RADIANS,
geod.z() );
cart = sgGeodToCart(radians);

View file

@ -271,8 +271,8 @@ void FGMatch::load_neighbor_shared( FGConstruct& c ) {
// fake a normal for a point which is basically straight up
Point3D tgFakeNormal( const Point3D& p ) {
Point3D radians = Point3D( p.x() * DEG_TO_RAD,
p.y() * DEG_TO_RAD,
Point3D radians = Point3D( p.x() * SGD_DEGREES_TO_RADIANS,
p.y() * SGD_DEGREES_TO_RADIANS,
p.z() );
Point3D cart = sgGeodToCart(radians);
double len = Point3D(0.0).distance3D(cart);