CSPICE_NPELPT calculates the location on an ellipse closest
to a specified point, both in threedimensional space,
and the distance between the ellipse and the point.
Given:
point a 3vector defining a location in 3dimensional space.
[3,1] = size(point); double = class(point)
ellipse a SPICE ellipse.
[1,1] = size(ellipse); struct = class(ellipse)
The structure has the fields:
center: [3,1] = size(center); double = class(center)
semiMinor: [3,1] = size(semiMinor); double = class(semiMinor)
semiMajor: [3,1] = size(semiMajor); double = class(semiMajor)
the call:
[ pnear, dist ] = cspice_npelpt( point, ellipse )
returns:
pnear the 3vector defining the location on the ellipse nearest
to 'point'.
[3,1] = size(point); double = class(point)
dist the distance between the calculated point 'pnear'
and 'point'.
dist =  pnear  point 
[1,1] = size(dist); double = class(dist)
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
Given an ellipse and a point in 3dimensional space, if the
orthogonal projection of the point onto the plane of the ellipse
is on or outside of the ellipse, then there is a unique point on
the ellipse closest to the original point. This routine finds
that nearest point on the ellipse. If the projection falls inside
the ellipse, there may be multiple points on the ellipse that are
at the minimum distance from the original point. In this case,
one such closest point will be returned.
This routine returns a distance, rather than an altitude, in
contrast to the Mice routine cspice_nearpt. Because our ellipse is
situated in 3space and not 2space, the input point is not
`inside' or `outside' the ellipse, so the notion of altitude does
not apply to the problem solved by this routine. In the case of
cspice_nearpt, the input point is on, inside, or outside the ellipsoid,
so it makes sense to speak of its altitude.
For important details concerning this module's function, please refer to
the CSPICE routine npelpt_c.
MICE.REQ
ELLIPSES.REQ
Mice Version 1.0.0, 14NOV2014, EDW (JPL)
nearest point on ellipse to point
