Hello,
Use only radians!
TAU radians is equal to 360 deg
TWO_PI is equal to 360 deg.
https://processing.org/reference/TAU.html
To get you started try this in your existing code:
float angle = TAU/360;
boolean state = false;
if (state)
{
for (int i=0; i<points.length; i++) points[i]=pos(points[i]);
state = false;
}
void keyPressed()
{
//if (key == 'd') angle += +TAU/360;
//if (key == 'a') angle -= -TAU/360;
state = true;
}
void keyReleased()
{
state = false;
}
Changing the angle in your keyPressed will have no effect in your code because you defined this array at the start of your code:
float angle = 10;
float[][] rotationXY = {
{cos(angle), -sin(angle)},
{sin(angle), cos(angle)}
};
The angle variable won’t change after that! Try calling the function in draw.
I leave the rest with you.
:)