Table of contents
CSPICE_VPERP calculates the component of a vector perpendicular to a
second vector.
a a double precision 3-array defining a vector.
help, a
DOUBLE = Array[3]
It is the vector whose component orthogonal to 'b' is sought.
(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 double precision 3-array.
help, b
DOUBLE = Array[3]
This is the vector used as a reference for the decomposition of
`a'.
An implicit assumption exists that `a' and `b' lie in the
same reference frame. If this is not the case, the numerical
result has no meaning.
the call:
cspice_vperp, a, b, p
returns:
p a double precision 3-array containing the component of `a'
orthogonal to `b'.
help, p
DOUBLE = Array[3]
None.
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 two vector sets and compute the component of the vector
in the first set perpendicular to the vector in the second set.
Example code begins here.
PRO vperp_ex1
;;
;; Define two vector sets.
;;
a = [ [ 6.D, 6, 6], $
[ 6, 6, 6], $
[ 6, 6, 0], $
[ 6, 0, 0] ]
b = [ [ 2.D, 0, 0], $
[-3, 0, 0], $
[ 0, 7, 0], $
[ 0, 0, 9] ]
;;
;; Calculate the decomposition.
;;
for i=0, 3 do begin
cspice_vperp, a(*,i), b(*,i), p
print, 'a = ', a(*,i)
print, 'b = ', b(*,i)
print, 'p = ', p
print
endfor
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
a = 6.0000000 6.0000000 6.0000000
b = 2.0000000 0.0000000 0.0000000
p = 0.0000000 6.0000000 6.0000000
a = 6.0000000 6.0000000 6.0000000
b = -3.0000000 0.0000000 0.0000000
p = 0.0000000 6.0000000 6.0000000
a = 6.0000000 6.0000000 0.0000000
b = 0.0000000 7.0000000 0.0000000
p = 6.0000000 0.0000000 0.0000000
a = 6.0000000 0.0000000 0.0000000
b = 0.0000000 0.0000000 9.0000000
p = 6.0000000 0.0000000 0.0000000
Given and non-zero vector `b' and a vector `a', there is a unique
decomposition of `a' as a sum v + p such that `p' is orthogonal
to `b' and `v' is parallel to `b'. This routine finds the vector `p'.
If `b' is a zero vector, `p' will be identical to `a'.
1) If any of the input arguments, `a' or `b', is undefined, an
error is signaled by the IDL error handling system.
2) If any of the input arguments, `a' or `b', 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 `p' is not a named variable, an error
is signaled by the Icy interface.
None.
None.
ICY.REQ
[1] G. Thomas and R. Finney, "Calculus and Analytic Geometry,"
7th Edition, Addison Wesley, 1988.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.3, 10-AUG-2021 (JDR)
Edited the header to comply with NAIF standard. Added
example's problem statement and reformatted example's output.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
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.2, 22-APR-2010 (EDW)
Edited header, improved/clarified -I/O descriptions.
-Icy Version 1.0.1, 09-DEC-2005 (EDW)
Added -Examples section.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
perpendicular component of a 3-vector
|