-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replacement of geodesic engine with one from Charles Karney (#197)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2297 4e78687f-474d-0410-85f9-8d5e500ac6b2
- Loading branch information
Showing
10 changed files
with
1,753 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "projects.h" | ||
#include "geod_interface.h" | ||
|
||
void geod_ini(void) { | ||
GeodesicInit(&GlobalGeodesic, geod_a, geod_f); | ||
} | ||
|
||
void geod_pre(void) { | ||
double | ||
degree = PI/180, | ||
lat1 = phi1 / degree, lon1 = lam1 /degree, azi1 = al12 / degree; | ||
GeodesicLineInit(&GlobalGeodesicLine, &GlobalGeodesic, | ||
lat1, lon1, azi1, 0U); | ||
} | ||
|
||
void geod_for(void) { | ||
double degree = PI/180, s12 = geod_S, lat2, lon2, azi2; | ||
Position(&GlobalGeodesicLine, s12, &lat2, &lon2, &azi2); | ||
azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */ | ||
phi2 = lat2 * degree; | ||
lam2 = lon2 * degree; | ||
al21 = azi2 * degree; | ||
} | ||
|
||
void geod_inv(void) { | ||
double | ||
degree = PI / 180, | ||
lat1 = phi1 / degree, lon1 = lam1 / degree, | ||
lat2 = phi2 / degree, lon2 = lam2 / degree, | ||
azi1, azi2, s12; | ||
Inverse(&GlobalGeodesic, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2); | ||
azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */ | ||
al12 = azi1 * degree; al21 = azi2 * degree; geod_S = s12; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#if !defined(GEOD_INTERFACE_H) | ||
#define GEOD_INTERFACE_H | ||
|
||
#include "geodesic.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifndef _IN_GEOD_SET | ||
# define GEOD_EXTERN extern | ||
#else | ||
# define GEOD_EXTERN | ||
#endif | ||
|
||
GEOD_EXTERN struct geodesic { | ||
double A, FLAT, LAM1, PHI1, ALPHA12, LAM2, PHI2, ALPHA21, DIST; | ||
} GEODESIC; | ||
|
||
# define geod_a GEODESIC.A | ||
# define geod_f GEODESIC.FLAT | ||
# define lam1 GEODESIC.LAM1 | ||
# define phi1 GEODESIC.PHI1 | ||
# define al12 GEODESIC.ALPHA12 | ||
# define lam2 GEODESIC.LAM2 | ||
# define phi2 GEODESIC.PHI2 | ||
# define al21 GEODESIC.ALPHA21 | ||
# define geod_S GEODESIC.DIST | ||
|
||
GEOD_EXTERN struct Geodesic GlobalGeodesic; | ||
GEOD_EXTERN struct GeodesicLine GlobalGeodesicLine; | ||
GEOD_EXTERN int n_alpha, n_S; | ||
GEOD_EXTERN double to_meter, fr_meter, del_alpha; | ||
|
||
void geod_set(int, char **); | ||
void geod_ini(void); | ||
void geod_pre(void); | ||
void geod_for(void); | ||
void geod_inv(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.