Geocentric

Description

sealed class Tinman.Terrain.Georef.Geocentric

The Geocentric class represents a geocentric coordinate system and provides methods for converting between geographic and cartesian coordinates.

The plain geocentric coordinate axes define a right-handed cartesian coordinate system:

  • X : axis through the intersection of the equator with longitude 0°.

  • Y : axis through the intersection of the equator with longitude 90°.

  • Z : axis corresponding with the planet rotation axis (positive northwards).

After creating an Geocentric object, additional information must be given before non-ellipsoid height values can be used (see Vertical2 and Vertical1). A custom matrix (see Transform) can be specified to transform the plain geocentric coordinate space.

Public / Constants

WGS84


[ShutdownSurvive]
public static readonly attribute WGS84 → (Geocentric)

Public / Constructors

For

3 overloads


public static method For1 → (1)

datum in : GeodeticDatum

[not-null]
The geodetic datum to use.

returns → Geocentric

The Geocentric object.

Creates a new instance of Geocentric.

The GeodeticDatum.Meridian of datum in will be used as longitude 0°.


public static method For2 → (2)

ellipsoid in : Ellipsoid

[not-null]
The ellipsoid.

meridian opt : PrimeMeridian = null

The prime meridian to use as longitude 0°.

returns → Geocentric

The Geocentric object.

Creates a new instance of Geocentric.


public static method For3 → (4)

semiMajor in : float64

[>0]
The semi-major axis, in cartesian units (see unit opt).

semiMinor opt : float64 = 0

[>=0]
The semi-minor axis, in cartesian units (see unit opt). If 0, the value of semiMajor in will be used.

meridian opt : float64 = 0

The prime meridian to use as longitude 0°, in radians.

unit opt : UnitOfMeasure = null

The cartesian unit. If null, UnitOfMeasure.Metre will be used.

returns → Geocentric

The Geocentric object.

Creates a new instance of Geocentric.

Public / Methods

To​Geocentric

6 overloads


[Pure]
public method ToGeocentric1 → (2)

lonLatHeight in : Vec3D

The geographic coordinates:
Vec3D.X: longitude, in radians.
Vec3D.Y: latitude, in radians.
Vec3D.Z: height, in geocentric units (see Unit).

vertical opt : VerticalType = VerticalType.Ellipsoid

The vertical coordinate type.

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.


[Pure]
public method ToGeocentric2 → (3)

lonLat in : Vec2D

The geographic coordinates:
Vec2D.X: longitude, in radians.
Vec2D.Y: latitude, in radians.

height opt : float64 = 0

The height, in geocentric units (see Unit).

vertical opt : VerticalType = VerticalType.Ellipsoid

The vertical coordinate type.

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.


[Pure]
public method ToGeocentric3 → (3)

latLon in : LatLon

The geographic coordinates.

height opt : float64 = 0

The height, in geocentric units (see Unit).

vertical opt : VerticalType = VerticalType.Ellipsoid

The vertical coordinate type.

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.


[Pure]
public method ToGeocentric4 → (1)

latLonHeight in : LatLonHeight

The geographic coordinates.

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.


[Pure]
public method ToGeocentric5 → (3)

latitude in : float64

The latitude, in radians.

longitude in : float64

The longitude, in radians.

height opt : float64 = 0

The ellipsoid height, in geocentric units (see Unit).

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.


[Pure]
public method ToGeocentric6 → (4)

latitude in : float64

The latitude, in radians.

longitude in : float64

The longitude, in radians.

height in : float64

The height, in geocentric units (see Unit).

vertical in : VerticalType

The vertical coordinate type.

returns → Vec3D

The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

To​Geographic2​D

2 overloads


[Pure]
public method ToGeographic2D1 → (1)

in : Vec3D

The cartesian coordinates.

returns → Vec2D

The geographic coordinates:
Vec3D.X: longitude, in radians
Vec3D.Y: latitude, in radians.

Converts the given cartesian coordinates to geographic coordinates.


[Pure]
public method ToGeographic2D2 → (3)

in : float64

The cartesian X-coordinate.

in : float64

The cartesian Y-coordinate.

in : float64

The cartesian Z-coordinate.

returns → Vec2D

