pl2nvc_c |

Table of contents## Procedurepl2nvc_c ( Plane to normal vector and constant ) void pl2nvc_c ( ConstSpicePlane * plane, SpiceDouble normal[3], SpiceDouble * konst ) ## AbstractReturn a unit normal vector and constant that define a specified plane. ## Required_ReadingPLANES ## KeywordsGEOMETRY MATH PLANE ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- plane I A SPICE plane. normal, konst O A normal vector and constant defining the geometric plane represented by `plane'. ## Detailed_Inputplane is a SPICE plane. ## Detailed_Outputnormal, konst are, respectively, a unit normal vector and constant that define the geometric plane represented by `plane'. Let the symbol < a, b > indicate the inner product of vectors `a' and `b'; then the geometric plane is the set of vectors `x' in three-dimensional space that satisfy < x, normal > = konst. `normal' is a unit vector. `konst' is the distance of the plane from the origin; konst * normal is the closest point in the plane to the origin. ## ParametersNone. ## ExceptionsError free. 1) The input plane MUST have been created by one of the CSPICE routines nvc2pl_c ( Normal vector and constant to plane ) nvp2pl_c ( Normal vector and point to plane ) psv2pl_c ( Point and spanning vectors to plane ) Otherwise, the results of this routine are unpredictable. ## FilesNone. ## ParticularsCSPICE geometry routines that deal with planes use the `plane' data type to represent input and output planes. This data type makes the routine interfaces simpler and more uniform. The CSPICE routines that produce SPICE planes from data that define a plane are: nvc2pl_c ( Normal vector and constant to plane ) nvp2pl_c ( Normal vector and point to plane ) psv2pl_c ( Point and spanning vectors to plane ) The CSPICE routines that convert SPICE planes to data that define a plane are: ## ExamplesThe numerical results shown for these examples may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Determine the distance of a plane from the origin, and confirm the result by calculating the dot product (inner product) of a vector from the origin to the plane and a vector in that plane. The dot product between these two vectors should be zero, to double precision round-off, so orthogonal to that precision. Example code begins here. /. Program pl2nvc_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { SpiceDouble konst; SpicePlane plane; SpiceDouble plnvec [3]; SpiceDouble vec [3]; /. Define the plane with a vector normal to the plan and a point in the plane. ./ SpiceDouble normal [3] = { -1.0, 5.0, -3.5 }; SpiceDouble point [3] = { 9.0, -0.65, -12.0 }; /. Create the SPICE plane from the normal and point. ./ nvp2pl_c ( normal, point, &plane ); /. Calculate the normal vector and constant defining the plane. The constant value is the distance from the origin to the plane. ./ ## RestrictionsNone. ## Literature_References[1] G. Thomas and R. Finney, "Calculus and Analytic Geometry," 7th Edition, Addison Wesley, 1988. ## Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) E.D. Wright (JPL) ## Version-CSPICE Version 1.1.0, 24-AUG-2021 (JDR) Changed the output argument name "constant" to "konst" for consistency with other routines. Edited the header to comply with NAIF standard. Added complete code examples. -CSPICE Version 1.0.1, 06-FEB-2003 (EDW) Trivial correction to header docs. -CSPICE Version 1.0.0, 05-MAR-1999 (NJB) ## Index_Entriesplane to normal vector and constant |

Fri Dec 31 18:41:10 2021