Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

# Ellipsoid Class

The Ellipsoid class.

## Ellipsoid ()

Constructor. Creates a new Ellipsoid class instance (WGS84 Ellipsoid).

## Ellipsoid (double semimajor_axis, double flattening)

Constructor. Creates a new Ellipsoid class instance with given semi-major axis and flattening.

### Arguments

• double semimajor_axis - Semimajor axis (the longest radius) of the ellipsoid.
• double flattening - Flattening of a sphere. If the value is 0, the ellipsoid has a sphere shape, for 1 the ellipsoid has a circle (completely flat) shape.

## Math::vec3getENUTangentPoint (const Math::dvec3 & geodetic_coords, const Math::vec3 & surface_coords)

Returns local point coordinates based on the geographical coordinates.

### Arguments

• const Math::dvec3 & geodetic_coords - Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters) as an point of junction.
• const Math::vec3 & surface_coords - Surface coordinates to be converted (flatten) to local (offset related to point of junction).

### Return value

Local point coordinates.

## Math::vec3getENUSurfacePoint (const Math::dvec3 & geodetic_coords, const Math::vec3 & local_coords)

Returns surface point by using local point coordinates.

### Arguments

• const Math::dvec3 & geodetic_coords - Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters) as an point of junction.
• const Math::vec3 & local_coords - Local coordinates to converted (curved) to surface coordinates (offset related to point of junction).

### Return value

Surface point coordinates.

## doublegetSemimajorAxis ()

Returns semimajor axis length of the ellipsoid in units.

### Return value

Semimajor axis of the ellipsoid.

## voidsetSemimajorAxis (double axis)

Sets new semimajor axis of the ellipsoid.

### Arguments

• double axis - Semimajor axis length in units.

## doublegetSemiminorAxis ()

Returns semiminor axis of the ellipsoid in units.

### Return value

Semiminor axis of the ellipsoid in units.

## doublegetFlattening ()

Returns flattening coefficient of the ellipsoid.

### Return value

Flattening coefficient of the ellipsoid.

## voidsetFlattening (double flattening)

Sets new flattening for the ellipsoid.

### Arguments

• double flattening - Flattening coefficient of the ellipsoid. If the value is 0, the ellipsoid has a sphere shape, for 1 the ellipsoid has a circle (completely flat) shape.

## doublegetSemimajorEccentricitySqr ()

Returns the squared eccentricity calculated along the semimajor axis.

### Return value

Squared eccentricity calculated along the semimajor axis.

## doublegetSemiminorEccentricitySqr ()

Returns the squared eccentricity calculated along the semiminor axis.

### Return value

Squared eccentricity calculated along the semiminor axis.

## intgetMode ()

Returns the calculation mode int value: 1 if the mode is MODE_ACCURATE, 0 if the mode is MODE_FAST.

### Return value

1 if the mode is MODE_ACCURATE, 0 if the mode is MODE_FAST.

## voidsetMode (int mode)

Set the calculation mode.

### Arguments

• int mode - The variable of the calculation mode. It can be one of the following:

Returns the mean radius of the ellipsoid.

### Return value

The mean radius of the ellipsoid.

## Math::dmat4getSurfaceWorldTransform (const Math::dvec3 & geodetic_coords)

Returns world transformation matrix of the given geo coordinates.

### Arguments

• const Math::dvec3 & geodetic_coords - Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters)).

### Return value

World transformation matrix of the given coordinates.

## Math::mat3getSurfaceBasis (const Math::dvec3 & geodetic_coords)

Returns surface basis (the matrix without translate).

### Arguments

• const Math::dvec3 & geodetic_coords - Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters)).

### Return value

Surface basis (the matrix without translate).

## Math::dvec3toECF (const Math::dvec3 & geodetic_coords)

Converts geodetic coordinates to Cartesian (ECF).

### Arguments

• const Math::dvec3 & geodetic_coords - Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters)) to be converted to Cartesian.

### Return value

Cartesian coordinates.

## Math::dvec3toGeodetic (const Math::dvec3 & cartesian_coords)

Converts Cartesian (ECF) coordinates to Ellipsoid.

### Arguments

• const Math::dvec3 & cartesian_coords - Cartesian coordinates to be converted.

### Return value

Ellipsoid coordinates (latitude (degrees), longitude (degrees) and altitude (meters)

## toENU (const Math::dvec3 & geodetic_origin, const Math::dvec3 & geodetic_coords)

### Arguments

• const Math::dvec3 & geodetic_origin
• const Math::dvec3 & geodetic_coords

## getNEDWorldRotation (const Math::dvec3 & geodetic_origin)

### Arguments

• const Math::dvec3 & geodetic_origin

## getENUWorldRotation (const Math::dvec3 & geodetic_origin)

### Arguments

• const Math::dvec3 & geodetic_origin

## getNEDWorldTransform (const Math::dvec3 & geodetic_origin)

### Arguments

• const Math::dvec3 & geodetic_origin

## getNEDSurfacePoint (const Math::dvec3 & geodetic_origin, const Math::dvec3 & tangent_point)

### Arguments

• const Math::dvec3 & geodetic_origin
• const Math::dvec3 & tangent_point

## toNED (const Math::dvec3 & geodetic_origin, const Math::dvec3 & geodetic_coords)

### Arguments

• const Math::dvec3 & geodetic_origin
• const Math::dvec3 & geodetic_coords

## getENUWorldTransform (const Math::dvec3 & geodetic_origin)

### Arguments

• const Math::dvec3 & geodetic_origin

## getNEDTangentPoint (const Math::dvec3 & geodetic_origin, const Math::dvec3 & surface_point)

### Arguments

• const Math::dvec3 & geodetic_origin
• const Math::dvec3 & surface_point

## int MODE_FAST

### Description

A calculation mode is computed by using Great-circle distance formula. It works pretty fast, but you'll get positioning errors on big (~80000x80000 units) distances.

## int MODE_ACCURATE

### Description

A calculation mode uses Vincenty's formula to calculate distances on the surface of the ellipsoid with a millimeter precision. It takes more time for calculation, but the accuracy of positioning is awesome.
Last update: 2017-07-03