Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
package com.marginallyclever.makelangelo.makeart;
import com.marginallyclever.makelangelo.turtle.Turtle;
import com.marginallyclever.makelangelo.turtle.TurtleMove;
public class RotateTurtle {
public static void run(Turtle turtle,double degrees) {
double r=Math.toRadians(degrees);
double c=Math.cos(r);
double s=Math.sin(r);
for( TurtleMove m : turtle.history ) {
double xn=m.x*c - m.y*s;
double yn=m.x*s + m.y*c;
m.x=xn;
m.y=yn;
}
}
}
cfb67a76cThis file is pinned to the selected release. Download the original to open it in your design tool.