vector3.dot

The dot product of two vectors.

Value helperSince 0.3.0

Usage

TypeScript
Vector3.dot(a: Vector3, b: Vector3): number

Parameters

  • aVector3

    First vector. Required. In model.

  • bVector3

    Second vector. Required. In model.

Returns

|a| |b| cos θ (model units²): 0 for perpendicular vectors, negative when they point apart; NaN for non-finite input.

Example

TypeScript
Vector3.dot(Vector3.of(1, 2, 3), Vector3.of(4, 5, 6)) // → 32

See also