Use wgs_84 time and distance calc routines instead of pure spherical geometry.
This commit is contained in:
parent
229ba460d8
commit
b822efcf78
1 changed files with 12 additions and 6 deletions
|
@ -61,11 +61,18 @@ int FGMagicCarpet::update( int multiloop ) {
|
||||||
set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, FG_2PI) );
|
set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, FG_2PI) );
|
||||||
|
|
||||||
// update (lon/lat) position
|
// update (lon/lat) position
|
||||||
Point3D start( get_Longitude(), get_Latitude(), 0.0 );
|
double lat2, lon2, az2;
|
||||||
Point3D end = calc_lon_lat( start, -get_Psi(), dist );
|
geo_direct_wgs_84 ( get_Altitude(),
|
||||||
|
get_Latitude() * RAD_TO_DEG,
|
||||||
|
get_Longitude() * RAD_TO_DEG,
|
||||||
|
get_Psi() * RAD_TO_DEG,
|
||||||
|
dist, &lat2, &lon2, &az2 );
|
||||||
|
set_Longitude( lon2 * DEG_TO_RAD );
|
||||||
|
set_Latitude( lat2 * DEG_TO_RAD );
|
||||||
|
|
||||||
set_Longitude( end.x() );
|
// cout << "lon error = " << fabs(end.x()*RAD_TO_DEG - lon2)
|
||||||
set_Latitude( end.y() );
|
// << " lat error = " << fabs(end.y()*RAD_TO_DEG - lat2)
|
||||||
|
// << endl;
|
||||||
|
|
||||||
double sl_radius, lat_geoc;
|
double sl_radius, lat_geoc;
|
||||||
fgGeodToGeoc( get_Latitude(), get_Altitude(), &sl_radius, &lat_geoc );
|
fgGeodToGeoc( get_Latitude(), get_Altitude(), &sl_radius, &lat_geoc );
|
||||||
|
@ -77,8 +84,7 @@ int FGMagicCarpet::update( int multiloop ) {
|
||||||
|
|
||||||
set_Geocentric_Position( lat_geoc, get_Longitude(),
|
set_Geocentric_Position( lat_geoc, get_Longitude(),
|
||||||
sl_radius + get_Altitude() + climb );
|
sl_radius + get_Altitude() + climb );
|
||||||
set_Geodetic_Position( end.y(), end.x(),
|
set_Altitude( get_Altitude() + climb );
|
||||||
get_Altitude() + climb );
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue