TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Geocentric in Tinman.Terrain.Georef

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

sealed class Geocentric  

Remarks

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

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

Public / Constants

WGS84

A Geocentric object for WGS84.

public static readonly field WGS84
type Geocentric

Public / Attributes

SemiMajorAxis

The semi-major axis: b

public property SemiMajorAxis { get }
type float64
value The value of a

SemiMinorAxis

The semi-minor axis: b

public property SemiMinorAxis { get }
type float64
value The value of b

Unit

The length unit of the geocentric coordinates.

public property Unit { get }
type UnitOfMeasure
value [not-null] The length unit.

Public / Constructors

For

Creates a new instance of Geocentric.

public static method For (GeodeticDatum datum)
type Geocentric
params datum [not-null] The geodetic datum to use.
returns [not-null] The Geocentric object.

Remarks:

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


Creates a new instance of Geocentric.

public static method For (Ellipsoid ellipsoid, PrimeMeridian meridian = null)
type Geocentric
params ellipsoid [not-null] The ellipsoid.
  meridian The prime meridian to use as longitude 0°. Defaults to null.
returns [not-null] The Geocentric object.

Creates a new instance of Geocentric.

public static method For (float64 semiMajor, float64 semiMinor = 0, float64 meridian = 0, UnitOfMeasure unit = null)
type Geocentric
params semiMajor [>0] The semi-major axis, in cartesian units (see unit).
  semiMinor [>=0] The semi-minor axis, in cartesian units (see unit). If 0, the value of semiMajor will be used. Defaults to 0.
  meridian The prime meridian to use as longitude 0°, in radians. Defaults to 0.
  unit The cartesian unit. If null, Metre will be used. Defaults to null.
returns [not-null] The Geocentric object.

Public / Methods

ToGeocentric

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (LatLonHeight latLonHeight)
type Vec3D
params latLonHeight The geographic coordinates.
returns The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (Vec3D lonLatHeight, VerticalType vertical = VerticalType.Ellipsoid)
type Vec3D
params lonLatHeight The geographic coordinates:
X: longitude, in radians.
Y: latitude, in radians.
Z: height, in geocentric units (see Unit).
  vertical The vertical coordinate type. Defaults to Ellipsoid.
returns The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (Vec2D lonLat, float64 height = 0, VerticalType vertical = VerticalType.Ellipsoid)
type Vec3D
params lonLat The geographic coordinates:
X: longitude, in radians.
Y: latitude, in radians.
  height The height, in geocentric units (see Unit). Defaults to 0.
  vertical The vertical coordinate type. Defaults to Ellipsoid.
returns The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (LatLon latLon, float64 height = 0, VerticalType vertical = VerticalType.Ellipsoid)
type Vec3D
params latLon The geographic coordinates.
  height The height, in geocentric units (see Unit). Defaults to 0.
  vertical The vertical coordinate type. Defaults to Ellipsoid.
returns The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (float64 latitude, float64 longitude, float64 height = 0)
type Vec3D
params latitude The latitude, in radians.
  longitude The longitude, in radians.
  height The ellipsoid height, in geocentric units (see Unit). Defaults to 0.
returns The geocentric coordinates.

Converts the given geographic coordinates to cartesian coordinates.

[Pure]
public method ToGeocentric (float64 latitude, float64 longitude, float64 height, VerticalType vertical)
type Vec3D
params latitude The latitude, in radians.
  longitude The longitude, in radians.
  height The height, in geocentric units (see Unit).
  vertical The vertical coordinate type.
returns The geocentric coordinates.

ToGeographic2D

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToGeographic2D (Vec3D v)
type Vec2D
params v The cartesian coordinates.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians.

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToGeographic2D (float64 x, float64 y, float64 z)
type Vec2D
params x The cartesian X-coordinate.
  y The cartesian Y-coordinate.
  z The cartesian Z-coordinate.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians.

ToGeographic3D

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToGeographic3D (Vec3D v)
type Vec3D
params v The cartesian coordinates.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToGeographic3D (float64 x, float64 y, float64 z)
type Vec3D
params x The cartesian X-coordinate.
  y The cartesian Y-coordinate.
  z The cartesian Z-coordinate.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

ToLatLon

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToLatLon (Vec3D v)
type LatLon
params v The cartesian coordinates.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToLatLon (float64 x, float64 y, float64 z)
type LatLon
params x The cartesian X-coordinate.
  y The cartesian Y-coordinate.
  z The cartesian Z-coordinate.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

ToLatLonHeight

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToLatLonHeight (Vec3D v, VerticalType vertical)
type LatLonHeight
params v The cartesian coordinates.
  vertical The vertical coordinate type.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

Converts the given cartesian coordinates to geographic coordinates.

[Pure]
public method ToLatLonHeight (float64 x, float64 y, float64 z, VerticalType vertical)
type LatLonHeight
params x The cartesian X-coordinate.
  y The cartesian Y-coordinate.
  z The cartesian Z-coordinate.
  vertical The vertical coordinate type.
returns The geographic coordinates:
X: longitude, in radians
Y: latitude, in radians
Z: ellipsoid height, in cartesian units (see Unit).

ToNormal

Computes the surface normal vector for the given geographic coordinates.

[Pure]
public method ToNormal (Vec2D lonLat)
type Vec3D
params lonLat The geographic coordinates:
X: longitude, in radians.
Y: latitude, in radians.
returns The unit-length surface normal vector.

Computes the surface normal vector for the given geographic coordinates.

[Pure]
public method ToNormal (LatLon latLon)
type Vec3D
params latLon The geographic coordinates.
returns The unit-length surface normal vector.

Computes the surface normal vector for the given geographic coordinates.

[Pure]
public method ToNormal (float64 latitude, float64 longitude)
type Vec3D
params latitude The latitude, in radians.
  longitude The longitude, in radians.
returns The unit-length surface normal vector.

ToVerticalOffset

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

[Pure]
public method ToVerticalOffset (Vec2D lonLat, VerticalType vertical)
type float64
params lonLat The geographic coordinates:
X: longitude, in radians.
Y: latitude, in radians.
  vertical The vertical coordinate type.
returns The vertical offset.

Remarks:

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 and ellipsoid is the ellipsoid height of some point in world-space.


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

[Pure]
public method ToVerticalOffset (LatLon latLon, VerticalType vertical)
type float64
params latLon The geographic coordinates.
  vertical The vertical coordinate type.
returns The vertical offset.

Remarks:

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 and ellipsoid is the ellipsoid height of some point in world-space.


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

[Pure]
public method ToVerticalOffset (float64 latitude, float64 longitude, VerticalType vertical)
type float64
params latitude The latitude, in radians.
  longitude The longitude, in radians.
  vertical The vertical coordinate type.
returns The vertical offset.

Remarks:

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 and ellipsoid is the ellipsoid height of some point in world-space.

ToVerticalType

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

[Pure]
public method ToVerticalType (LatLonHeight coords, VerticalType vertical)
type LatLonHeight
params coords The geographic coordinates.
  vertical The target vertical coordinate type.
returns The resulting coordinates.

Transform

Transform the geocentric coordinate space.

[Pure]
public method Transform (Mat4D matrix)
type Geocentric
params matrix The transformation matrix.
returns [not-null] The resulting Geocentric object.

Remarks:

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

Vertical

Provides additional objects for handling the vertical coordinate types HeightMesh.

[Pure]
public method Vertical (HeightAboveGround mesh)
type Geocentric
params mesh The geocentric terrain mesh or null. The terrain mesh is used to compute vertical values of type HeightMesh. If null, Height values will computed instead. The geometry (see IGeometry) of the terrain mesh is assumed to be based on the same coordinate system as this object.
returns [not-null] The resulting Geocentric object.

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

[Pure]
public method Vertical (IHeightmap gravity, IHeightmap elevation, bool elevationMode)
type Geocentric
params gravity 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 The elevation model or null. The heightmap elevation is interpreted according to elevationMode. If null, all elevation values are assumed to be zero.
  elevationMode 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 [not-null] The resulting Geocentric object.

Remarks:

The given heightmaps are assumed to be of type Cube and to have the same geodetic datum as this object is using.