74 #if defined( _USE_PACK ) 75 #pragma pack( 1 ) // set byte alignment 76 #define _USING_BYTE_ALIGNMENT 99 #define _mbg_swab_dms( _p ) \ 102 _mbg_swab16( &(_p)->prefix ); \ 103 _mbg_swab16( &(_p)->deg ); \ 104 _mbg_swab16( &(_p)->min ); \ 105 _mbg_swab_double( &(_p)->sec ); \ 123 #define _mbg_swab_pos( _p ) \ 126 _mbg_swab_xyz( (_p)->xyz ); \ 127 _mbg_swab_lla( (_p)->lla ); \ 128 _mbg_swab_dms( &(_p)->longitude ); \ 129 _mbg_swab_dms( &(_p)->latitude ); \ 130 _mbg_swab16( &(_p)->ellipsoid ); \ 221 { -128.0, 481.0, 664.0 },
264 #define PI 3.1415926535897932 302 void rad_to_dms(
const double *rad,
DMS *dms,
const char prefix ) ;
321 #if defined( _USING_BYTE_ALIGNMENT ) 322 #pragma pack() // set default alignment 323 #undef _USING_BYTE_ALIGNMENT DMS longitude
Longitude broken down to degrees, minutes, seconds.
void dms_to_xyz(USER_POS *pos)
void lla_to_xyz(USER_POS *pos)
POS pos
The position in WGS84 ECEF coords and LLA.
int16_t valid
Indicator if data is valid.
uint16_t CSUM
checksum used by some structures stored in non-volatile memory
double sqr_e
Square of numerical eccentricity.
A structure used internally to compute a geographic position.
DMS latitude
Latitude broken down to degrees, minutes, seconds.
double nt1
-sin_lat * cos_lon
CSUM csum
Checksum of the remaining bytes.
CSUM csum
Checksum of the remaining bytes.
void setup_user_pos_from_xyz(USER_POS *user, void(*cyclic_func)(void))
int16_t ellipsoid
Ellipsoid used for reference, see ELLIPSOIDS.
int16_t valid
Indicator if data is valid.
double rcp_f
Reciproke of flatness.
Geographic longitude or latitude in [degrees, minutes, seconds].
void rad_to_dms(const double *rad, DMS *dms, const char prefix)
void xyz_to_lla(POS *pos, void(*cyclic_func)(void))
double sin_lat
sin( latitude )
void dms_to_rad(const DMS *dms, double *rad)
Characteristics of a geographic reference ellipsoid.
uint16_t prefix
'N', 'E', 'S' or 'W'
double XYZ[N_XYZ]
A position in cartesian coordinates.
uint16_t deg
[0...90 (lat) or 0...180 (lon)]
XYZ dxyz
Offset from the WGS84 ECEF coords.
ELLIPSOID ellipsoid[N_ELLIPSOIDS]
double utx
cos_lat * cos_lon
void lla_to_dms(POS *pos)
double distance(XYZ xyz_1, XYZ xyz_2)
double e_radius_alt
N + h.
A geographic position represented in different formats.
XYZ xyz
Always WGS84 ECEF coordinates.
void setup_user_pos_from_lla(USER_POS *user)
void dms_to_lla(POS *pos)
double uty
cos_lat * sin_lon
ELLIPSOIDS
An enumeration of known ellipsoids.
LLA lla
Longitude, latitude and altitude, depending on the ellipsoid used for reference.
double LLA[N_LLA]
A geographic position based on latitude, longitude, and altitude.
void setup_user_pos_from_dms(USER_POS *user)
double sec
[0...59.99999...]
double cos_lon
cos( longitude )
double cos_lat
cos( latitude )
double sin_lon
sin( longitude )
double nt2
-sin_lat * sin_lon