cspice_vdistg

 Abstract I/O Examples Particulars Required Reading Version Index_Entries
```
```

#### Abstract

```
CSPICE_VDISTG returns the double precision value of the distance between
two double precision N-vectors.

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

```

#### I/O

```
Given:

vec1,
vec2    two double precision N-vectors, the distance between
which is desired.

the call:

dist = cspice_vdistg( vec1, vec2 )

returns:

dist   double precision scalar distance between 'vec1' and 'vec2'.
This is defined as

||  v1 - v2  ||,

where || x || indicates the Euclidean norm of the vector x.

```

#### 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.

vec1 = [ 12.3d,    -4.32d,  76.d,   1.87d  ]
vec2 = [ 23.0423d, -11.99d, -0.10d, -99.1d ]

print, cspice_vdistg( vec1, vec2)

IDL outputs:

127.12347

Native IDL code to calculate the same scalar result:

norm( vec1 - vec2 )

The IDL function accepts an arbitrary size N-vectors.

```

#### Particulars

```
The Euclidean norm of an n-dimensional vector

(x ,  x , ... , x )
1    2         n

is defined as

1/2
2        2                  2
(   x    +   x    +  . . .  +   x     ).
1        2                  n

This number is the distance of the point (x, y, z) from the
origin.  If n = 3, and A and B are two vectors whose components
are

( a, a, a )    and    ( b, b, b ),

then the distance between A and B is the norm of the difference
A - B, which has components

(  a - b,  a - b,  a - b  ).

A related routine is cspice_vdist, which computes the distance between
two 3-vectors.

```

```
ICY.REQ

```

#### Version

```
-Icy Version 1.0.1, 13-JUN-2011, EDW (JPL)

Edits to comply with NAIF standard for Icy headers.

-Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

```

#### Index_Entries

```
distance between n-dimensional vectors

```
`Wed Apr  5 17:58:04 2017`