Calculates the angle between two vectors.
The angles returned are signed, which means that v1.angleBetween(v2) === -v2.angleBetween(v1)
.
If the vector was created with createVector(), angleBetween()
returns angles in the units of the current angleMode().
示例
语法
angleBetween(value)
angleBetween(v1, v2)
参数
value
p5.Vector:
x, y, and z components of a p5.Vector.
v1
p5.Vector:
the first vector.
v2
p5.Vector:
the second vector.
Returns
Number: angle between the vectors.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!