Below is the answer structured in two parts as per your query. The first part is written in a simple, straightforward manner (as if I'm an MCA Sem-2 student explaining it in an answer script for a 5-mark Computer Graphics question). I've kept it concise, step-by-step, and easy to understand, focusing on the key concepts without unnecessary jargon. The second part is a separate real-life example related to the concept.
Part 1: Answer Script Explanation (MCA Sem-2 Style)
Question: Consider a triangle having vertices at A(0, 0), B(5, 1), and C(3, 4). Rotate this triangle by 90° about the point (2, 3).
Answer:
In Computer Graphics, rotating a shape (like a triangle) around a specific point means changing the positions of its vertices while keeping the shape the same. Here, we rotate the triangle by 90° counterclockwise (common in graphics for positive angles) around the point (2, 3). This is not rotating around the origin, so we use a three-step method: translate (shift), rotate, and translate back.
The general steps for rotating a point (x, y) by angle θ (here θ = 90°) around (a, b) = (2, 3) are:
- Translate to make (2, 3) the origin: x' = x - 2, y' = y - 3.
- Rotate using formulas (for 90° counterclockwise: cos90° = 0, sin90° = 1):
x'' = x' * cosθ - y' * sinθ = -y'
y'' = x' * sinθ + y' * cosθ = x'
- Translate back: x_new = x'' + 2, y_new = y'' + 3.
Now, apply this to each vertex of the triangle.
For vertex A(0, 0):
- Translate: x' = 0 - 2 = -2, y' = 0 - 3 = -3.
- Rotate: x'' = -(-3) = 3, y'' = -2.
- Translate back: x_new = 3 + 2 = 5, y_new = -2 + 3 = 1.
New A' = (5, 1).
For vertex B(5, 1):
- Translate: x' = 5 - 2 = 3, y' = 1 - 3 = -2.
- Rotate: x'' = -(-2) = 2, y'' = 3.
- Translate back: x_new = 2 + 2 = 4, y_new = 3 + 3 = 6.
New B' = (4, 6).
For vertex C(3, 4):
- Translate: x' = 3 - 2 = 1, y' = 4 - 3 = 1.
- Rotate: x'' = -1, y'' = 1.
- Translate back: x_new = -1 + 2 = 1, y_new = 1 + 3 = 4.
New C' = (1, 4).
The rotated triangle has vertices at A'(5, 1), B'(4, 6), and C'(1, 4). This method is useful in graphics software for animations and transformations.
(Diagram: I would sketch the original triangle points and new points on a coordinate plane here for clarity, but since it's text, imagine plotting them.)
Part 2: Real-Life Example Related to the Answer
A real-life example of rotating a triangle (or any shape) by 90° around a specific point is in video game development, like in a 2D puzzle game (e.g., Tetris or a mobile game like Monument Valley). Imagine a triangular game piece (like a block or obstacle) that needs to be rotated by 90° around a fixed pivot point (not its center) to fit into a slot or solve a level. The game's graphics engine uses the same translation-rotation-translation math to update the piece's position on the screen, making it spin smoothly without changing its shape. This creates realistic animations and helps in collision detection, just like we calculated the new vertices here. If the pivot is off-center (like (2,3) in our example), the rotation feels more natural, like spinning a key in a lock.