vector3.scale

The vector multiplied by a scalar.

Value helperSince 0.3.0

Usage

TypeScript
Vector3.scale(v: Vector3, s: number): Vector3

Parameters

  • vVector3

    The vector to scale. Required. In model.

  • snumber

    The factor; negative reverses the direction.

    Required

Returns

The vector s · v; NaN when a coordinate is NaN or two infinities cancel.

Use instead

  • vector3.unit: to get length 1, which also reports a vector with no direction

Example

TypeScript
Vector3.scale(Vector3.of(1, 2, 3), 2) // → { x: 2, y: 4, z: 6 }

See also