Lee Willis (lee++at++multigen.com)
Tue, 22 Oct 1996 11:35:58 -0700
How to convert depends on what projection you generated the database
in. The simplest (and fastest at runtime) conversion is using the MultiGen
FLAT EARTH projection. In this, along with you're lat,lon,alt, you need
the origin of the database, and the units of the database (you can get
these from the database attribute page in MultiGen)
#define METERS_PER_DEGREE 111120.0
#define RADIANS_PER_DEGREE ( PI / 180.0 )
double convergance; /* scale to compensate for convergance at poles */
double x_meters, y_meters;
convergance = cos( origin_lat * RADIANS_PER_DEGREE );
/* compute this value once and cache it - it doesn't change */
/* x,y,z units are now in _meters_ */
x = (lon - origin_lon) * convergance * METERS_PER_DEGREE;
y = (lat - origin_lat) * METERS_PER_DEGREE
z = alt;
/* if you're units are not in meters, multiply by <units_per_meter> */
If you're not using the Flat Earth projection, the computation
is more complex. email me directly for help.
--
Lee Willis MultiGen Inc. 550 S Winchester Blvd. Suite 500
San Jose, CA 95128 (408) 261-4100
"Sure, everyone knows [software] reusability is wonderful for the
consumer side of the reuse transaction. But what makes it wonderful
for the producers?" -- Brad Cox, _Superdistribution_
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:47 PDT