I have been given equations for converting from a global to local coordinate system in 2 dimensions, however with no explanation/proof as to how the equation is obtained. I realise that on occasion you just need to learn an equation and use it, but in this case I would really appreciate it if someone could help me understand what's going on. They are as follows:
$x = X \cos \theta + Y \sin \theta$ $y = -X \sin \theta + Y \cos \theta$
Where (x,y) are the local coordinates of the global point (X,Y) and $ \theta$ is the orientation of the local system relative to the global system.