CSPICE_VPRJP orthogonally projects a vector onto a specified plane.
vin the vector to orthogonally project onto a specified plane.
[3,1] = size(vin); double = class(vin)
plane a structure describing a SPICE plane onto which to
[1,1] = size(plane); struct = class(plane)
The structure has the fields:
normal: [3,1] = size(normal); double = class(normal)
constant: [1,1] = size(constant); double = class(constant)
vout = cspice_vprjp( vin, plane )
vout the vector resulting from the orthogonal projection of 'vin'
onto 'plane'. 'vout' is the closest point in the specified
plane to 'vin'.
[3,1] = size(vout); double = class(vout)
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.
% Find the closest point in the ring plane of a planet to a
% spacecraft located at vec1 (in body-fixed coordinates).
vec1 = [ -5., 7., 2.2]';
% Define the vector normal as the normal to the
% equatorial ring plane, and the origin at body/ring center
norm = [ 0., 0., 1. ]';
orig = [ 0., 0., 0. ]';
% Create the plane structure.
ring_plane = cspice_nvp2pl( norm, orig );
% Project the position vector onto the ring plane...
proj = cspice_vprjp( vec1, ring_plane )
Projecting a vector v orthogonally onto a plane can be thought of
as finding the closest vector in the plane to v. This `closest
vector' always exists; it may be coincident with the original
Two related routines are cspice_vprjpi, which inverts an orthogonal
projection of a vector onto a plane, and cspice_vproj, which projects
a vector orthogonally onto another vector.
For important details concerning this module's function, please refer to
the CSPICE routine vprjp_c.
-Mice Version 1.0.1, 18-DEC-2014, EDW (JPL)
Edited I/O section to conform to NAIF standard for Mice documentation.
-Mice Version 1.0.0, 27-AUG-2012, EDW (JPL)
vector projection onto plane