Skip to content

Documentation / @interstellar-tools/equations / sub

Function: sub() ​

ts
function sub(a: Vector3DTupleType, b: Vector3DTupleType): Vector3DTupleType;

Defined in: helpers/misc.ts:61

Subtract two 3D vectors (a - b).

Parameters ​

ParameterTypeDescription
aVector3DTupleTypeMinuend vector.
bVector3DTupleTypeSubtrahend vector.

Returns ​

Vector3DTupleType

Difference vector a - b.

Example ​

ts
sub([3, 2, 1], [1, 1, 1]); // [2, 1, 0]