50 def->ltp_of_ecef.m[2] = 0.;
76 def->ltp_of_ecef.m[2] = 0.;
208 static const float a = 6378137.0;
209 static const float f = 1. / 298.257223563;
210 const float b = a * (1. -
f);
211 const float b2 =
b *
b;
213 const float e2 = 2.*
f - (
f *
f);
214 const float ep2 =
f * (2. -
f) / ((1. -
f) * (1. -
f));
215 const float E2 = a * a - b2;
218 const float z2 =
in->z *
in->z;
219 const float r2 =
in->x *
in->x +
in->y *
in->y;
220 const float r =
sqrtf(r2);
221 const float F = 54.*b2 *
z2;
222 const float G = r2 + (1 -
e2) *
z2 -
e2 *
E2;
223 const float c = (
e2 *
e2 * F * r2) / (G * G * G);
224 const float s =
powf((1 + c +
sqrtf(c * c + 2 * c)), 1. / 3.);
225 const float s1 = 1 +
s + 1 /
s;
226 const float P = F / (3 * s1 * s1 * G * G);
228 const float ro = -(
e2 *
P * r) / (1 + Q) +
sqrtf((a * a / 2) * (1 + 1 / Q) - ((1 -
e2) *
P *
z2) / (Q *
229 (1 + Q)) -
P * r2 / 2);
233 const float zo = (b2 *
in->z) / (a *
V);
235 out->
alt =
U * (1 - b2 / (a *
V));
245 static const float a = 6378137.0;
246 static const float f = 1. / 298.257223563;
247 const float e2 = 2.*
f - (
f *
f);
267#define CScal(k, z) { z.re *= k; z.im *= k; }
268#define CAdd(z1, z2) { z2.re += z1.re; z2.im += z1.im; }
269#define CSub(z1, z2) { z2.re -= z1.re; z2.im -= z1.im; }
270#define CI(z) { float tmp = z.re; z.re = - z.im; z.im = tmp; }
271#define CExp(z) { float e = exp(z.re); z.re = e*cos(z.im); z.im = e*sin(z.im); }
274#define CSin(z) { CI(z); struct complex _z = {-z.re, -z.im}; float e = exp(z.re); float cos_z_im = cosf(z.im); z.re = e*cos_z_im; float sin_z_im = sinf(z.im); z.im = e*sin_z_im; _z.re = cos_z_im/e; _z.im = -sin_z_im/e; CSub(_z, z); CScal(-0.5, z); CI(z); }
311 if (
utm->zone == 0) {
324 for (k = 1; k < 3; k++) {
352 for (k = 1; k < 2; k++) {
static const float scale[]
#define MAT33_VECT3_TRANSP_MUL(_vout, _mat, _vin)
#define MAT33_VECT3_MUL(_vout, _mat, _vin)
#define VECT3_COPY(_a, _b)
#define VECT3_DIFF(_c, _a, _b)
vector in EarthCenteredEarthFixed coordinates
#define LLA_COPY(_pos1, _pos2)
#define ENU_OF_TO_NED(_po, _pi)
static const float serie_coeff_proj_mercator[5]
static const float serie_coeff_proj_mercator_inverse[5]
#define UtmZoneOfLlaLonRad(lla_lon)
#define LambdaOfUtmZone(utm_zone)
Paparazzi floating point algebra.
Paparazzi double-precision floating point math for geodetic calculations.
void ecef_of_enu_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
static float isometric_latitude_fast_f(float phi)
static float isometric_latitude_f(float phi, float e)
static float inverse_isometric_latitude_f(float lat, float e, float epsilon)
void enu_of_ecef_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void ned_of_ecef_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
void ecef_of_ned_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
void ecef_of_enu_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
void ltp_def_from_lla_f(struct LtpDef_f *def, struct LlaCoor_f *lla)
void ecef_of_lla_f(struct EcefCoor_f *out, struct LlaCoor_f *in)
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla)
void ned_of_lla_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct LlaCoor_f *lla)
void ned_of_ecef_vect_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void enu_of_ecef_vect_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in)
void ltp_def_from_ecef_f(struct LtpDef_f *def, struct EcefCoor_f *ecef)
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
Paparazzi floating point math for geodetic calculations.
float alt
in meters (normally above WGS84 reference ellipsoid)
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates Units: meters
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates Units: meters
position in UTM coordinates Units: meters
Constants UTM (Mercator) projections.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)