Curtis L. Olson writes:
>
>One thing I've noticed (from the magic carpet mode) is that if you
>call geo_direct_wgs_84() with zero distance and zero direction
>(i.e. zero velocity) you don't get *exactly* the starting lat/lon back
>because of numerical precision issues.  This is not a big deal at
>higher velocities, but is a problem at very slow velocities.

Good Point

lets see 1.0e-6 degrees should be close enough for 'government work'

a minute is 2000 meters and there are 60 minutes in a degree so
1.0*e-6 degrees is around 10 cm 

so I guess one could always check 

somthing like

my_geo_direct( &new_lat, &new_lon, lat, lon. dir, dist )

static double old_lat  = 1000;
static double old_lon = 1000;

#define CLOSE_ENOUGH 1.0e-6

if( fabs(old_lat-lat) < CLOSE_ENOUGH && 
    fabs(old_lon-lon) < CLOSE_ENOUGH ) {
         geo_direct_wgs_84(new_lat, new_lon,,,, lat, lon)
} else {
   new_lat = lat;
   new_lon = lon;
}

old_lat = new_lat;
old_lon = new_lon;
....
}


FWIW for those who want REAL ACCURATE placement at small 
scale I ALWAYS reccommend doing everything in XYZ on a local 
plane then converting your positions into 'spherical space'.

This will work for distances of up to 'several' miles with no noticeable
loss in accuracy due to differences between chord and arc distance

Now how small is epsilon ?

Norman

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to