Manually calculate "p5.vector.fromAngle?"

Broad question, but how can I manually calculate a vector from an angle/radian as opposed to using p5.vector.fromAngle? (platform agonistic)

2 Likes

Hi commie630,

X would be Math.cos(angleInRadians)
Y would be Math.sin(angleInRadians)

That would give you a unit vector’s components for x and y.

Kind regards,
Manno

4 Likes