diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2007-09-11 20:20:26 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2007-09-11 20:20:26 +0000 |
| commit | 7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa (patch) | |
| tree | d9fc7a37e581b5a3903b448ddedc5618c356872d /src/geocent.h | |
| parent | 09b1b40e4f77362e19f45ee3ac650474c4825fef (diff) | |
| download | PROJ-7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa.tar.gz PROJ-7e85f8ad3d99b41c1c0653d7ae257b10e1bfbdfa.zip | |
avoid use of static variables to make reentrant
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1403 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/geocent.h')
| -rw-r--r-- | src/geocent.h | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/src/geocent.h b/src/geocent.h index 34235565..d6e90d23 100644 --- a/src/geocent.h +++ b/src/geocent.h @@ -92,9 +92,21 @@ extern "C" { #endif +typedef struct +{ + double Geocent_a; /* Semi-major axis of ellipsoid in meters */ + double Geocent_b; /* Semi-minor axis of ellipsoid */ + double Geocent_a2; /* Square of semi-major axis */ + double Geocent_b2; /* Square of semi-minor axis */ + double Geocent_e2; /* Eccentricity squared */ + double Geocent_ep2; /* 2nd eccentricity squared */ +} GeocentricInfo; + +void pj_Init_Geocentric( GeocentricInfo *gi ); +long pj_Set_Geocentric_Parameters( GeocentricInfo *gi, + double a, + double b); - long pj_Set_Geocentric_Parameters (double a, - double b); /* * The function Set_Geocentric_Parameters receives the ellipsoid parameters * as inputs and sets the corresponding state variables. @@ -104,8 +116,10 @@ extern "C" { */ - void pj_Get_Geocentric_Parameters (double *a, - double *b); +void pj_Get_Geocentric_Parameters ( GeocentricInfo *gi, + double *a, + double *b); + /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters * to be used in geocentric coordinate conversions. @@ -115,12 +129,13 @@ extern "C" { */ - long pj_Convert_Geodetic_To_Geocentric (double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z); +long pj_Convert_Geodetic_To_Geocentric ( GeocentricInfo *gi, + double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z); /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), @@ -136,12 +151,13 @@ extern "C" { */ - void pj_Convert_Geocentric_To_Geodetic (double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height); +void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, + double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height); /* * The function Convert_Geocentric_To_Geodetic converts geocentric * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, |
