Q3(a) Derivation of the rotation matrix with respect to a fixed point
1. Translate the fixed point (xf, yf) to the origin: x′ = x − xf, y′ = y − yf
2. Rotate the translated point by angle θ about the origin using the 2D rotation matrix:
x″ = (x − xf)cosθ − (y − yf)sinθ
y″ = (x − xf)sinθ + (y − yf)cosθ
3. Translate the point back to the original fixed point location:
xnew = xf + (x − xf)cosθ − (y − yf)sinθ
ynew = yf + (x − xf)sinθ + (y − yf)cosθ
Q3(b) Derivation of reflection matrix with respect to line y = x + 2
Step 1: Translate the line to pass through the origin
The line y = x + 2 has y-intercept (0,2). Translate all points by T(0, −2). New line becomes y′ = x′.
Step 2: Rotate the line by −45° to align with x-axis.
Rotation matrix R(−45°).
Step 3: Reflect across the x-axis using matrix:
Refx = [[1,0],[0,−1]]
Step 4: Apply inverse rotation (+45°) and inverse translation T(0,2).
Answer: This transformation is an affine transformation and cannot be represented by a single 2×2
matrix.
Q3(c) Image resizing while maintaining aspect ratio
Original size: 1024 × 768
New width: 640 pixels
Aspect ratio preserved:
1024 / 768 = 640 / new height
new height = (640 × 768) / 1024 = 480 pixels
Answer: The height of the resized image is 480 pixels.
Q3(c) Rotation of a triangle about a fixed point
Rotate triangle A(0,0), B(1,1), C(5,2) by 45° about fixed point (−1,−1).
cos45° = 1/√2, sin45° = 1/√2
A′ = (−1, −1 + √2)
B′ = (−1, −1 + 2√2)
C′ = (−1 + 3/√2, −1 + 9/√2)
Answer: The coordinates of the rotated triangle are A′(−1, −1 + √2), B′(−1, −1 + 2√2), C′(−1 + 3/√2,
−1 + 9/√2).