RAVE
polar.h
Go to the documentation of this file.
1
7#ifndef POLAR_H
8#define POLAR_H
9
10#ifdef _MSC_VER
11#ifndef _CRT_SECURE_NO_DEPRECATE
12#define _CRT_SECURE_NO_DEPRECATE
13#endif
14#ifndef _CRT_NONSTDC_NO_DEPRECATE
15#define _CRT_NONSTDC_NO_DEPRECATE
16#endif
17#ifndef _USE_MATH_DEFINES
18#define _USE_MATH_DEFINES
19#endif
20#endif
21
25typedef struct {
26 double alt0;
27 double lat0;
28 double lon0;
29 double alt;
30 double lat;
31 double lon;
32 double azimuth;
33 double distance;
34 double dndh;
35 double range;
36 double elevation;
37 double momelev;
38} Position;
39
44void resetPosStruct(Position* pos);
45
53
59double getEarthRadius(double lat0);
60
66void llToDa(Position* src, Position* tgt);
67
73void daToLl(Position* src, Position* tgt);
74
80void dhToRe(Position* src, Position* tgt);
81
87void deToRh(Position* src, Position* tgt);
88
94void reToDh(Position* src, Position* tgt);
95
101void ehToRd(Position* src, Position* tgt);
102
103#endif
void llToDa(Position *src, Position *tgt)
Latitude/Longitude to Distance/Azimuth.
Definition polar.c:71
void deToRh(Position *src, Position *tgt)
Distance/Elevation to Range/Altitude.
Definition polar.c:160
void ehToRd(Position *src, Position *tgt)
Elevation/Height to Range/Distance.
Definition polar.c:208
void dhToRe(Position *src, Position *tgt)
Distance/Altitude to Range/Elevation.
Definition polar.c:120
Position * copyPosStruct(Position *src)
Copies a position struct and returns an allocated instance with the same values.
Definition polar.c:43
double getEarthRadius(double lat0)
Returns the earth radius at the specified latitude.
Definition polar.c:62
void resetPosStruct(Position *pos)
Resets the position struct to have all values set to 0.
Definition polar.c:24
void reToDh(Position *src, Position *tgt)
Range/Elevation to Distance/Altitude.
Definition polar.c:185
void daToLl(Position *src, Position *tgt)
Distance/Azimuth to Latitude/Longitude.
Definition polar.c:103
Position object used for navigation.
Definition polar.h:25
double elevation
elevation
Definition polar.h:36
double azimuth
azimuth
Definition polar.h:32
double lon
longitude
Definition polar.h:31
double lat0
lat0
Definition polar.h:27
double dndh
dndh
Definition polar.h:34
double alt
altitude
Definition polar.h:29
double alt0
alt0
Definition polar.h:26
double distance
distance
Definition polar.h:33
double lon0
lon0
Definition polar.h:28
double momelev
momelev
Definition polar.h:37
double lat
latitude
Definition polar.h:30
double range
range
Definition polar.h:35