- /*Point3D aircraft = sgGeodToCart( Point3D(planes[i].lon*SGD_DEGREES_TO_RADIANS,
- planes[i].lat*SGD_DEGREES_TO_RADIANS,
- planes[i].alt*SG_FEET_TO_METER) );*/
- double course, distance;
- calc_gc_course_dist(Point3D(lon*SGD_DEGREES_TO_RADIANS, lat*SGD_DEGREES_TO_RADIANS, 0.0),
- Point3D(planes[i].lon*SGD_DEGREES_TO_RADIANS,planes[i].lat*SGD_DEGREES_TO_RADIANS, 0.0 ),
- &course, &distance);
- planes[i].dist = distance/SG_NM_TO_METER;
- planes[i].brg = 360.0-course*SGD_RADIANS_TO_DEGREES;
+ double course, distance, az2;
+ SGGeod plane(SGGeod::fromDeg(planes[1].lon, active_rw_lat));
+ SGGeodesy::inverse(_geod, plane, course, az2, distance);
+ planes[i].dist = distance * SG_METER_TO_NM;
+ planes[i].brg = 360.0-course;