cgv
Loading...
Searching...
No Matches
geo_transform.h
1#pragma once
2
3#include <cgv/math/fvec.h>
4#include "lib_begin.h"
5
6namespace cgv {
7 namespace math {
8
10 static const double WGS84_a = 6378137.0;
12 static const double WGS84_e = 0.081819191;
13
15 const double epsg3857_scale = 20037508.3428;
16
20 extern CGV_API void epsg4326_to_epsg3857(double lon, double lat, double& x, double& y);
24 extern CGV_API void epsg3857_to_epsg4326(double x, double y, double& lon, double& lat);
25
26 // converts from geodetic [latitude phi:deg N, longitude lambda:deg E, height h:meters]
27 // based on reference ellipsoid [semi major axis a, eccentricity e] to
28 // global orthonormal earth centered fixed earth (ECFE) coordinates in meters
29 extern CGV_API fvec<double, 3> ECFE_from_geodetic(const fvec<double, 3>& geodetic, double a = WGS84_a, double e = WGS84_e);
30 // converts from global orthonormal earth centered fixed earth (ECFE) coordinates in meters
31 // based on reference ellipsoid [semi major axis a, eccentricity e] to
32 // geodetic [latitude phi:deg N, longitude lambda:deg E, height h:meters]
33 extern CGV_API fvec<double, 3> geodetic_from_ECFE(const fvec<double, 3>& ECFE, double a = WGS84_a, double e = WGS84_e);
34 // converts from global orthonormal earth centered fixed earth (ECFE) coordinates in meters
35 // based on reference ellipsoid [semi major axis a, eccentricity e] to
36 // geodetic [latitude phi:deg N, longitude lambda:deg E, height h:meters] with non iterative and faster but less accurate approach
37 extern CGV_API fvec<double, 3> geodetic_from_ECFE_approx(const fvec<double, 3>& ECFE, double a = WGS84_a, double e = WGS84_e);
38 // converts from geodetic [latitude phi:deg N, longitude lambda:deg E, height h:meters]
39 // based on reference ellipsoid [semi major axis a, eccentricity e] to
40 // local East North (ENU) coordinates in meters
41 extern CGV_API fvec<double, 3> ENU_from_geodetic(const fvec<double, 3>& position_geodetic, const fvec<double, 3>& origin_geodetic, double a = WGS84_a, double e = WGS84_e);
42 }
43}
44
45#include <cgv/config/lib_end.h>
this header is dependency free
Definition print.h:11