PVector.heading() doesn’t work in JavaScript; using atan2(directionVector.x, directionVector.y) instead