CROSSP Function

Standard Library function that returns the cross product of two three-element vectors.

Usage

    result = CROSSP(v1, v2)

Input Parameters

v1—The first operand of the cross product. This parameter must be a three-element vector.

v2—The second operand of the cross product. Must be a three-element vector.

Returned Value

result—A three-element floating-point vector containing the cross product of v1 and v2.

Keywords

None.

Discussion

The cross product of two arrays is commonly used in a variety of applications. It is defined as:

or:

Example

v1 = [2, 1, -2]
v2 = [4, -1, 3]
result = CROSSP(v1, v2)
PRINT, result
; PV-WAVE prints: 1   -14   -6