Ellipsoid

Class represents a plant ellipsoid.

Constructor

new Ellipsoid(equatorialSize, polarSize)

Parameters:
NameTypeDescription
equatorialSizenumber

Equatorial ellipsoid size.

polarSizenumber

Polar ellipsoid size.

Methods

cartesianToLonLat(cart) → {LonLat}

Converts 3d cartesian coordinates to geodetic

Parameters:
NameTypeDescription
cartVec3

Cartesian coordinates

Returns:
  • Geodetic coordinates
Type: 
LonLat

cartesianToLonLatRes(cart, res) → {LonLat}

Converts 3d cartesian coordinates to geodetic

Parameters:
NameTypeDescription
cartVec3

Cartesian coordinates

resLonLat

Link geodetic coordinates variable

Returns:
  • Geodetic coordinates
Type: 
LonLat

direct(lonLat, azimuth, dist)

Calculates the destination point given start point lat / lon, azimuth(deg) and distance (m). Source: http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens http://mathiasbynens.be/ Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Parameters:
NameTypeDescription
lonLatLonLat

Origin coordinates

azimuthnumber

View azimuth in degrees

distnumber

Distance to the destination point coordinates in meters

Returns:

geodeticToCartesian(lon, lat, height, res) → {Vec3}

Gets cartesian ECEF from Wgs84 geodetic coordinates.

Parameters:
NameTypeDefaultDescription
lonNumber

Longitude.

latNumber

Latitude.

heightNumber0

Height.

resVec3

Output result variable.

Returns:
Type: 
Vec3

getBearingDestination(lonLat1, bearing, distance) → {LonLat}

Parameters:
NameTypeDefaultDescription
lonLat1
bearing0
distance0
To Do
  • this is not precise function, needs to be replaced or removed
Returns:
Type: 
LonLat

getEquatorialSize() → {number}

Gets ellipsoid equatorial size.

Returns:
Type: 
number

getGreatCircleDestination(lonLat, azimuth, dist) → {LonLat}

Calculates the destination point given start point lat / lon, azimuth(deg) and distance (m). Source: http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens http://mathiasbynens.be/ Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Parameters:
NameTypeDescription
lonLatLonLat

Origin coordinates

azimuthnumber

View azimuth in degrees

distnumber

Distance to the destination point coordinates in meters

Returns:
  • Destination point coordinates
Type: 
LonLat

getIntermediatePointOnGreatCircle(lonLat1, lonLat2, fraction) → {LonLat}

Returns the point at given fraction between two points on the great circle.

Parameters:
NameTypeDescription
lonLat1LonLat

Longitude/Latitude of source point.

lonLat2LonLat

Longitude/Latitude of destination point.

fractionnumber

Fraction between the two points (0 = source point, 1 = destination point).

Returns:

Intermediate point between points.

Type: 
LonLat

getPolarSize() → {number}

Gets ellipsoid polar size.

Returns:
Type: 
number

getSurfaceNormal3v(coord) → {Vec3}

Gets ellipsoid surface normal.

Parameters:
NameTypeDescription
coordVec3

Spatial coordinates.

Returns:
Type: 
Vec3

hitRay(origin, direction) → {Vec3}

Returns cartesian coordinates of the intersection of a ray and an ellipsoid. If the ray doesn't hit ellipsoid returns null.

Parameters:
NameTypeDescription
originVec3

Ray origin point.

directionVec3

Ray direction.

Returns:
Type: 
Vec3

inverse(lonLat1, lonLat2) → {IInverseResult}

Returns inverse Geodesic solution for two points

Parameters:
NameTypeDescription
lonLat1LonLat

start coordinates point

lonLat2LonLat

end coordinates point

Returns:
  • Contains distance, initialAzimuth, and finalAzimuth values
Type: 
IInverseResult

lonLatToCartesian(lonlat) → {Vec3}

Calculate cartesian coordinates by its ECEF geodetic coordinates.

Parameters:
NameTypeDescription
lonlatLonLat

Geodetic coordinates.

Returns:
Type: 
Vec3

lonLatToCartesianRes(lonlat, res) → {Vec3}

Calculate cartesian coordinates by its ECEF geodetic coordinates.

Parameters:
NameTypeDescription
lonlatLonLat

Geodetic coordinates.

resVec3

Output variable reference.

Returns:
Type: 
Vec3

projToSurface(p) → {LonLat}

Gets Wgs84 geodetic coordinates from cartesian ECEF.

Parameters:
NameTypeDescription
pVec3

Cartesian coordinates.

Returns:
Type: 
LonLat

rhumbDistanceTo(startLonLat, endLonLat) → {number}

Returns the distance travelling from ‘this’ point to destination point along a rhumb line.

Parameters:
NameTypeDescription
startLonLatLonLat

coordinates.

endLonLatLonLat

coordinates

Returns:

Distance in m between this point and destination point (same units as radius).

Type: 
number

(static) getBearing(lonLat1, lonLat2) → {number}

REMOVE ASAP after

Parameters:
NameTypeDescription
lonLat1
lonLat2
Returns:
Type: 
number

(static) getIntermediatePointOnGreatCircle(lonLat1, lonLat2, fraction) → {LonLat}

Returns the point at given fraction between two points on the great circle.

Parameters:
NameTypeDescription
lonLat1LonLat

Longitude/Latitude of source point.

lonLat2LonLat

Longitude/Latitude of destination point.

fractionnumber

Fraction between the two points (0 = source point, 1 = destination point).

Returns:

Intermediate point between points.

Type: 
LonLat