I'm trying to figure out how to rotate a vector over a point (another vector) as a PIVOR tried on some sites that gave me the following code:
public Vector2 rotate_point(float cx,float cy,float angle,Vector2 p)
{
float s = (float) Math.sin(angle);
float c = (float) Math.cos(angle);
// translate point back to origin:
p.x-= cx;
p.y -= cy;
// rotate point
float xnew = p.x * c - p.y * s;
float ynew = p.x * s + p.y * c;
return p;
}
But I do not understand what this float angle variable would be.