Download as RTF, PDF, TXT or read online from Scribd
Download as rtf, pdf, or txt
You are on page 1of 3
Lab Exercise on Geometric Transformations
1 (For first 10 students in a batch)
Write a program that takes a set of 2D points representing a polygon and applies a series of transformations (translation, rotation, and scaling) in a user-defined order. The program should prompt the user to enter the coordinates of the polygon vertices. Ask the user to choose the order of transformations and input the necessary parameters (e.g., angle of rotation, translation vector, scaling factor). Output the final coordinates of the polygon after all transformations. Display the original and transformed polygons on a graph. (Print out)
(For remaining students in the batch)
Write a program to reflect a 2D object (e.g., a hexagon) about the x- axis, y-axis, and the line y=x. Input: Initial coordinates and choice of reflection axis. Output: New coordinates after reflection. Implement a program to apply shearing to a 2D object (e.g., a quadrilateral) along the x-axis and y-axis. Input: Initial coordinates and shearing factors. Output: New coordinates after shearing. Develop a program that combines reflection and shearing transformations on a 2D object. Input: Initial coordinates, choice of reflection axis, and shearing factors. Output: Final coordinates after applying both transformations. (Print out)
2 Apply a sequence of transformations to a 3D object.
Perform the following transformations on a tetrahedron: 1. Rotate it by 45° around the z-axis. 2. Scale it uniformly by a factor of 2. 3. Translate it by a vector T(3,4,5). Visualize the object at each stage of transformation and provide a summary of the final coordinates of the vertices. (Print out) 3 (Below questions are to be solved manually and hand written) A triangle has vertices at (3, 4), (7, 8), and (5, 2). The triangle undergoes a series of transformations: - A rotation of 60° counterclockwise about the origin. - A scaling by a factor of 1.5 in the x-direction and 0.5 in the y- direction. - A translation by (4, -3). Calculate the final coordinates of the triangle after these transformations. Derive and apply the inverse transformation to return the triangle to its original position. 4 Given a square with vertices at (1, 1), (1, 4), (4, 4), and (4, 1): o First, scale the square by a factor of 0.5 in the x- direction. o Then, rotate the scaled square 90° clockwise around its center. o Finally, translate the square by 2 units in the y-direction. Determine the final coordinates of the square after applying all transformations by 1) Matrix concatenation method 2) step by step method showing the intermediate results after each transformation.
5 A triangle with vertices A(8,0), B(12,0) and C(12,3) has undergone
reflection about line y=x. Find the concatenated matrix and then find new co-ordinates of ∆ABC using the transformation matrix.
6 A triangle A(2,2), B(4,4) and C(3,5) has undergone the following
operations. Find new co-ordinates of the triangles ABC when i) Scaled with respect to point A with a magnitude of 2 ii) Mirrored about a line y=0.75 x + 3
7 The vertices of triangle ABC are having homogeneous co-ordinates
as A(2,4,1) , B(4,6,1) and C(2,6,1). The triangle is to be reflected about the line y=0.5x+2. Determine the composite transformation matrix and the new co-ordinates of reflected triangle. 8 Find the concatenated transformation matrix , if the transformation are performed as per the following sequence: (i) Rotation through 65° in anticlockwise direction. (ii) Translation through +3 and -7 units along the X and Y direction. (iii) Rotation through 80° in clockwise direction. 9 Reflect the polygon whose vertices are A(-1,0), B (0,-2) C(1,0) and D (0,2) about the lines (a) horizontal line y =2 (b) vertical line x = 3. Use homogeneous coordinates.
10 Find the transformed co-ordinates when a line [(3,4),(4,2)] is rotated
about a z-axis by an angle 45° in anticlockwise direction using homogeneous coordinates.
11 A cuboid has vertices at A(0,0,0) B(4,0,0) B(4,0,0), C(4,3,0) C(4, 3, 0)
D(0,3,0), E(0,0,2), F(4,0,2), G(4,3,2), H(0,3,2). Translate the cuboid by T(−2,5,−1). Determine the coordinates of the vertices after
A cuboid has vertices at 𝐴(1,1,1) 𝐵(5,1,1), C(5,4,1), D(1,4,1),
translation. 12 E(1,1,3), F(5,1,3), G(5,4,3), H(1,4,3) Perform non-uniform scaling on the cuboid with scaling factors of 2 along the x-axis, 0.5 along the y-axis, and 3 along the z-axis. Determine the new coordinates of the cuboid's vertices after scaling.