The geographic coordinates:
Vec3D.X: longitude, in radians
Vec3D.Y: latitude, in radians.

Converts the given cartesian coordinates to geographic coordinates.

To​Geographic3​D

2 overloads


[Pure]
public method ToGeographic3D1 → (1)

in : Vec3D

The cartesian coordinates.

returns → Vec3D

The geographic coordinates:
Vec3D.X: longitude, in radians
Vec3D.Y: latitude, in radians
Vec3D.Z: ellipsoid height, in cartesian units (see Unit).

Converts the given cartesian coordinates to geographic coordinates.


[Pure]
public method ToGeographic3D2 → (3)

in : float64

The cartesian X-coordinate.

in : float64

The cartesian Y-coordinate.

in : float64

The cartesian Z-coordinate.

returns → Vec3D

The geographic coordinates:
Vec3D.X: longitude, in radians
Vec3D.Y: latitude, in radians
Vec3D.Z: ellipsoid height, in cartesian units (see Unit).

Converts the given cartesian coordinates to geographic coordinates.

To​Lat​Lon

2 overloads


[Pure]
public method ToLatLon1 → (1)

in : Vec3D

The cartesian coordinates.

returns → LatLon

The geographic coordinates.

Converts the given cartesian coordinates to geographic coordinates.


[Pure]
public method ToLatLon2 → (3)

in : float64

The cartesian X-coordinate.

in : float64

The cartesian Y-coordinate.

in : float64

The cartesian Z-coordinate.

returns → LatLon

The geographic coordinates.

Converts the given cartesian coordinates to geographic coordinates.

To​Lat​Lon​Height

2 overloads


[Pure]
public method ToLatLonHeight1 → (2)

in : Vec3D

The cartesian coordinates.

vertical in : VerticalType

The vertical coordinate type.

returns → LatLonHeight

The geographic coordinates.

Converts the given cartesian coordinates to geographic coordinates.


[Pure]
public method ToLatLonHeight2 → (4)

in : float64

The cartesian X-coordinate.

in : float64

The cartesian Y-coordinate.

in : float64

The cartesian Z-coordinate.

vertical in : VerticalType

The vertical coordinate type.

returns → LatLonHeight

The geographic coordinates.

Converts the given cartesian coordinates to geographic coordinates.

To​Normal

3 overloads


[Pure]
public method ToNormal1 → (1)

lonLat in : Vec2D

The geographic coordinates:
Vec2D.X: longitude, in radians.
Vec2D.Y: latitude, in radians.

returns → Vec3D

The unit-length surface normal vector.

Computes the surface normal vector for the given geographic coordinates.


[Pure]
public method ToNormal2 → (1)

latLon in : LatLon

The geographic coordinates.

returns → Vec3D

The unit-length surface normal vector.

Computes the surface normal vector for the given geographic coordinates.


[Pure]
public method ToNormal3 → (2)

latitude in : float64

The latitude, in radians.

longitude in : float64

The longitude, in radians.

returns → Vec3D

The unit-length surface normal vector.

Computes the surface normal vector for the given geographic coordinates.

To​Vertical​Offset

3 overloads


[Pure]
public method ToVerticalOffset1 → (2)

lonLat in : Vec2D

The geographic coordinates:
Vec2D.X: longitude, in radians.
Vec2D.Y: latitude, in radians.

vertical in : VerticalType

The vertical coordinate type.

returns → float64

The vertical offset.

Computes the offset from the given vertical coordinate type to ellipsoid height.

The returned offset is defined as follows:

offset     = ellipsoid  - coordinate
ellipsoid  = coordinate + offset
coordinate = ellipsoid  - offset

where coordinate is the vertical coordinate of type vertical in and ellipsoid is the ellipsoid height of some point in world-space.


[Pure]
public method ToVerticalOffset2 → (2)

latLon in : LatLon

The geographic coordinates.

vertical in : VerticalType

The vertical coordinate type.

returns → float64

The vertical offset.

Computes the offset from the given vertical coordinate type to ellipsoid height.

The returned offset is defined as follows:

offset     = ellipsoid  - coordinate
ellipsoid  = coordinate + offset
coordinate = ellipsoid  - offset

where coordinate is the vertical coordinate of type vertical in and ellipsoid is the ellipsoid height of some point in world-space.


