Table of contents
CSPICE_NVP2PL constructs a SPICE plane from a normal vector and a point
on the plane.
Given:
normal,
point respectively, a normal vector and point that define a plane in
three-dimensional space.
help, normal
DOUBLE = Array[3]
help, point
DOUBLE = Array[3]
`normal' need not be a unit vector. Let the symbol < a, b >
indicate the inner product of vectors an and b; then the
geometric plane is the set of vectors `x' in three-dimensional
space that satisfy
< x - point, normal > = 0.
the call:
cspice_nvp2pl, normal, point, plane
returns:
plane a SPICE plane that represents the geometric plane defined by
`point' and `normal'.
help, plane
STRUCT = CSPICE_PLANE
The structure has the fields:
normal: [3-array double]
constant: [scalar double]
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) Construct a SPICE plane from a normal vector and a point on
that plane, and calculate a point and two orthogonal spanning
vectors that generate the specified plane. Verify that the
point and the spanning vectors are mutually orthogonal.
Example code begins here.
PRO nvp2pl_ex1
;;
;; Define a normal vector from a plane and a
;; point in a plane.
;;
normal = [ -1.d, 5.d , -3.5d ]
point = [ 9.d, -0.65d, -12.d ]
;;
;; Create a SPICE plane from the vectors.
;;
cspice_nvp2pl, normal, point, plane
print, 'Input plane:'
print, ' Normal vector :', plane.normal
print, ' Constant :', plane.constant
print, ''
;;
;; Calculate a point in the plane, and
;; two spanning vectors in the plane such that
;; the point and spanning are mutually orthogonal.
;;
cspice_pl2psv, plane, point, span1, span2
print, 'Point :', point
print, 'Spanning vector 1:', span1
print, 'Spanning vector 2:', span2
print, ''
;;
;; Test point, span1, and span2 orthogonality. The dot
;; products of any two vectors should equal zero to
;; within round-off.
;;
print, 'dot(point,span1) :', cspice_vdot( point, span1)
print, 'dot(point,span2) :', cspice_vdot( point, span2)
print, 'dot(span1,span2) :', cspice_vdot( span1, span2)
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Input plane:
Normal vector : -0.16169042 0.80845208 -0.56591646
Constant : 4.8102899
Point : -0.77777778 3.8888889 -2.7222222
Spanning vector 1: 0.0000000 0.57346234 0.81923192
Spanning vector 2: 0.98684153 0.13246195 -0.092723365
dot(point,span1) : 0.0000000
dot(point,span2) : 5.5511151e-17
dot(span1,span2) : 0.0000000
Icy geometry routines that deal with planes use the `plane'
data type to represent input and output planes. This data type
makes the subroutine interfaces simpler and more uniform.
The Icy routines that produce SPICE planes from data that
define a plane are:
cspice_nvc2pl ( Normal vector and constant to plane )
cspice_nvp2pl ( Normal vector and point to plane )
cspice_psv2pl ( Point and spanning vectors to plane )
The Icy routines that convert SPICE planes to data that
define a plane are:
cspice_pl2nvc ( Plane to normal vector and constant )
cspice_pl2nvp ( Plane to normal vector and point )
cspice_pl2psv ( Plane to point and spanning vectors )
Any of these last three routines may be used to convert this
routine's output, 'plane', to another representation of a
geometric plane.
1) If the input vector `normal' is the zero vector, the error
SPICE(ZEROVECTOR) is signaled by a routine in the call tree of
this routine.
2) If any of the input arguments, `normal' or `point', is
undefined, an error is signaled by the IDL error handling
system.
3) If any of the input arguments, `normal' or `point', is not of
the expected type, or it does not have the expected dimensions
and size, an error is signaled by the Icy interface.
4) If the output argument `plane' is not a named variable, an
error is signaled by the Icy interface.
None.
None.
ICY.REQ
PLANES.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, 24-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, 01-SEP-2010 (EDW)
Edits to -I/O and -Examples sections so as to parallel Mice version.
-Icy Version 1.0.1, 24-NOV-2008 (EDW)
Edited header section -I/O and -Particulars.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
normal vector and point to plane
|