```
public void rotate(double theta)
{
// this is the matrix to multiply by..
//x*cos(theta) , y* sin(theta)
// x* -sin(theta)
//y * cos(theta)
vertices[0][0]= vertices[0][0]* Math.cos(theta)+ Math.sin(theta)*vertices[0][1];
vertices[0][1]= vertices[0][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[0][1];
vertices[1][0]= vertices[1][0]* Math.cos(theta)+ Math.sin(theta)*vertices[1][1];
vertices[1][1]= vertices[1][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[1][1];
vertices[2][0]= vertices[2][0]* Math.cos(theta)+ Math.sin(theta)*vertices[2][1];
vertices[2][1]= vertices[2][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[2][1];
vertices[3][0]= vertices[3][0]* Math.cos(theta)+ Math.sin(theta)*vertices[3][1];
vertices[3][1]= vertices[3][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[3][1] ;
}
```