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().
Ejemplos
Sintaxis
angleBetween(value)
angleBetween()
angleBetween(v1, v2)
Parámetros
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!
Referencias Relacionadas
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.