CSPICE_VSEP returns the separation angle in radians between
two double precision, 3vectors. This angle is defined as zero
if either vector is zero.
Given:
v1 an arbitrary vector(s).
[3,n] = size(v1); double = class(v1)
v2 another arbitrary vector(s).
[3,n] = size(v2); double = class(v2)
'v1' or 'v2' or both may be the zero vector.
An implicit assumption exists that 's1' and 's2' are specified
in the same reference frame using the same coordinate system.
If this is not the case, the numerical result has no meaning.
the call:
vsep = cspice_vsep(v1, v2)
returns:
vsep the value(s) of the angular separation between 'v1' and 'v2'
expressed in radians. If either 'v1' or 'v2' is the zero
vector, then cspice_vsep return value has value 0 radians.
[1,n] = size(vsep); double = class(vsep)
'sep' returns with the same vectorization measure, N, as
'v1' and 'v2'
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.
%
% Define a set of vectors, calculate angular
% separation as measured in radians.
%
v1 = [1; 0; 0]
v2 = [1; 0; 0]
sep = cspice_vsep( v1, v2 )
MATLAB outputs:
v1 =
1
0
0
v2 =
1
0
0
sep =
0
%
% Another vector set.
%
v1 = [1; 0; 0]
v2 = [0; 1; 0]
sep = cspice_vsep( v1, v2 )
MATLAB outputs:
v1 =
1
0
0
v2 =
0
1
0
sep =
1.57079632679490
%
% Instead of two calls with 3vectors,
% vectorize the input as two 3X2 array.
%
v1 = [ [1; 0; 0], [1; 0; 0] ]
v2 = [ [1; 0; 0], [0; 1; 0] ]
sep = cspice_vsep( v1, v2 )
MATLAB outputs:
v1 =
1 1
0 0
0 0
v2 =
1 0
0 1
0 0
sep =
0 1.57079632679490
None.
For important details concerning this module's function, please refer to
the CSPICE routine vsep_c.
MICE.REQ
Mice Version 1.0.2, 17DEC2014, EDW (JPL)
Edited I/O section to conform to NAIF standard for Mice documentation.
Corrections made to version section numbering. 10APR2010
notation now numbered as 1.0.1.
Mice Version 1.0.1, 10APR2010, EDW (JPL)
Edits to header I/O section.
Mice Version 1.0.0, 22NOV2005, EDW (JPL)
angular separation of 3dimensional vectors
