Skip to content

Commit

Permalink
Switched to using geographic instead of spherical coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
skiselkov committed Jan 13, 2018
1 parent dfaba3b commit a475d00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/xraas2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2000,7 +2000,8 @@ const airport_t *
find_nearest_curarpt(void)
{
double min_dist = ARPT_LOAD_LIMIT;
vect3_t pos_ecef = sph2ecef(GEO_POS3(adc->lat, adc->lon, adc->elev));
vect3_t pos_ecef = geo2ecef(GEO_POS3(adc->lat, adc->lon, adc->elev),
&wgs84);
const airport_t *cur_arpt = NULL;

if (state.cur_arpts == NULL)
Expand Down Expand Up @@ -2049,8 +2050,10 @@ guess_TATL_from_airport(int *TA, int *TL, bool_t *field_changed)
if (arpt_ref != 0) {
XPLMGetNavAidInfo(arpt_ref, NULL, &outLat, &outLon,
NULL, NULL, NULL, outID, NULL, NULL);
arpt_ecef = sph2ecef(GEO_POS3(outLat, outLon, 0));
pos_ecef = sph2ecef(GEO_POS3(adc->lat, adc->lon, 0));
arpt_ecef = geo2ecef(GEO_POS3(outLat, outLon, 0),
&wgs84);
pos_ecef = geo2ecef(GEO_POS3(adc->lat, adc->lon, 0),
&wgs84);
}

if (!IS_NULL_VECT(arpt_ecef) &&
Expand Down

0 comments on commit a475d00

Please sign in to comment.