Apply modulus to the target vector using JavaScript remainder semantics, so results keep the sign of the target.
Target vector.
The value to modulo by.
Error - When a component of value is zero.
Error - When a computed component is NaN or non-finite.
mod({ x: 5, y: -5 }, 3); // -> { x: 2, y: -2 } Copy
mod({ x: 5, y: -5 }, 3); // -> { x: 2, y: -2 }
Destination object to store the result.
const result = { x: 0, y: 0 };mod({ x: 5, y: -5 }, 3, result); // result -> { x: 2, y: -2 } Copy
const result = { x: 0, y: 0 };mod({ x: 5, y: -5 }, 3, result); // result -> { x: 2, y: -2 }
Apply modulus to the target vector using JavaScript remainder semantics, so results keep the sign of the target.