MCPcopy Create free account
hub / github.com/melonjs/melonJS / project

Method project

packages/melonjs/src/math/observableVector2d.ts:483–485  ·  view source on GitHub ↗

* project this vector on to another vector. * @param v - The vector to project onto. * @returns Reference to this object for method chaining

(v: Vector2d | ObservableVector2d)

Source from the content-addressed store, hash-verified

481 * @returns Reference to this object for method chaining
482 */
483 project(v: Vector2d | ObservableVector2d) {
484 return this.scale(this.dot(v) / v.length2());
485 }
486
487 /**
488 * Project this vector onto a vector of unit length.<br>

Callers

nothing calls this directly

Calls 3

scaleMethod · 0.95
dotMethod · 0.95
length2Method · 0.45

Tested by

no test coverage detected