Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_vminus

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_VMINUS negates a double precision 3-dimensional vector.

I/O


   Given:

      v1       any double precision 3-dimensional vector.

               help, v1
                  DOUBLE = Array[3]

   the call:

      cspice_vminus, v1, vout

   returns:

      vout     the negation (additive inverse) of `v1'.

               help, vout
                  DOUBLE = Array[3]

               It is a double precision 3-dimensional vector. Note, `vout' may
               overwrite `v1'.

Parameters


   None.

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.

   1) Define a set of 3-dimensional vectors and negate each of them.


      Example code begins here.


      PRO vminus_ex1

         ;;
         ;; Local parameters.
         ;;
         SETSIZ =   2L

         ;;
         ;; Define a set of 3-dimensional vectors.
         ;;
         v1     = [ [ 1.D0, -2.D0, 0.D0 ], [ 0.D0, 0.D0, 0.D0 ] ]

         ;;
         ;; Negate each vector
         ;;
         for i=0L, SETSIZ-1L do begin

            cspice_vminus, v1[*,i], vout

            print, format='(A,3F6.1)', 'Input vector  : ', v1[*,i]
            print, format='(A,3F6.1)', 'Negated vector: ', vout
            print

         endfor

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Input vector  :    1.0  -2.0   0.0
      Negated vector:   -1.0   2.0  -0.0

      Input vector  :    0.0   0.0   0.0
      Negated vector:   -0.0  -0.0  -0.0


Particulars


   For each value of the index `i' from 0 to 2, cspice_vminus negates `v1'
   by the expression:

      vout[i] = -v1[i]

   No error checking is performed since overflow can occur ONLY if
   the dynamic range of positive floating point numbers is not the
   same size as the dynamic range of negative floating point numbers
   AND at least one component of `v1' falls outside the common range.
   The likelihood of this occurring is so small as to be of no
   concern.

   The IDL native code to perform the same operation:

      vout = -v1

   The negation operator accepts arbitrary size vectors.

Exceptions


   1)  If the input argument `v1' is undefined, an error is signaled
       by the IDL error handling system.

   2)  If the input argument `v1' is not of the expected type, or it
       does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

   3)  If the output argument `vout' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.2, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added complete
       code example.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section. Moved the existing contents of -Examples
       section to -Particulars.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

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

      Added -Examples section.

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

Index_Entries


   negate a 3-dimensional vector



Fri Dec 31 18:43:08 2021