vector2.of

The plane vector with the given components.

Value helperSince 0.3.0

Usage

TypeScript
Vector2.of(x: number, y: number): Vector2

Parameters

  • xnumber

    The x coordinate. Required. In model.

  • ynumber

    The y coordinate. Required. In model.

Returns

A new { x, y }; components are stored as given.

Example

TypeScript
Vector2.of(1, -1) // → { x: 1, y: -1 }

See also