MCPcopy
hub / github.com/yeemachine/kalidokit / subtract

Method subtract

src/utils/vector.ts:51–54  ·  view source on GitHub ↗

* Substracts a vector or number from this vector. * @param {Vector | number} a: Vector or number to subtract * @returns {Vector} New vector

(v: Vector | number)

Source from the content-addressed store, hash-verified

49 * @returns {Vector} New vector
50 */
51 subtract(v: Vector | number) {
52 if (v instanceof Vector) return new Vector(this.x - v.x, this.y - v.y, this.z - v.z);
53 else return new Vector(this.x - v, this.y - v, this.z - v);
54 }
55 /**
56 * Multiplies a vector or a number to a vector.
57 * @param {Vector | number} a: Vector or number to multiply

Callers 5

lerpMethod · 0.80
rollPitchYawMethod · 0.80
angleBetween3DCoordsMethod · 0.80
getSphericalCoordsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected