Table of contents
CSPICE_PLTNRM computes an outward normal vector of a triangular plate.
The vector does not necessarily have unit length.
Given:
v1,
v2,
v3 3-vectors constituting the vertices of
a triangular plate.
[3,1] = size(v1); double = class(v1)
[3,1] = size(v2); double = class(v2)
[3,1] = size(v3); double = class(v3)
the call:
[normal] = cspice_pltnrm( v1, v2, v3 )
returns:
normal an outward normal vector of the plate defined by
the input vertices. The order of the vertices is
used to determine the choice of normal direction:
the normal vector is
( v2 - v1 ) x ( v3 - v2 )
[3,1] = size(normal); double = class(normal)
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) Compute an outward normal of an equilateral triangle lying
in the X-Y plane and centered at the origin.
Example code begins here.
function pltnrm_ex1()
s = sqrt(3.0)/2;
v1 = [ s, -0.5, 0.0]';
v2 = [ 0.0, 1.0, 0.0]';
v3 = [ -s, -0.5, 0.0]';
normal = cspice_pltnrm( v1, v2, v3 );
fprintf ( 'NORMAL = %18.11e %18.11e %18.11e\n', ...
normal(1), normal(2), normal(3) );
When this program was executed on a Mac/Intel/Octave6.x/64-bit
platform, the output was:
NORMAL = 0.00000000000e+00 0.00000000000e+00 2.59807621135e+00
This routine saves computation time by not scaling the output
vector to unit length. The caller can scale the vector using
the routine cspice_vhat.
1) The input plate may be degenerate: it may be a line segment
or a point. These are not considered to be erroneous inputs.
2) If any of the input arguments, `v1', `v2' or `v3', is
undefined, an error is signaled by the Matlab error handling
system.
3) If any of the input arguments, `v1', `v2' or `v3', is not of
the expected type, or it does not have the expected dimensions
and size, an error is signaled by the Mice interface.
None.
None.
DSK.REQ
MICE.REQ
None.
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Mice Version 1.1.0, 10-AUG-2021 (EDW) (JDR)
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections. Fixed
minor typos in header.
Minor edits to the -Examples section to comply with NAIF standard.
Eliminated use of "lasterror" in rethrow.
Removed reference to the function's corresponding CSPICE header from
-Required_Reading section.
-Mice Version 1.0.0, 17-MAR-2016 (EDW) (NJB)
compute normal vector of triangular plate from vertices
|