cspice_vdist

 Abstract I/O Examples Particulars Required Reading Version Index_Entries

#### Abstract

```
CSPICE_VDIST returns the distance between two
three-dimensional vectors.

```

#### I/O

```
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'.

```

#### Examples

```
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 3-vectors,
% 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.

```

#### Required Reading

```
For important details concerning this module's function, please refer to
the CSPICE routine vdist_c.

MICE.REQ

```

#### Version

```
-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, 22-NOV-2005, EDW (JPL)

```

#### Index_Entries

```
distance between 3-dimensional vectors

```
`Wed Apr  5 18:00:36 2017`