MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / angleBetween

Method angleBetween

Data-Structures/Vectors/Vector2.js:137–139  ·  view source on GitHub ↗

* Measure angle between two vectors * * @param vector The 2nd vector for the measurement. * @returns The angle in radians.

(vector)

Source from the content-addressed store, hash-verified

135 * @returns The angle in radians.
136 */
137 angleBetween(vector) {
138 return Math.atan2(vector.y, vector.x) - Math.atan2(this.y, this.x)
139 }
140}
141
142export { Vector2 }

Callers 1

Vector2.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected