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

Method angle

packages/melonjs/src/math/vector3d.ts:452–454  ·  view source on GitHub ↗

* return the angle between this vector and the passed one * @param v other vector * @returns angle in radians

(v: Vector2d | Vector3d)

Source from the content-addressed store, hash-verified

450 * @returns angle in radians
451 */
452 angle(v: Vector2d | Vector3d) {
453 return Math.acos(clamp(this.dot(v) / (this.length() * v.length()), -1, 1));
454 }
455
456 /**
457 * project this vector on to another vector.

Calls 3

dotMethod · 0.95
lengthMethod · 0.95
clampFunction · 0.90

Tested by

no test coverage detected