A quadratic surface defined in Cartesian coordinates.
More...
#include <CesiumGeospatial/Ellipsoid.h>
|
constexpr | Ellipsoid (double x, double y, double z) noexcept |
| Creates a new instance.
|
|
constexpr | Ellipsoid (const glm::dvec3 &radii) noexcept |
| Creates a new instance.
|
|
constexpr const glm::dvec3 & | getRadii () const noexcept |
| Returns the radii in x-, y-, and z-direction.
|
|
glm::dvec3 | geodeticSurfaceNormal (const glm::dvec3 &position) const noexcept |
| Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
|
|
glm::dvec3 | geodeticSurfaceNormal (const Cartographic &cartographic) const noexcept |
| Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
|
|
glm::dvec3 | cartographicToCartesian (const Cartographic &cartographic) const noexcept |
| Converts the provided Cartographic to cartesian representation.
|
|
std::optional< Cartographic > | cartesianToCartographic (const glm::dvec3 &cartesian) const noexcept |
| Converts the provided cartesian to a Cartographic representation.
|
|
std::optional< glm::dvec3 > | scaleToGeodeticSurface (const glm::dvec3 &cartesian) const noexcept |
| Scales the given cartesian position along the geodetic surface normal so that it is on the surface of this ellipsoid.
|
|
std::optional< glm::dvec3 > | scaleToGeocentricSurface (const glm::dvec3 &cartesian) const noexcept |
| Scales the provided cartesian position along the geocentric surface normal so that it is on the surface of this ellipsoid.
|
|
constexpr double | getMaximumRadius () const noexcept |
| The maximum radius in any dimension.
|
|
constexpr double | getMinimumRadius () const noexcept |
| The minimum radius in any dimension.
|
|
constexpr bool | operator== (const Ellipsoid &rhs) const noexcept |
| Returns true if two elliposids are equal.
|
|
constexpr bool | operator!= (const Ellipsoid &rhs) const noexcept |
| Returns true if two elliposids are not equal.
|
|
A quadratic surface defined in Cartesian coordinates.
The surface is defined by the equation (x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. This is primarily used by Cesium to represent the shape of planetary bodies. Rather than constructing this object directly, one of the provided constants is normally used.
- See also
- What is an ellipsoid?
Definition at line 39 of file Ellipsoid.h.
◆ Ellipsoid() [1/2]
CesiumGeospatial::Ellipsoid::Ellipsoid |
( |
double | x, |
|
|
double | y, |
|
|
double | z ) |
|
inlineconstexprnoexcept |
Creates a new instance.
- Parameters
-
x | The radius in x-direction. |
y | The radius in y-direction. |
z | The radius in z-direction. |
Definition at line 62 of file Ellipsoid.h.
◆ Ellipsoid() [2/2]
CesiumGeospatial::Ellipsoid::Ellipsoid |
( |
const glm::dvec3 & | radii | ) |
|
|
inlineconstexprnoexcept |
Creates a new instance.
- Parameters
-
radii | The radii in x-, y-, and z-direction. |
Definition at line 70 of file Ellipsoid.h.
◆ cartesianToCartographic()
std::optional< Cartographic > CesiumGeospatial::Ellipsoid::cartesianToCartographic |
( |
const glm::dvec3 & | cartesian | ) |
const |
|
noexcept |
Converts the provided cartesian to a Cartographic
representation.
The result will be the empty optional if the given cartesian is at the center of this ellipsoid.
- Parameters
-
cartesian | The cartesian position. |
- Returns
- The
Cartographic
representation, or the empty optional if the cartesian is at the center of this ellipsoid.
◆ cartographicToCartesian()
glm::dvec3 CesiumGeospatial::Ellipsoid::cartographicToCartesian |
( |
const Cartographic & | cartographic | ) |
const |
|
noexcept |
Converts the provided Cartographic
to cartesian representation.
- Parameters
-
- Returns
- The cartesian representation.
◆ geodeticSurfaceNormal() [1/2]
glm::dvec3 CesiumGeospatial::Ellipsoid::geodeticSurfaceNormal |
( |
const Cartographic & | cartographic | ) |
const |
|
noexcept |
Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
- Parameters
-
cartographic | The Cartographic position for which to to determine the surface normal. |
- Returns
- The normal.
◆ geodeticSurfaceNormal() [2/2]
glm::dvec3 CesiumGeospatial::Ellipsoid::geodeticSurfaceNormal |
( |
const glm::dvec3 & | position | ) |
const |
|
noexcept |
Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
- Parameters
-
position | The cartesian position for which to to determine the surface normal. |
- Returns
- The normal.
◆ getMaximumRadius()
double CesiumGeospatial::Ellipsoid::getMaximumRadius |
( |
| ) |
const |
|
inlineconstexprnoexcept |
The maximum radius in any dimension.
- Returns
- The maximum radius.
Definition at line 160 of file Ellipsoid.h.
◆ getMinimumRadius()
double CesiumGeospatial::Ellipsoid::getMinimumRadius |
( |
| ) |
const |
|
inlineconstexprnoexcept |
The minimum radius in any dimension.
- Returns
- The minimum radius.
Definition at line 169 of file Ellipsoid.h.
◆ getRadii()
const glm::dvec3 & CesiumGeospatial::Ellipsoid::getRadii |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the radii in x-, y-, and z-direction.
Definition at line 83 of file Ellipsoid.h.
◆ operator!=()
bool CesiumGeospatial::Ellipsoid::operator!= |
( |
const Ellipsoid & | rhs | ) |
const |
|
inlineconstexprnoexcept |
Returns true
if two elliposids are not equal.
Definition at line 183 of file Ellipsoid.h.
◆ operator==()
bool CesiumGeospatial::Ellipsoid::operator== |
( |
const Ellipsoid & | rhs | ) |
const |
|
inlineconstexprnoexcept |
Returns true
if two elliposids are equal.
Definition at line 176 of file Ellipsoid.h.
◆ scaleToGeocentricSurface()
std::optional< glm::dvec3 > CesiumGeospatial::Ellipsoid::scaleToGeocentricSurface |
( |
const glm::dvec3 & | cartesian | ) |
const |
|
noexcept |
Scales the provided cartesian position along the geocentric surface normal so that it is on the surface of this ellipsoid.
- Parameters
-
cartesian | The cartesian position to scale. |
- Returns
- The scaled position, or the empty optional if the cartesian is at the center of this ellipsoid.
◆ scaleToGeodeticSurface()
std::optional< glm::dvec3 > CesiumGeospatial::Ellipsoid::scaleToGeodeticSurface |
( |
const glm::dvec3 & | cartesian | ) |
const |
|
noexcept |
Scales the given cartesian position along the geodetic surface normal so that it is on the surface of this ellipsoid.
The result will be the empty optional if the position is at the center of this ellipsoid.
- Parameters
-
cartesian | The cartesian position. |
- Returns
- The scaled position, or the empty optional if the cartesian is at the center of this ellipsoid.
◆ UNIT_SPHERE
const Ellipsoid CesiumGeospatial::Ellipsoid::UNIT_SPHERE |
|
static |
◆ WGS84
const Ellipsoid CesiumGeospatial::Ellipsoid::WGS84 |
|
static |
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGeospatial/include/CesiumGeospatial/Ellipsoid.h