CSPICE_VDIST returns the distance between two
threedimensional vectors.
Given:
v1 is an arbitrary vector(s).
[3,n] = size(v1); double = class(v1)
v2 also an arbitrary vector(s).
[3,n] = size(v2); double = class(v2)
the call:
dist = cspice_vdist(v1, v2)
returns:
dist the value(s) describing the distance(s) between 'v1' and 'v2',
distance defined as:
 v1  v2 ,
_ _
where  x  indicates the Euclidean norm of the vector x.
[1,n] = size(dist); double = class(dist)
'dist' 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 the distance
% between the coordinates.
%
v1 = [1; 0; 0]
v2 = [1; 0; 0]
vdist = cspice_vdist( v1, v2 )
MATLAB outputs:
v1 =
1
0
0
v2 =
1
0
0
vdist =
0
%
% Another vector set.
%
v1 = [1; 0; 0]
v2 = [0; 1; 0]
vdist = cspice_vdist( v1, v2 )
MATLAB outputs:
v1 =
1
0
0
v2 =
0
1
0
dist =
1.41421356237310
%
% 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] ]
vdist = cspice_vdist( v1, v2 )
MATLAB outputs:
v1 =
1 1
0 0
0 0
v2 =
1 0
0 1
0 0
dist =
0 1.41421356237310
None.
For important details concerning this module's function, please refer to
the CSPICE routine vdist_c.
MICE.REQ
Mice Version 1.0.1, 18DEC2014, EDW (JPL)
Edited I/O section to conform to NAIF standard for Mice documentation.
Mice Version 1.0.0, 22NOV2005, EDW (JPL)
distance between 3dimensional vectors
