2D Geometrical Transformations
1. Introduction
In computer graphics, transformations are used to manipulate objects on the screen. 2D transformations operate on objects defined in a two-dimensional space.
- Modify position and orientation
- Essential for animation and design
2. Types of 2D Transformations
- Translation
- Scaling
- Rotation
- Reflection
- Shearing
3. Translation
Translation moves an object from one position to another by adding translation values to its coordinates.
x' = x + tx y' = y + ty
- Shifts object horizontally or vertically
- No change in size or orientation
4. Scaling
Scaling changes the size of an object by multiplying its coordinates by scaling factors.
x' = x × sx y' = y × sy
- Uniform and non-uniform scaling
- Object may grow or shrink
5. Rotation
Rotation turns an object around a fixed point (usually the origin) by a specified angle.
x' = x cosθ − y sinθ y' = x sinθ + y cosθ
- Clockwise or anticlockwise rotation
- Angle in degrees or radians
6. Reflection
Reflection produces a mirror image of an object about a line such as x-axis, y-axis, or origin.
- Reflection about x-axis
- Reflection about y-axis
- Reflection about origin
7. Shearing
Shearing distorts the shape of an object by shifting one coordinate in proportion to another.
x' = x + shy y' = y + shx
- Horizontal shearing
- Vertical shearing
8. Matrix Representation
2D transformations are represented using matrices, which allow multiple transformations to be combined efficiently.
- Uses homogeneous coordinates
- 3×3 transformation matrices
9. Applications
- 2D animation
- Computer-aided design (CAD)
- Game graphics
Practice Questions
- What are 2D transformations?
- Explain translation and scaling.
- Write rotation equations.
- Define reflection and shearing.
- Where are 2D transformations used?