vector2.cross

The z component of a × b: positive when b turns counter-clockwise from a.

Value helperSince 0.3.0

Usage

TypeScript
Vector2.cross(a: Vector2, b: Vector2): number

Parameters

  • aVector2

    First vector. Required. In model.

  • bVector2

    Second vector. Required. In model.

Returns

The signed area of the parallelogram on a and b (model units²): 0 for parallel vectors; NaN for non-finite input.

Example

TypeScript
Vector2.cross(Vector2.of(1, 0), Vector2.of(0, 1)) // → 1

See also