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

cartesianToLonLat(cartesian){og.LonLat}

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

geodeticToCartesian(lon, lat, height){og.Vec3}

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

getEquatorialSize(){number}

Gets ellipsoid equatorial size.
Returns:
Type Description
number -

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.

getPolarSize(){number}

Gets ellipsoid polar size.
Returns:
Type Description
number -

getSurfaceHeight3v(coord, h){og.Vec3}

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

getSurfaceNormal3v(coord){og.Vec3}

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

hitRay(origin, direction){og.Vec3}

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

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.Vec3}

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