Skip to main content

Vector3.cross()

Instance method on Vector3.

Description

  • Returns the cross product of this Vector3 and the specified Vector3. |
  • Returns the cross product of this Vector3 and the specified X, Y and Z values. |

Method Signature

cross(Vector3)
cross(float, float, float)

Mathematical Definition

\mathbf{a}\times\mathbf{b}

Parameters

  • Vector3: 3D vector input.
  • float: scalar numeric input.

Returns

  • Vector3: returned by overloads of this method.

Mutability

  • Does not modify the current vector unless explicitly using a Local/Equal variant.

Edge Cases

  • Zero vectors can produce degenerate outputs for geometric methods.
  • NaN and Infinity inputs propagate according to IEEE-754 floating-point behavior.
  • Repeated operations may accumulate floating-point precision error.

Usage Example

Vector3 edgeA = p1.subtract(p0);
Vector3 edgeB = p2.subtract(p0);
Vector3 normal = edgeA.cross(edgeB).normalize();

Mathematical Example

Example input/output depends on overload; for vector arithmetic operations this is typically computed per-component.

Visualization