cesium-native  0.41.0
Cartographic.h
1 #pragma once
2 
3 #include "Library.h"
4 
5 #include <CesiumUtility/Math.h>
6 
7 namespace CesiumGeospatial {
8 
12 class CESIUMGEOSPATIAL_API Cartographic final {
13 public:
21  constexpr Cartographic(
22  double longitudeRadians,
23  double latitudeRadians,
24  double heightMeters = 0.0) noexcept
25  : longitude(longitudeRadians),
26  latitude(latitudeRadians),
27  height(heightMeters) {}
28 
39  static constexpr Cartographic fromDegrees(
40  double longitudeDegrees,
41  double latitudeDegrees,
42  double heightMeters = 0.0) noexcept {
43  return Cartographic(
44  CesiumUtility::Math::degreesToRadians(longitudeDegrees),
46  heightMeters);
47  }
48 
52  constexpr bool operator==(const Cartographic& rhs) const noexcept {
53  return this->longitude == rhs.longitude && this->latitude == rhs.latitude &&
54  this->height == rhs.height;
55  };
56 
60  double longitude;
61 
65  double latitude;
66 
70  double height;
71 };
72 } // namespace CesiumGeospatial
A position defined by longitude, latitude, and height.
Definition: Cartographic.h:12
double height
The height, in meters.
Definition: Cartographic.h:70
static constexpr Cartographic fromDegrees(double longitudeDegrees, double latitudeDegrees, double heightMeters=0.0) noexcept
Creates a new instance from a longitude and latitude specified in degrees, and a height given in mete...
Definition: Cartographic.h:39
double longitude
The longitude, in radians.
Definition: Cartographic.h:55
constexpr bool operator==(const Cartographic &rhs) const noexcept
Returns true if two cartographics are equal.
Definition: Cartographic.h:52
constexpr Cartographic(double longitudeRadians, double latitudeRadians, double heightMeters=0.0) noexcept
Creates a new instance.
Definition: Cartographic.h:21
double latitude
The latitude, in radians.
Definition: Cartographic.h:65
static constexpr double degreesToRadians(double angleDegrees) noexcept
Converts degrees to radians.
Definition: Math.h:320
Classes for geospatial computations in Cesium.