Class: Ellipsoid

og/ellipsoid/Ellipsoid~Ellipsoid

Class represents a plant ellipsoid.

new Ellipsoid(equatorialSize, polarSize)

Name Type Description
equatorialSize number Equatorial ellipsoid size.
polarSize number Polar ellipsoid size.

Methods

staticmodule:og/ellipsoid/Ellipsoid~Ellipsoid.getFinalBearing(lonLat1, lonLat2){number}

Returns final bearing arriving at destination destination point from lonLat1 point; the final bearing will differ from the initial bearing by varying degrees according to distance and latitude.
Name Type Description
lonLat1 LonLat Longitude/latitude of source point.
lonLat2 LonLat Longitude/latitude of destination point.
Returns:
Type Description
number Final bearing in degrees from north.

staticmodule:og/ellipsoid/Ellipsoid~Ellipsoid.getInitialBearing(lonLat1, lonLat2){number}

Returns the (initial) bearing from source to destination point on the great circle.
Name Type Description
lonLat1 LonLat Longitude/latitude of source point.
lonLat2 LonLat Longitude/latitude of destination point.
Returns:
Type Description
number Initial bearing in degrees from north.

staticmodule:og/ellipsoid/Ellipsoid~Ellipsoid.getIntermediatePointOnGreatCircle(lonLat1, lonLat2, fraction){LonLat}

Returns the point at given fraction between two points on the great circle.
Name Type Description
lonLat1 LonLat Longitude/Latitude of source point.
lonLat2 LonLat Longitude/Latitude of destination point.
fraction number Fraction between the two points (0 = source point, 1 = destination point).
Returns:
Type Description
LonLat Intermediate point between points.

staticmodule:og/ellipsoid/Ellipsoid~Ellipsoid.getMiddlePointOnGreatCircle(lonLat1, lonLat2){LonLat}

Returns the midpoint between two points on the great circle.
Name Type Description
lonLat1 LonLat Longitude/latitude of first point.
lonLat2 LonLat Longitude/latitude of second point.
Returns:
Type Description
LonLat Midpoint between points.

staticmodule:og/ellipsoid/Ellipsoid~Ellipsoid.intersection(p1, brng1, p2, brng2){LonLat|null}

Returns the point of intersection of two paths defined by point and bearing.
Name Type Description
p1 LonLat First point.
brng1 number Initial bearing from first point.
p2 LonLat Second point.
brng2 number Initial bearing from second point.
Returns:
Type Description
LonLat | null Destination point (null if no unique intersection defined).

cartesianToLonLat(cartesian){LonLat}

Gets Wgs84 geodetic coordiantes from cartesian ECEF.
Name Type Description
cartesian Vec3 Cartesian coordinates.
Returns:
Type Description
LonLat -

geodeticToCartesian(lon, lat, height){Vec3}

Gets cartesian ECEF from Wgs84 geodetic coordiantes.
Name Type Default Description
lon Number Longitude.
lat Number Latitude.
height Number 0 Height.
Returns:
Type Description
Vec3 -

getEquatorialSize(){number}

Gets ellipsoid equatorial size.
Returns:
Type Description
number -

getGreatCircleDestination()

Calculates the destination point given start point lat / lon, bearing(deg) and distance (m). Taken from http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens 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

getGreatCircleDistance(lonLat1, lonLat2){number}

Returns the distance from one point to another(using haversine formula) on the great circle.
Name Type Description
lonLat1 LonLat Longitude/latitude of source point.
lonLat2 LonLat Longitude/latitude of destination point.
Returns:
Type Description
number Distance between points.

getPolarSize(){number}

Gets ellipsoid polar size.
Returns:
Type Description
number -

getSurfaceNormal3v(coord){Vec3}

Gets ellipsoid surface normal.
Name Type Description
coord Vec3 Spatial coordiantes.
Returns:
Type Description
Vec3 -

hitRay(origin, direction){Vec3}

Returns ray vector hit ellipsoid coordinates. If the ray doesn't hit ellipsoid returns null.
Name Type Description
origin Vec3 Ray origin point.
direction Vec3 Ray direction.
Returns:
Type Description
Vec3 -

lonLatToCartesian(lonlat){Vec3}

Gets cartesian ECEF from Wgs84 geodetic coordiantes.
Name Type Description
lonlat LonLat Degrees geodetic coordiantes.
Returns:
Type Description
Vec3 -

lonLatToCartesianRes(lonlat, res){Vec3}

Gets cartesian ECEF from Wgs84 geodetic coordiantes.
Name Type Description
lonlat LonLat Degrees geodetic coordiantes.
res Vec3 Output result.
Returns:
Type Description
Vec3 -