cesium-native  0.41.0
CesiumGeospatial::Ellipsoid Class Referencefinal

A quadratic surface defined in Cartesian coordinates. More...

#include <CesiumGeospatial/Ellipsoid.h>

Public Member Functions

constexpr Ellipsoid (double x, double y, double z) noexcept
 Creates a new instance. More...
 
constexpr Ellipsoid (const glm::dvec3 &radii) noexcept
 Creates a new instance. More...
 
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. More...
 
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. More...
 
glm::dvec3 cartographicToCartesian (const Cartographic &cartographic) const noexcept
 Converts the provided Cartographic to cartesian representation. More...
 
std::optional< CartographiccartesianToCartographic (const glm::dvec3 &cartesian) const noexcept
 Converts the provided cartesian to a Cartographic representation. More...
 
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. More...
 
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. More...
 
constexpr double getMaximumRadius () const noexcept
 The maximum radius in any dimension. More...
 
constexpr double getMinimumRadius () const noexcept
 The minimum radius in any dimension. More...
 
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.
 

Static Public Attributes

static const Ellipsoid WGS84
 An Ellipsoid instance initialized to the WGS84 standard. More...
 
static const Ellipsoid UNIT_SPHERE
 An Ellipsoid with all three radii set to one meter.
 

Detailed Description

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.

Definition at line 38 of file Ellipsoid.h.

Constructor & Destructor Documentation

◆ Ellipsoid() [1/2]

constexpr CesiumGeospatial::Ellipsoid::Ellipsoid ( double  x,
double  y,
double  z 
)
inlineconstexprnoexcept

Creates a new instance.

Parameters
xThe radius in x-direction.
yThe radius in y-direction.
zThe radius in z-direction.

Definition at line 61 of file Ellipsoid.h.

◆ Ellipsoid() [2/2]

constexpr CesiumGeospatial::Ellipsoid::Ellipsoid ( const glm::dvec3 &  radii)
inlineconstexprnoexcept

Creates a new instance.

Parameters
radiiThe radii in x-, y-, and z-direction.

Definition at line 69 of file Ellipsoid.h.

Member Function Documentation

◆ 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
cartesianThe 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
cartographicThe Cartographic position.
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
cartographicThe 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
positionThe cartesian position for which to to determine the surface normal.
Returns
The normal.

◆ getMaximumRadius()

constexpr double CesiumGeospatial::Ellipsoid::getMaximumRadius ( ) const
inlineconstexprnoexcept

The maximum radius in any dimension.

Returns
The maximum radius.

Definition at line 159 of file Ellipsoid.h.

◆ getMinimumRadius()

constexpr double CesiumGeospatial::Ellipsoid::getMinimumRadius ( ) const
inlineconstexprnoexcept

The minimum radius in any dimension.

Returns
The minimum radius.

Definition at line 168 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
cartesianThe cartesian position to scale. @retun 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
cartesianThe cartesian position.
Returns
The scaled position, or the empty optional if the cartesian is at the center of this ellipsoid.

Member Data Documentation

◆ WGS84

const Ellipsoid CesiumGeospatial::Ellipsoid::WGS84
static

An Ellipsoid instance initialized to the WGS84 standard.

The ellipsoid is initialized to the World Geodetic System (WGS84) standard, as defined in https://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf.

Definition at line 47 of file Ellipsoid.h.


The documentation for this class was generated from the following file: