cspice_vproj

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

#### Abstract

```
CSPICE_VPROJ calculates the projection of one 3-vector onto another
3-vector.

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

```

#### I/O

```
Given:

a   a double precision 3-vector. This vector is to be projected
onto the vector 'b'.

b   a double precision 3-vector. This vector is the vector
which receives the projection.

An implicit assumption exists that 'a' and 'b' are specified
in the same reference frame. If this is not the case, the numerical
result has no meaning.

the call:

cspice_vproj, a, b, p

returns:

p   is a double precision, 3-vector containing the projection
of 'a' onto 'b'. 'p' may overwrite either 'a' or 'b'. ('p' is
necessarily parallel to 'b'.)   If 'b' equals the zero vector
then the zero vector will return as 'p'.

```

#### 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 two vector sets.
;;
a = [ [ 6.D, 6, 6], \$
[ 6,   6, 6], \$
[ 6,   6, 0], \$
[ 6,   0, 0] ]

b = [ [ 2.D, 0, 0], \$
[-3,   0, 0], \$
[ 0,   7, 0], \$
[ 0,   0, 9] ]

;;
;; Calculate the projections.
;;
for i=0, 3 do begin

cspice_vproj, a(*,i), b(*,i), p

print, 'a = ', a(*,i)
print, 'b = ', b(*,i)
print, 'p = ', p
print

endfor

IDL outputs:

a =        6.0000000       6.0000000       6.0000000
b =        2.0000000       0.0000000       0.0000000
p =        6.0000000       0.0000000       0.0000000

a =        6.0000000       6.0000000       6.0000000
b =       -3.0000000       0.0000000       0.0000000
p =        6.0000000      -0.0000000      -0.0000000

a =        6.0000000       6.0000000       0.0000000
b =        0.0000000       7.0000000       0.0000000
p =        0.0000000       6.0000000       0.0000000

a =        6.0000000       0.0000000       0.0000000
b =        0.0000000       0.0000000       9.0000000
p =        0.0000000       0.0000000       0.0000000

```

```
None.

```

```
ICY.REQ

```

#### Version

```
-Icy Version 1.0.2, 23-NOV-2010, EDW (JPL)

Improved the I/O section. The section now meets NAIF standard
for Icy headers. Added example code and corresponding
output to the Examples section.

-Icy Version 1.0.1, 09-DEC-2005, EDW (JPL)

Added Examples section.

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

```

#### Index_Entries

```
3-vector projection

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