Referencia angleBetween()

angleBetween()

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(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