Geo Stars Library
0.9.3
Geodetic and Astrometry library
|
This file contains the geo library routines for: More...
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "geoStars.h"
Go to the source code of this file.
Functions | |
double | geoVersion (void) |
This function returns the version of the GeoStarsLib. More... | |
int | geoEfg2XyzDiff (GEO_LOCATION *src_desc, GEO_LOCATION *tgt_desc, double xyz_disp[]) |
This function returns the XYZ offset of the target point with respect to the source point, given the Earth Fixed Geodetic coordinates of the points. The EFG coordinates for the source must appear in the GEO_LOCATION record, which must be built previous to the call to this procedure. More... | |
int | geoEfg2XyzDiff_packed (GEO_LOCATION *src_desc, int count, double efg_xyz[]) |
This function returns the XYZ offset of the target point with respect to the source point, given the Earth Fixed Geodetic coordinates of the points. The EFG coordinates for the source must appear in the GEO_LOCATION record, which must be built previous to the call to this procedure. More... | |
double | geoLlh2DiffX (double lat1, double lon1, double hgt1, int datum1, double lat2, double lon2, double hgt2, int datum2) |
double | geoLlh2DiffY (double lat1, double lon1, double hgt1, int datum1, double lat2, double lon2, double hgt2, int datum2) |
double | geoLlh2DiffZ (double lat1, double lon1, double hgt1, int datum1, double lat2, double lon2, double hgt2, int datum2) |
void | geoLlh2Efg (double lat, double lon, double height, int datum, double *e, double *f, double *g) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). More... | |
void | geoLlh2Efg_packed (GEO_DATUM *datum, int count, double llh_efg[]) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). More... | |
double | geoLlh2E (double lat, double lon, double hgt, int datum) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the E component. More... | |
double | geoLlh2F (double lat, double lon, double hgt, int datum) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the F component. More... | |
double | geoLlh2G (double lat, double lon, double hgt, int datum) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the G component. More... | |
void | geoXyz2Rae (double xyz_in[], double rae_out[]) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2Rae calculates the range, azimuth, and elevation to that point. More... | |
void | geoXyz2Rae_packed (int count, double xyz_rae[]) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2Rae calculates the range, azimuth, and elevation to that point. More... | |
double | geoXyz2R (double x, double y, double z) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the range to that point. More... | |
double | geoXyz2A (double x, double y, double z) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the azimuth to that point. More... | |
double | geoXyz2E (double x, double y, double z) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the elevation angle to that point. More... | |
void | geoRae2Xyz (double rae_in[], double xyz_out[]) |
This routine converts from Range, Azimuth, and Elevation into Cartesian coordinates X,Y,Z. More... | |
void | geoRae2Xyz_packed (int count, double rae_xyz[]) |
This routine iterates over count vertices in the array rae_xyz converting it from Range, Azimuth, and Elevation into Cartesian coordinates X,Y,Z. More... | |
void | geoXyz2Efg (GEO_LOCATION *loc, double xyz_in[], double efg_out[]) |
Ingests X, Y, Z, and site info and returns the EFG coordinates. More... | |
void | geoXyz2Efg_packed (GEO_LOCATION *loc, int count, double xyz_efg[]) |
This routine takes site info and iterates over count vertices in the tightly packed array xyz_efg converting it from cartesian XYZ into geocentric EFG coordinates. More... | |
void | geoRae2Efg (GEO_LOCATION *loc, double aer_in[], double efg_out[]) |
Ingests Range, Azimuth, Elevation and site info and returns the EFG coordinates that the RAE points to. More... | |
double | geoDms2Rads (double deg, double min, double sec, char *sign) |
Converts degrees minutes seconds to radians. More... | |
double | geoDms2DD (double deg, double min, double sec, char *sign) |
Converts degrees minutes seconds to Decimal Degrees. More... | |
double | geoDecdms2Rads (double in) |
Convert decimal degrees, minutes, and seconds ("dmmss.s") to radians. More... | |
void | geoRads2Dms (double rads, double *deg, double *min, double *sec, double *dir) |
Converts radians to degrees minutes seconds. More... | |
double | geoRads2Decdms (double rads) |
Convert radians to decimal degrees, minutes, and seconds ("dddmmss.s"). More... | |
double | geoRads2DD (double rads) |
Converts radians to Decimal Degrees. More... | |
double | geoDD2Rads (double dd) |
Converts Decimal Degrees to radians. More... | |
void | geoDD2Dms (double dd, double *deg, double *min, double *sec, double *dir) |
Converts Decimal Degrees to degrees minutes seconds. More... | |
double | geoDD2Deg (double dd) |
double | geoDD2Min (double dd) |
double | geoDD2Sec (double dd) |
This file contains the geo library routines for:
Definition in file geoPoint.c.
double geoDD2Deg | ( | double | dd) |
Definition at line 888 of file geoPoint.c.
References geoDD2Dms().
void geoDD2Dms | ( | double | dd, |
double * | deg, | ||
double * | min, | ||
double * | sec, | ||
double * | dir | ||
) |
Converts Decimal Degrees to degrees minutes seconds.
double | decimal degrees |
double | deg, min, sec |
char | dir : -1.0 or 1.0 |
Definition at line 865 of file geoPoint.c.
Referenced by geoDD2Deg(), geoDD2Min(), and geoDD2Sec().
double geoDD2Min | ( | double | dd) |
Definition at line 894 of file geoPoint.c.
References geoDD2Dms().
double geoDD2Rads | ( | double | dd) |
Converts Decimal Degrees to radians.
double | decimal degrees |
Definition at line 849 of file geoPoint.c.
References DEG_TO_RAD.
double geoDD2Sec | ( | double | dd) |
Definition at line 900 of file geoPoint.c.
References geoDD2Dms().
double geoDecdms2Rads | ( | double | in) |
Convert decimal degrees, minutes, and seconds ("dmmss.s") to radians.
double | in; // decimal deg,min,sec |
Definition at line 756 of file geoPoint.c.
References DEG_TO_RAD.
double geoDms2DD | ( | double | deg, |
double | min, | ||
double | sec, | ||
char * | sign | ||
) |
Converts degrees minutes seconds to Decimal Degrees.
double | deg, min, sec |
char | sign : N,E,S,W,-,+ |
Definition at line 723 of file geoPoint.c.
References MIN_TO_DEG, and SEC_TO_DEG.
double geoDms2Rads | ( | double | deg, |
double | min, | ||
double | sec, | ||
char * | sign | ||
) |
Converts degrees minutes seconds to radians.
double | deg, min, sec |
char | sign : N,E,S,W,-,+ |
Definition at line 692 of file geoPoint.c.
References DEG_TO_RAD, MIN_TO_DEG, and SEC_TO_DEG.
int geoEfg2XyzDiff | ( | GEO_LOCATION * | src_desc, |
GEO_LOCATION * | tgt_desc, | ||
double | xyz_disp[] | ||
) |
This function returns the XYZ offset of the target point with respect to the source point, given the Earth Fixed Geodetic coordinates of the points. The EFG coordinates for the source must appear in the GEO_LOCATION record, which must be built previous to the call to this procedure.
GEO_LOCATION | *src_desc |
GEO_LOCATION | *tgt_desc |
double | xyz_disp[] |
GEO_OK | on success |
GEO_ERROR | on error |
Definition at line 50 of file geoPoint.c.
References GEO_LOCATION::clat, GEO_LOCATION::clon, GEO_LOCATION::e, GEO_LOCATION::f, GEO_LOCATION::g, GEO_OK, GEO_X, GEO_Y, GEO_Z, GEO_LOCATION::slat, and GEO_LOCATION::slon.
Referenced by geoLlh2DiffX(), geoLlh2DiffY(), and geoLlh2DiffZ().
int geoEfg2XyzDiff_packed | ( | GEO_LOCATION * | src_desc, |
int | count, | ||
double | efg_xyz[] | ||
) |
This function returns the XYZ offset of the target point with respect to the source point, given the Earth Fixed Geodetic coordinates of the points. The EFG coordinates for the source must appear in the GEO_LOCATION record, which must be built previous to the call to this procedure.
GEO_LOCATION | *src_desc |
GEO_LOCATION | *tgt_desc |
double | xyz_disp[] |
GEO_OK | on success |
GEO_ERROR | on error |
Definition at line 96 of file geoPoint.c.
References GEO_LOCATION::clat, GEO_LOCATION::clon, GEO_LOCATION::e, GEO_LOCATION::f, GEO_LOCATION::g, GEO_E, GEO_F, GEO_G, GEO_OK, GEO_X, GEO_Y, GEO_Z, GEO_LOCATION::slat, and GEO_LOCATION::slon.
double geoLlh2DiffX | ( | double | lat1, |
double | lon1, | ||
double | hgt1, | ||
int | datum1, | ||
double | lat2, | ||
double | lon2, | ||
double | hgt2, | ||
int | datum2 | ||
) |
Definition at line 130 of file geoPoint.c.
References GEO_X, geoEfg2XyzDiff(), and geoInitLocation().
double geoLlh2DiffY | ( | double | lat1, |
double | lon1, | ||
double | hgt1, | ||
int | datum1, | ||
double | lat2, | ||
double | lon2, | ||
double | hgt2, | ||
int | datum2 | ||
) |
Definition at line 142 of file geoPoint.c.
References GEO_Y, geoEfg2XyzDiff(), and geoInitLocation().
double geoLlh2DiffZ | ( | double | lat1, |
double | lon1, | ||
double | hgt1, | ||
int | datum1, | ||
double | lat2, | ||
double | lon2, | ||
double | hgt2, | ||
int | datum2 | ||
) |
Definition at line 153 of file geoPoint.c.
References GEO_Z, geoEfg2XyzDiff(), and geoInitLocation().
double geoLlh2E | ( | double | lat, |
double | lon, | ||
double | hgt, | ||
int | datum | ||
) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the E component.
double | lat : Latitude in RADIANS |
double | lon : Longitude in RADIANS |
double | height : Height in METERS |
int | datum1 |
Definition at line 262 of file geoPoint.c.
References GEO_LOCATION::e, and geoInitLocation().
void geoLlh2Efg | ( | double | lat, |
double | lon, | ||
double | height, | ||
int | datum, | ||
double * | e, | ||
double * | f, | ||
double * | g | ||
) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G).
double | lat : Latitude in RADIANS |
double | lon : Longitude in RADIANS |
double | height : Height in METERS |
int | datum1 |
double | *e : E(x) in METERS |
double | *f : F(y) in METERS |
double | *g : G(z) in METERS |
Definition at line 181 of file geoPoint.c.
References geoGetEllipsoid().
void geoLlh2Efg_packed | ( | GEO_DATUM * | datum, |
int | count, | ||
double | llh_efg[] | ||
) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G).
GEO_DATUM* | datum Datum of the lat/lon/height |
int | count Number of vertices |
double | llh_efg[] Pointer to the first coordinate of the first vertex of the array. |
Definition at line 214 of file geoPoint.c.
References GEO_DATUM::a, GEO_DATUM::e2, GEO_E, GEO_F, GEO_G, GEO_HGT, GEO_LAT, and GEO_LON.
double geoLlh2F | ( | double | lat, |
double | lon, | ||
double | hgt, | ||
int | datum | ||
) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the F component.
double | lat : Latitude in RADIANS |
double | lon : Longitude in RADIANS |
double | height : Height in METERS |
int | datum1 |
Definition at line 286 of file geoPoint.c.
References GEO_LOCATION::f, and geoInitLocation().
double geoLlh2G | ( | double | lat, |
double | lon, | ||
double | hgt, | ||
int | datum | ||
) |
This routine will convert geodetic coordinates (latitude , longitude , and ellipsoid height ) into earth centered Cartesian coordinates (E,F,G). This returns the G component.
double | lat : Latitude in RADIANS |
double | lon : Longitude in RADIANS |
double | height : Height in METERS |
int | datum1 |
Definition at line 310 of file geoPoint.c.
References GEO_LOCATION::g, and geoInitLocation().
double geoRads2DD | ( | double | rads) |
Converts radians to Decimal Degrees.
double | radians |
Definition at line 836 of file geoPoint.c.
References RAD_TO_DEG.
double geoRads2Decdms | ( | double | rads) |
Convert radians to decimal degrees, minutes, and seconds ("dddmmss.s").
double | rads |
Definition at line 810 of file geoPoint.c.
References RAD_TO_DEG.
void geoRads2Dms | ( | double | rads, |
double * | deg, | ||
double * | min, | ||
double * | sec, | ||
double * | dir | ||
) |
Converts radians to degrees minutes seconds.
double | rads |
double | deg, min, sec |
char | dir : -1.0 or 1.0 |
Definition at line 782 of file geoPoint.c.
References RAD_TO_DEG.
void geoRae2Efg | ( | GEO_LOCATION * | loc, |
double | aer_in[], | ||
double | efg_out[] | ||
) |
Ingests Range, Azimuth, Elevation and site info and returns the EFG coordinates that the RAE points to.
GEO_LOCATION | *loc |
double | aer_in[] |
double | efg_out[] |
Definition at line 654 of file geoPoint.c.
References GEO_LOCATION::clat, GEO_LOCATION::clon, GEO_LOCATION::e, GEO_LOCATION::f, GEO_LOCATION::g, GEO_E, GEO_F, GEO_G, GEO_X, GEO_Y, GEO_Z, geoRae2Xyz(), GEO_LOCATION::slat, and GEO_LOCATION::slon.
void geoRae2Xyz | ( | double | rae_in[], |
double | xyz_out[] | ||
) |
This routine converts from Range, Azimuth, and Elevation into Cartesian coordinates X,Y,Z.
double | rae_in[] |
double | xyz_out[] |
Definition at line 501 of file geoPoint.c.
References GEO_AZ, GEO_EL, GEO_RNG, GEO_X, GEO_Y, and GEO_Z.
Referenced by geoRae2Efg().
void geoRae2Xyz_packed | ( | int | count, |
double | rae_xyz[] | ||
) |
This routine iterates over count vertices in the array rae_xyz converting it from Range, Azimuth, and Elevation into Cartesian coordinates X,Y,Z.
count | Number of vertices |
rae_xyz[] | Pointer to the first coordinate of the first vertex of the array. |
Definition at line 522 of file geoPoint.c.
References GEO_AZ, GEO_EL, GEO_RNG, GEO_X, GEO_Y, and GEO_Z.
double geoVersion | ( | void | ) |
This function returns the version of the GeoStarsLib.
GEOSTARSLIB_VERSION | as a double |
Definition at line 25 of file geoPoint.c.
References GEOSTARSLIB_VERSION.
double geoXyz2A | ( | double | x, |
double | y, | ||
double | z | ||
) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the azimuth to that point.
Notes:
double | xyz_in[] |
Definition at line 455 of file geoPoint.c.
References GEO_AZ, geoXyz2Rae(), and RAD_TO_DEG.
double geoXyz2E | ( | double | x, |
double | y, | ||
double | z | ||
) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the elevation angle to that point.
Notes:
double | xyz_in[] |
Definition at line 482 of file geoPoint.c.
References GEO_EL, geoXyz2Rae(), and RAD_TO_DEG.
void geoXyz2Efg | ( | GEO_LOCATION * | loc, |
double | xyz_in[], | ||
double | efg_out[] | ||
) |
Ingests X, Y, Z, and site info and returns the EFG coordinates.
GEO_LOCATION | *loc |
double | xyz_in[] |
double | efg_out[] |
Definition at line 570 of file geoPoint.c.
References GEO_LOCATION::clat, GEO_LOCATION::clon, GEO_LOCATION::e, GEO_LOCATION::f, GEO_LOCATION::g, GEO_E, GEO_F, GEO_G, GEO_X, GEO_Y, GEO_Z, GEO_LOCATION::slat, and GEO_LOCATION::slon.
void geoXyz2Efg_packed | ( | GEO_LOCATION * | loc, |
int | count, | ||
double | xyz_efg[] | ||
) |
This routine takes site info and iterates over count vertices in the tightly packed array xyz_efg converting it from cartesian XYZ into geocentric EFG coordinates.
loc | The location that the XYZ grid is based around |
count | The number of vertices in the array |
xyz_efg[] | Pointer to the first vertex of the array |
Definition at line 606 of file geoPoint.c.
References GEO_LOCATION::clat, GEO_LOCATION::clon, GEO_LOCATION::e, GEO_LOCATION::f, GEO_LOCATION::g, GEO_E, GEO_F, GEO_G, GEO_X, GEO_Y, GEO_Z, GEO_LOCATION::slat, and GEO_LOCATION::slon.
double geoXyz2R | ( | double | x, |
double | y, | ||
double | z | ||
) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2R calculates the range to that point.
Notes:
double | xyz_in[] |
Definition at line 428 of file geoPoint.c.
References GEO_RNG, and geoXyz2Rae().
void geoXyz2Rae | ( | double | xyz_in[], |
double | rae_out[] | ||
) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2Rae calculates the range, azimuth, and elevation to that point.
Notes:
double | xyz_in[] |
double | rae_out[] |
Definition at line 339 of file geoPoint.c.
References GEO_AZ, GEO_EL, GEO_RNG, GEO_X, GEO_Y, GEO_Z, and M_PI.
Referenced by geoXyz2A(), geoXyz2E(), and geoXyz2R().
void geoXyz2Rae_packed | ( | int | count, |
double | xyz_rae[] | ||
) |
Given the X, Y, and Z coordinates (in meters) of a point in space, the procedure geoXyz2Rae calculates the range, azimuth, and elevation to that point.
Notes:
count | Number of vertices |
xyz_rae[] | Pointer to the first coordinate of the first vertex of the array. |
Definition at line 378 of file geoPoint.c.
References GEO_AZ, GEO_EL, GEO_RNG, GEO_X, GEO_Y, GEO_Z, and M_PI.