Repository navigation
Expand file tree
/
Copy pathconcord.h
More file actions
150 lines (99 loc) · 3.21 KB
/
Copy pathconcord.h
File metadata and controls
150 lines (99 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#ifndef CONCORD_H
#define CONCORD_H
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define A_M 6378137.0
#define F (1.0 / 298.257223563)
#define B_M (A_M * (1.0 - F))
#define E2 (F * (2.0 - F))
#define EP2 (E2 / (1.0 - E2))
#define E4 (E2 * E2)
#define E6 (E4 * E2)
#define K0 0.9996
typedef struct ConcordTransformTree ConcordTransformTree;
typedef struct FrameTag FrameTag;
typedef struct {
double x;
double y;
double z;
} ConcordEcf3;
typedef struct {
double latitude;
double longitude;
double altitude;
} ConcordGeo3;
typedef struct {
int32_t zone;
uint32_t band;
double easting;
double northing;
double altitude;
} ConcordUtm;
typedef struct {
double east;
double north;
double up;
ConcordGeo3 origin;
} ConcordEnuPoint;
typedef struct {
double north;
double east;
double down;
ConcordGeo3 origin;
} ConcordNedPoint;
typedef struct {
double x;
double y;
double z;
double w;
} ConcordQuat;
typedef struct {
double x;
double y;
double z;
} ConcordVec3;
typedef struct {
ConcordQuat rotation;
ConcordVec3 translation;
} ConcordTransform;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
const char *concord_last_error_message(void);
ConcordEcf3 concord_wgs_to_ecf(ConcordGeo3 wgs);
ConcordGeo3 concord_ecf_to_wgs(ConcordEcf3 ecf);
ConcordGeo3 concord_ecf_to_wgs_optimized(ConcordEcf3 ecf, double tolerance);
bool concord_wgs_to_utm(ConcordGeo3 wgs, ConcordUtm *out_utm);
bool concord_utm_to_wgs(ConcordUtm utm, ConcordGeo3 *out_wgs);
ConcordEnuPoint concord_wgs_to_enu(ConcordGeo3 origin, ConcordGeo3 wgs);
ConcordNedPoint concord_wgs_to_ned(ConcordGeo3 origin, ConcordGeo3 wgs);
ConcordGeo3 concord_enu_to_wgs(ConcordEnuPoint enu);
ConcordGeo3 concord_ned_to_wgs(ConcordNedPoint ned);
ConcordNedPoint concord_enu_to_ned_point(ConcordEnuPoint enu);
ConcordEnuPoint concord_ned_to_enu_point(ConcordNedPoint ned);
bool concord_convert_wgs_to_enu(ConcordGeo3 wgs, ConcordGeo3 origin, ConcordEnuPoint *out_enu);
ConcordTransformTree *concord_transform_tree_new(void);
void concord_transform_tree_free(ConcordTransformTree *tree);
bool concord_transform_tree_register_frame(ConcordTransformTree *tree, const char *name);
bool concord_transform_tree_set_transform(ConcordTransformTree *tree,
const char *to_frame,
const char *from_frame,
ConcordTransform transform);
bool concord_transform_tree_lookup(ConcordTransformTree *tree,
const char *to_frame,
const char *from_frame,
ConcordTransform *out_transform);
bool concord_transform_tree_can_transform(ConcordTransformTree *tree,
const char *to_frame,
const char *from_frame);
uintptr_t concord_transform_tree_frame_count(const ConcordTransformTree *tree);
uintptr_t concord_transform_tree_transform_count(const ConcordTransformTree *tree);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif /* CONCORD_H */