MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / cosineTo

Method cosineTo

packages/@stdlib/misc/src/vec2.ts:77–81  ·  view source on GitHub ↗
(vec: Vec2)

Source from the content-addressed store, hash-verified

75 return Math.atan2(this.cross(vec), this.dot(vec));
76 }
77 cosineTo(vec: Vec2) {
78 const dotProduct = this.dot(vec);
79 const magnitudeProduct = this.length() * vec.length();
80 return dotProduct / magnitudeProduct;
81 }
82 rotate(angle: number): Vec2 {
83 const cos = Math.cos(angle);
84 const sin = Math.sin(angle);

Callers

nothing calls this directly

Calls 2

dotMethod · 0.95
lengthMethod · 0.95

Tested by

no test coverage detected