getSegmentProjection

Adapted to cartesian coordinates using Spherical model

Ellipsoid model using ECEF seems to not work due to Earth radius factor

See also

Stackoverflow

(https://stackoverflow.com/questions/1299567/how-to-calculate-distance-from-a-point-to-a-line-segment-on-a-sphere)