Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

2.4 Basic 2D Transformations

Lesson 13 of 32 in the free Computer Graphics notes on Siksha Sarovar, written by Rohit Jangra.

Five Building Blocks

Translation, Rotation, Scaling, Reflection, Shearing. Each maps a point (x, y) to a new point (x', y').

Translation

x' = x + tx, y' = y + ty. Moves geometry without distorting it. Translation is not a linear map (it does not fix the origin), which is why we will use homogeneous coordinates.

Rotation about Origin (counter-clockwise by theta)

x' = x cos(theta) - y sin(theta) y' = x sin(theta) + y cos(theta) Matrix: [ cos -sin ] [ sin cos ] Rotation about an arbitrary point (px, py) = translate(-px,-py) -> rotate(theta) -> translate(+px, +py).

Scaling

x' = sx x, y' = sy y. About origin. Uniform scale sx = sy preserves shape; non-uniform stretches. Matrix: [ sx 0 ] [ 0 sy ]

Reflection

  • Across X-axis: (x, y) -> (x, -y).
  • Across Y-axis: (x, y) -> (-x, y).
  • Across origin: (x, y) -> (-x, -y).
  • Across line y = x: (x, y) -> (y, x).
  • Reflection is scaling with a -1 in the appropriate axis or a 90-degree composition.

Shear

  • X-shear by shx: x' = x + shx * y, y' = y. Slants vertical lines.
  • Y-shear by shy: x' = x, y' = shy * x + y.
  • Used in italic fonts and oblique projections.

Numerical Example

Triangle A(2,1), B(5,1), C(2,4). Translate by (3, 2): A' = (5,3), B' = (8,3), C' = (5,6). Then rotate 90 deg about origin: A'' = (-3, 5), B'' = (-3, 8), C'' = (-6, 5).

Effect on Geometry

  • Translation, rotation, reflection: preserve distances and angles -> rigid / isometric.
  • Uniform scale: preserves angles, scales distances -> conformal.
  • Non-uniform scale and shear: do not preserve angles -> affine but not rigid.
  • All five together generate the affine group.