Reference fromAngle()

fromAngle()

Creates a new 2D vector from an angle.

Examples

Syntax

fromAngle(angle, [length])

Parameters

angle
Number:

desired angle, in radians. Unaffected by angleMode().

length
Number:

length of the new vector (defaults to 1).

Returns

p5.Vector: new p5.Vector object.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!

Related References