[Pure]
public method ToVerticalOffset3 → (3)

latitude in : float64

The latitude, in radians.

longitude in : float64

The longitude, in radians.

vertical in : VerticalType

The vertical coordinate type.

returns → float64

The vertical offset.

Computes the offset from the given vertical coordinate type to ellipsoid height.

The returned offset is defined as follows:

offset     = ellipsoid  - coordinate
ellipsoid  = coordinate + offset
coordinate = ellipsoid  - offset

where coordinate is the vertical coordinate of type vertical in and ellipsoid is the ellipsoid height of some point in world-space.

To​Vertical​Type


[Pure]
public method ToVerticalType → (2)

coords in : LatLonHeight

The geographic coordinates.

vertical in : VerticalType

The target vertical coordinate type.

returns → LatLonHeight

The resulting coordinates.

Translates the given geographic coordinates to the specified vertical coordinate type.

Transform


[Pure]
public method Transform → (1)

matrix in : Mat4D

The transformation matrix.

returns → Geocentric

The resulting Geocentric object.

Transform the geocentric coordinate space.

The output coordinates of ToGeocentric are transformed by matrix in. The input coordinates of ToGeographic are transformed by the inverse of matrix in. The output vectors of ToNormal are transformed by the inverse transpose of matrix in.

Vertical

2 overloads


public method Vertical1 → (3)

gravity in : IHeightmap

The gravity-related vertical offsets or null. The heightmap elevation is interpreted as the difference from the ellipsoid surface to the equipotential surface of the gravity model. If null, all gravity-related vertical offsets are assumed to be zero.

elevation in : IHeightmap

The elevation model or null. The heightmap elevation is interpreted according to elevationMode in. If null, all elevation values are assumed to be zero.

elevationMode in : bool

Defines how to interpret elevation values:
true : Elevation values are relative to the gravity model.
false : Elevation values are relative to the ellipsoid surface.

returns → Geocentric

this.

Provides additional objects for handling the vertical coordinate types VerticalType.Gravity and VerticalType.Height.

A IMapTransform object will be created for gravity in and elevation in, to convert latitude and longitude to dataset coordinates. Computations regarding coordinate conversion may be avoided by specifying heightmaps of type MapType.Cube that use the same coordinate system as this Geocentric object.

When reading elevation values from the given heightmaps, no interpolation will be performed by the Geocentric class. Instead, the nearest heightmap sample will be used. To enable interpolation, make sure to scale gravity in and/or elevation in to a suitable size, before passing them to this method (for example HeightmapsUtil.MaxSize).

GeorefException

If the geo-reference parameters of gravity in or elevation in are incomplete or invalid.


public method Vertical2 → (1)

mesh in : IMesh

The geocentric terrain mesh or null. The terrain mesh is used to compute vertical values of type VerticalType.HeightMesh. If null, VerticalType.Height values will be computed instead. The geometry (see IGeometry) of the terrain mesh is assumed to be based on the same coordinate system as this object.

returns → Geocentric

this

Provides additional objects for handling the vertical coordinate type VerticalType.HeightMesh.

Vertical​Clear


public method VerticalClear → ()

returns → Geocentric

this

Clears the additional objects handling the vertical coordinate types VerticalType.Gravity, VerticalType.Height and VerticalType.HeightMesh.

Vertical​Copy


public method VerticalCopy → (1)

other in : Geocentric

[not-null]
The other Geocentric object to copy the additional objects from.

returns → Geocentric

this

Provides additional objects for handling the vertical coordinate types VerticalType.Gravity, VerticalType.Height and VerticalType.HeightMesh, by copying them from the given other Geocentric object.

Public / Attributes

Coordinates


public attribute Coordinates → (get)

value : CoordinateSystem

[not-null]
The CoordinateSystem object.

Returns the geographic coordinate system of this Geocentric object.

Semi​Major​Axis


public attribute SemiMajorAxis → (get)

value : float64

The value of a

The semi-major axis: b

Semi​Minor​Axis


public attribute SemiMinorAxis → (get)

value : float64

The value of b

The semi-minor axis: b

Unit


public attribute Unit → (get)

value : UnitOfMeasure

[not-null]
The length unit.

The length unit of the geocentric coordinates.