- Abstract
Compute the magnitude of a double precision, 3-dimensional vector.
- Required_Reading
None.
- Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I Vector whose magnitude is to be found.
The function returns the norm of v1.
- Detailed_Input
v1 may be any 3-dimensional, double precision vector.
- Detailed_Output
The function returns the magnitude of v1 calculated in a numerically
stable way.
- Particulars
vnorm_c takes care to avoid overflow while computing the norm of the
input vector v1. vnorm_c finds the component of v1 whose magnitude
is the largest. Calling this magnitude v1max, the norm is computed
using the formula
vnorm_c = v1max * || (1/v1max) * v1 ||
where the notation ||x|| indicates the norm of the vector x.
- Examples
The following table show the correlation between various input
vectors v1 and vnorm_c:
v1 vnorm_c
-----------------------------------------------------------------
( 1.e0, 2.e0, 2.e0 ) 3.e0
( 5.e0, 12.e0, 0.e0 ) 13.e0
( -5.e-17, 0.0e0, 12.e-17 ) 13.e-17
- Restrictions
None.
- Exceptions
Error free.
- Files
None.
- Author_and_Institution
N.J. Bachman (JPL)
W.L. Taber (JPL)
W.M. Owen (JPL)
- Literature_References
None.
- Version
-CSPICE Version 1.0.0, 16-APR-1999 (NJB)
- Index_Entries
norm of 3-dimensional vector
- Link to routine source