vector2.length

The Euclidean length of a plane vector.

Value helperSince 0.3.0

Usage

TypeScript
Vector2.length(v: Vector2): number

Parameters

  • vVector2

    The vector to measure. Required. In model.

Returns

A non-negative length in model units; NaN when a coordinate is NaN or two infinities cancel.

Example

TypeScript
Vector2.length(Vector2.of(3, 4)) // → 5

See also