]> git.mxchange.org Git - flightgear.git/blobdiff - GenAirports/area.cxx
Beginning of convex hull genereration routine.
[flightgear.git] / GenAirports / area.cxx
index cfefd744d1635d853a03c0d842854fbeb0379a8b..aa9907618337673c47dcdf0c0691c8b702f02b77 100644 (file)
@@ -29,6 +29,7 @@
 #include <Include/fg_constants.h>
 
 #include "area.hxx"
+#include "point2d.hxx"
 
 
 // calc new x, y for a rotation
@@ -69,15 +70,6 @@ point2d calc_lon_lat( point2d orig, point2d offset ) {
 }
 
 
-point2d cart_to_polar_2d(point2d in) {
-    point2d result;
-    result.dist = sqrt( in.x * in.x + in.y * in.y );
-    result.theta = atan2(in.y, in.x);    
-
-    return(result);
-}
-
-
 list < point2d >
 batch_cart_to_polar_2d( list < point2d > in_list)
 {
@@ -150,6 +142,9 @@ gen_area(point2d origin, double angle, list < point2d > cart_list)
     last = rad_list.end();
     while ( current != last ) {
        p = calc_lon_lat(origin_rad, *current);
+       // convert from radians to degress
+       p.lon *= RAD_TO_DEG;
+       p.lat *= RAD_TO_DEG;
        // printf("(%.8f, %.8f)\n", p.lon, p.lat);
        result_list.push_back(p);
        current++;
@@ -203,7 +198,7 @@ gen_runway_area( double lon, double lat, double heading,
     printf("\n");
     */
 
-    // rotate, transform, and convert points to lon, lat
+    // rotate, transform, and convert points to lon, lat in degrees
     result_list = gen_area(origin, heading, tmp_list);
 
     /*
@@ -223,6 +218,9 @@ gen_runway_area( double lon, double lat, double heading,
 
 
 // $Log$
+// Revision 1.2  1998/09/04 23:04:48  curt
+// Beginning of convex hull genereration routine.
+//
 // Revision 1.1  1998/09/01 19:34:33  curt
 // Initial revision.
 //