Cogs.Foundation
Loading...
Searching...
No Matches
GeodeticUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include "../FoundationBase.h"
4
5#include <glm/vec2.hpp>
6#include <glm/vec3.hpp>
7#include <glm/mat3x3.hpp>
8
9COGSFOUNDATION_API void LLtoUTMZone(int& zoneNumber,
10 bool& northernHemisphere,
11 const double latitude,
12 const double longitude,
13 const int referenceEllipsoid = 23);
14
15COGSFOUNDATION_API void LLtoUTM(double& easting,
16 double& northing,
17 const double latitude,
18 const double longitude,
19 int zoneNumber,
20 bool northernHemisphere,
21 const int referenceEllipsoid = 23);
22
26COGSFOUNDATION_API glm::dvec3 LLtoECEF(double latitude, double longitude, double altitude = 0.0);
27
31COGSFOUNDATION_API glm::dvec2 calcUTMVectorBetweenCoordinates(double lat1, double long1, double lat2, double long2, int zone1 = -1, int zone2 = -1);
32
36COGSFOUNDATION_API float calcBearingBetweenCoordinates(double lat1, double long1, double lat2, double long2, int zone = -1);
37
38namespace Cogs {
39
47 public:
48 LLToENUConverter(double latitude, double longitude, double altitude = 0.0);
51
52 glm::dvec3 convert(double latitude, double longitude, double altitude = 0.0) const;
53 glm::dvec2 calcVectorBetweenCoordinates(double lat1, double long1, double lat2, double long2) const;
54
55 private:
56 glm::dvec3 ecefRef;
57 glm::dmat3x3 ecefToENUMatrix;
58 };
59}
#define COGSFOUNDATION_API
Definition: FoundationBase.h:31
COGSFOUNDATION_API glm::dvec3 LLtoECEF(double latitude, double longitude, double altitude=0.0)
Converts a WGS latitude-longitude to Earth-centered, Earth-fixed (ECEF) cartesian coordinates.
Definition: GeodeticUtils.cpp:138
COGSFOUNDATION_API glm::dvec2 calcUTMVectorBetweenCoordinates(double lat1, double long1, double lat2, double long2, int zone1=-1, int zone2=-1)
Calculate a straight line vector in UTM units from lat1,long1 to lat2,long2.
Definition: GeodeticUtils.cpp:161
COGSFOUNDATION_API void LLtoUTMZone(int &zoneNumber, bool &northernHemisphere, const double latitude, const double longitude, const int referenceEllipsoid=23)
Definition: GeodeticUtils.cpp:44
COGSFOUNDATION_API float calcBearingBetweenCoordinates(double lat1, double long1, double lat2, double long2, int zone=-1)
Calculate a bearing in degrees from lat1,long1 to lat2,long2.
Definition: GeodeticUtils.cpp:194
COGSFOUNDATION_API void LLtoUTM(double &easting, double &northing, const double latitude, const double longitude, int zoneNumber, bool northernHemisphere, const int referenceEllipsoid=23)
Definition: GeodeticUtils.cpp:77
Converts WGS latitude-longitude coordinates to ENU local tangential east-north-up coordinate system.
Definition: GeodeticUtils.h:46
glm::dmat3x3 ecefToENUMatrix
Definition: GeodeticUtils.h:57
LLToENUConverter(const LLToENUConverter &)=default
LLToENUConverter(LLToENUConverter &&)=default
glm::dvec3 ecefRef
Definition: GeodeticUtils.h:56
Main Cogs namespace.
Definition: MortonCode.h:5