- Abstract
Compute the dot product of two vectors of arbitrary dimension.
- Required_Reading
None.
- Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I First vector in the dot product.
v2 I Second vector in the dot product.
ndim I Dimension of v1 and v2.
The function returns the value of the dot product of v1 and v2.
- Detailed_Input
v1 This may be any double precision vector of arbitrary
dimension.
v2 This may be any double precision vector of arbitrary
dimension.
- Detailed_Output
The function returns the value of the dot product of v1 and v2.
- Parameters
None.
- Particulars
vdotg_c calculates the dot product of v1 and v2 by a simple
application of the definition. No error checking is
performed to prevent or recover from numeric overflow.
- Examples
Suppose that given two n-dimensional vectors, we want to change
one of the vectors until the two vectors are perpendicular.
The following code fragment demonstrates the use of vdot_c to do
so.
dot = vdotg_c ( v1, v2, ndim );
while ( dot != 0. )
{
/. change one of the vectors ./
....
dot = vdotg_c ( v1, v2, ndim );
}
- Restrictions
The user is responsible for determining that the vectors v1 and
v2 are not so large as to cause numeric overflow. In most cases
this won't present a problem.
- Exceptions
1) If ndim is not physically realistic, greater than zero, a
BADDIMENSION error is signaled. The value 0. is returned.
- Files
None.
- Author_and_Institution
W.M. Owen (JPL)
E.D. Wright (JPL)
- Literature_References
None.
- Version
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)
Made input vectors const. Converted check-in style to discovery.
-CSPICE Version 1.0.0, 31-MAR-1998 (EDW)
- Index_Entries
dot product of n-dimensional vectors
- Link to routine source