Index Page vproj_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       void vproj_c ( ConstSpiceDouble   a[3],
                      ConstSpiceDouble   b[3],
                      SpiceDouble        p[3] )
#### Abstract
       vproj_c finds the projection of one vector onto another vector.
       All vectors are 3-dimensional.
#### Required_Reading
       None.
#### Keywords
       VECTOR
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
        a         I    The vector to be projected.
        b         I    The vector onto which a is to be projected.
        p         O    The projection of a onto b.
#### Detailed_Input
       a     is a double precision, 3-dimensional vector.  This
              vector is to be projected onto the vector b.

       b     is a double precision, 3-dimensional vector.  This
              vector is the vector which receives the projection.
#### Detailed_Output
       p     is a double precision, 3-dimensional vector containing
              the projection of a onto b.  p may overwrite either
              a or b.  (p is necessarily parallel to b.)  If b is
              the zero vector then p will be returned as the zero vector.
#### Parameters
       None.
#### Exceptions
       Error free.
#### Files
       None.
#### Particulars
       The given any vectors a and b there is a unique decomposition
       of a as a sum v + p such that v  the dot product of v and b
       is zero, and the dot product of p with b is equal the product
       of the lengths of p and b.  p is called the projection of
       a onto b.  It can be expressed mathematically as

              dot(a,b)
              -------- * b
              dot(b,b)

       (This is not necessarily the prescription used to compute
       the projection. It is intended only for descriptive purposes.)
#### Examples
       The following table gives sample inputs and results from calling
       vproj_c.

        a                   b                        p
        --------------------------------------------------
        (6, 6, 6)      ( 2, 0, 0)                (6, 0, 0)
        (6, 6, 6)      (-3, 0, 0)                (6, 0, 0)
        (6, 6, 0)      ( 0, 7, 0)                (0, 6, 0)
        (6, 0, 0)      ( 0, 0, 9)                (0, 0, 0)
#### Restrictions
       None.
#### Literature_References
       REFERENCE: Any reasonable calculus text (for example Thomas)
#### Author_and_Institution
       W.L. Taber      (JPL)
#### Version
       -CSPICE Version 1.0.0, 08-FEB-1998   (EDW)
#### Index_Entries
       3-dimensional vector projection
#### Link to routine vproj_c source file vproj_c.c

    Wed Jun  9 13:05:32 2010