MCPcopy Index your code
hub / github.com/processing/processing / rotate

Method rotate

core/src/processing/core/PVector.java:919–925  ·  view source on GitHub ↗

( begin auto-generated from PVector_rotate.xml ) Rotate the vector by an angle (only 2D vectors), magnitude remains the same ( end auto-generated ) @webref pvector:method @usage web_application @brief Rotate the vector by an angle (2D only) @param theta the angle of rotation

(float theta)

Source from the content-addressed store, hash-verified

917 * @param theta the angle of rotation
918 */
919 public PVector rotate(float theta) {
920 float temp = x;
921 // Might need to check for rounding errors like with angleBetween function?
922 x = x*PApplet.cos(theta) - y*PApplet.sin(theta);
923 y = temp*PApplet.sin(theta) + y*PApplet.cos(theta);
924 return this;
925 }
926
927
928 /**

Callers

nothing calls this directly

Calls 2

cosMethod · 0.95
sinMethod · 0.95

Tested by

no test coverage detected