ray-earth-intersection
find the intersection of an ECEF point in space with the wgs84 oblate sphereoid that approximates the earth
example
var intersect =var ecef =var pt =var ray = -01-05-1var ipt =if !ipt return consoleconsoleconsole
output:
point: [ -1432372.0459134346, -2353986.7031978564, 5738444.021020929 ]
intersection: [ -1433090.557842638, -2357579.2628438743, 5731258.901728894 ]
api
var intersect =
var res = intersect(out, point, ray)
Compute the nearest intersection between point
, an array [x,y,z]
in ECEF
coordinates and the earth along ray
, an array [x,y,z]
.
ray
does not need to be normalized in this implementation.
When there is no intersection, res
will be null
.
The result is written to the 3-element array vector out
and returned as res
.
install
npm install ray-earth-intersection
license
BSD