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().
Examples
Syntax
angleBetween(value)
angleBetween(v1, v2)
Parameters
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.
This page is generated from the comments in src/math/p5.Vector.js . Please feel free to edit it and submit a pull request!