Closed
Description
Created by: arijit4
There's an method named PVector.setHeading()
in p5.Vector
class of p5.js to set the direction of an vector to any given angle. But there's no such option in Processing. It can be settled down easily. But the function seems more self explanatory and easy to understand. It also goes well with the PVector.heading()
method already present in Processing.
An implementation might look like the following :
void setHeading(float angle) {
this.rotate(angle - this.heading());
}
Metadata
Metadata
Assignees
Labels
No labels