cspice_vperp

 Abstract I/O Examples Particulars Required Reading Version Index_Entries

#### Abstract

```
CSPICE_VPERP calculates the component of a vector perpendicular to a
second vector.

```

#### I/O

```
Given:

a   the vector(s) whose component orthogonal to 'b' is sought.

[3,n] = size(a); double = class(a)

(There is a unique decomposition of a into a sum v + p, where v is
parallel to b and p is orthogonal to b.  We want the component p.)

b   the second vector(s) used as a reference for the decomposition
of 'a'.

[3,n] = size(b); double = class(b)

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:

vperp = cspice_vperp( a, b )

returns:

vperp   the 3-vector(s) containing the component of 'a' orthogonal
to 'b'.

[3,n] = size(vperp); double = class(vperp)

'vperp' returns with the same vectorization measure, N, as
'a' and 'b'

```

#### 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, 6, 6]', ...
[ 6, 6, 6]', ...
[ 6, 6, 0]', ...
[ 6, 0, 0]' ]

b = [ [ 2, 0, 0]', ...
[-3, 0, 0]', ...
[ 0, 7, 0]', ...
[ 0, 0, 9]' ]

%
% Calculate the decomposition.
%
p = cspice_vperp( a, b )

MATLAB outputs:

a =

6     6     6     6
6     6     6     0
6     6     0     0

b =

2    -3     0     0
0     0     7     0
0     0     0     9

p =

0     0     6     6
6     6     0     0
6     6     0     0

```

#### Particulars

```
None.

```

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

MICE.REQ

```

#### Version

```
-Mice Version 1.0.1, 09-NOV-2012, EDW (JPL)

Edited I/O section to conform to NAIF standard for Mice documentation.

-Mice Version 1.0.0, 22-APR-2010, EDW (JPL)

```

#### Index_Entries

```
perpendicular component of a 3-vector

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