Class: Ellipsoid

og.Ellipsoid

new og.Ellipsoid(equatorialSize, polarSize)

Class represents a plant ellipsoid.
Name Type Description
equatorialSize number Equatorial ellipsoid size.
polarSize number Polar ellipsoid size.

Methods

cartesianToLonLat(cartesian){og.LonLat}

Gets Wgs84 geodetic coordiantes from cartesian ECEF.
Name Type Description
cartesian og.math.Vector3 Cartesian coordinates.
Returns:
Type Description
og.LonLat

getEquatorialSize()

Gets ellipsoid equatorial size.

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 og.LonLat Longitude/latitude of source point.
lonLat2 og.LonLat Longitude/latitude of destination point.
Returns:
Type Description
number Final bearing in degrees from north.

getGreatCircleDistance(lonLat1, lonLat2){number}

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

getInitialBearing(lonLat1, lonLat2){number}

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

getIntermediatePointOnGreatCircle(lonLat1, lonLat2, fraction){og.LonLat}

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

getMiddlePointOnGreatCircle(lonLat1, lonLat2){og.LonLat}

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

getSurfaceHeight3v(coord, h){og.math.Vector3}

Gets the cartesian point on the height over the ellipsoid surface.
Name Type Description
coord og.math.Vector3 Spatial ellipsoid coordiantes.
h number Height this spatial coordinates.
Returns:
Type Description
og.math.Vector3

getSurfaceNormal3v(coord){og.math.Vector3}

Gets ellipsoid surface normal.
Name Type Description
coord og.math.Vector3 Spatial coordiantes.
Returns:
Type Description
og.math.Vector3

hitRay(origin, direction){og.math.Vector3}

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

intersection(p1, brng1, p2, brng2){og.LonLat|null}

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

lonLatToCartesian(lonlat){og.math.Vector3}

Gets cartesian ECEF from Wgs84 geodetic coordiantes.
Name Type Description
lonlat og.LonLat Degrees geodetic coordiantes.
Returns:
Type Description
og.math.Vector3