Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/vnormg_c.html
Дата изменения: Sat Dec 17 06:10:09 2005 Дата индексирования: Mon Apr 11 00:12:38 2016 Кодировка: Поисковые слова: magnitude |
Compute the magnitude of a double precision vector of arbitrary dimension.
None.
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- v1 I Vector whose magnitude is to be found. ndim I Dimension of v1.
v1 This may be any double precision vector or arbitrary size.
vnormg_c is the magnitude of v1 calculated in a numerically stable way.
None.
vnormg_c finds the component of v1 whose magnitude is the largest. If the absolute magnitude of that component indicates that a numeric overflow would occur when it is squared, or if it indicates that an underflow would occur when squared (falsely giving a magnitude of zero) then the following expression is used: vnormg_c = v1max * MAGNITUDE OF [ (1/v1max)*v1 ] therwise a simpler expression is used: vnormg_c = MAGNITUDE OF [ v1 ] Beyond the logic described above, no further checking of the validity of the input is performed.
The following table show the correlation between various input vectors v1 and vnormg_c: ndim v1 ndim vnormg_c ----------------------------------------------------------------- 1 (-7.0D20) 1 7.D20 3 (1., 2., 2.) 3 3. 4 (3., 3., 3., 3.) 4 6. 5 (5., 12., 0., 0., 0.) 5 13. 3 (-5.D-17, 0.0, 12.D-17) 3 13.D-17
None.
1) If ndim is not physically realistic, greater than zero, a BADDIMENSION error is signaled. The value 0. is returned.
None.
W.M. Owen (JPL)
None.
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB) Made input vector const. -CSPICE Version 1.0.0, 1-APR-1998 (EDW)
norm of n-dimensional vector