Transformations

 

Rotations: 

90 degree rotations can easily be performed by a simple transformation.  The following equations will do the job:

newY = oldX

newX = ResolutionY - oldY

we must subtract the oldY from the Resolution of Y otherwise we will get a displaced image from its start position.

 


 

 

Flipping: 

Flipping is similar to rotation but we are actually mirroring the image.  Flipping is easy to perform.  To flip around the X axis the equation are:

 

newX = ResolutionX - oldX

newY = oldY

 

Similarly, to flip around the Y axis the equations are

 

newY = ResolutionY - oldY

newX = oldX

 

To the right are examples of flipping over the X and Y axises, respectively.