 Hello everyone. Welcome to the lecture series on 2D rotation in computer graphic. At the end of this session, the students will be able to define 2D rotation, represent 2D rotation matrix, solve problem based on 2D rotation in computer graphic. In this video lecture, I will be discussing about the concept of two-dimensional rotation, how to represent a rotation matrix and finally conclude with some practice problem based on 2D rotation. As we have seen in the previous lecture on 2D transformation, there are several types of transformation in computer graphic. To name a few, translation, rotation, scaling, reflection and shearing. What are these basically? Transformations are actually a process of modifying and repositioning the existing graphic. So, when the transformation takes place on a two-dimensional plane, it is called as 2D transformation whereas when it takes place in three-dimension plane, it is called as three-dimensional transformation. In this video lecture, I will be focusing on the two-dimensional rotation in computer graphic. Most of us use cell phones daily. We see built-in feature of rotation by 90 degree rotation to the words the left towards the right. So, what is this 2D rotation? In computer graphics, this 2D rotation is a process of rotating an object with respect to an angle in the two-dimensional plane. Here, rotation repositions an object in a circular path. Rotation requires an angle and a pivot point. Now, what do we mean by this? Whenever we want to rotate any graphic primitive, maybe a line, a circle, a polygon, a triangle, a square, we require an angle about which with which we have to rotate that given graphic primitive and a pivot point. As seen over here, consider a point object O that is to be rotated from one angle to another in a two-dimensional plane. As we can see here in the given diagram, this is a point object O which is to be rotated from one angle to another. The original angle here with respect to the x-line is phi. That is, that is termed as x-old. Now, this is to be rotated by a given angle theta. Let the initial coordinate of the object O be x-old and y-old. As you can see over here. Initial angle of the object O with respect to the origin. This is the origin is equal to phi. Now, this object point O is to be rotated by an angle theta. So, this point that is O after rotating become O-dash and the new coordinates of the object O after rotation becomes x-new and y-new. On solving the trigonometric equation with respect to phi and theta, we obtain a matrix. Here for the convenience of understanding, I have represented the matrix for rotation using homogeneous coordinate and represented in a 3 by 3 matrix. So, the point of the rotation that is x-new, y-new and 1 is equal to cos theta minus sin theta 0, sin theta cos theta 0 0 0 1 into x-old, y-old 1. So, this matrix is a rotation matrix and the representation is given using the homogeneous coordinate representation. Now, why is it given using a homogeneous that is a 3 by 3 matrix? This is for the sake of our mathematical calculation. However, we can simply use x-new, y-new is equal to cos theta minus sin theta sin theta cos theta into x-old, y-old. So, both ways we can use the matrix for our calculation depending on the need of the problem. After you have understood the representation of the rotation matrix, let us solve one practice problem based on 2D rotation. Here, given a line segment with starting point as 0, 0 and ending point as 4, 4. So, here what is the problem? In the problem, a line segment with 0, 0 that is from the origin and with ending point 4, 4 is given. We have to apply 30-degree rotation anti-clockwise direction on the line segment and find out the new coordinate. I hope the problem statement is crystal clear to you. Now, how we do this? We do this by applying the given matrix that we have seen. So, the solution here is we rotate a straight line by it endpoints with the same angle. Then, we redraw a line between the new endpoint. So, given all ending coordinates of the line are x-old and y-old that is 0, 0 and 4, 4. So, we have directly taken 4, 4 over here. Now, the rotation angle is theta that is equal to 30-degree. Now, we have to find out this line segment after rotating it with 30-degree angle. Thus, the new ending coordinates of the line after rotation are x-new and y-new. Now, we calculate them using the equations of rotation as shown on the screen. So, we have obtained x-new is equal to x-old into cos theta minus y-old into sin theta that is 4 into cos theta minus 4 into sin theta. So, what do we get is 4 into root 3. So, cos theta value is root 3 by 2 whereas sin theta value is 1 by 2. So, after on multiplication we get 2 by root 3 minus 2 having the bracket solved and taking it out in common we have 2 root 3 minus 1 that is 1.73 minus 1 and therefore we have the x-new coordinate as 1.46 whereas on solving for y-new we obtain x-old into sin theta plus y-old into cos theta 4 into sin theta is 1 that is sin 30 is 1 by 2 whereas cos 30 is root 3 by 2. So, on solving the matrix we get 2 plus 2 by root 3 taking the brackets common we have 2 outside. So, 2 into 1 plus that is root 3 is 1.73. So, we have the y-new is equal to 5.46. So, after we solve the given matrix in this format that is x-new is equal to so that was the stepwise approach here it is this approach in matrix representation that is x-new y-new is equal to cos theta minus sin theta sin theta cos theta into x-old y-old on expanding we have got the same thing that is the new ending coordinates of the line after rotation are 1.46 comma 5.46. So, in this previous method we have simplified stepwise by solving and putting values here we have used the matrix representation to get the answer therefore we have obtained x-new is equal to 1.46 and y-new is equal to 5.46. So, diagrammatically this was the initial point which had ending 4 4 0 0 as the x in first point and the ending point as 4 4 after rotation with an angle of 30 degree you have the new point that is x-new as 1.46 and the y-new as 5.46. I hope you have understood the concept of 2D rotation now I want you all to pause the video for some time and solve the given problem here the given problem is for a triangle with coordinates 0 0 1 0 1 1 you are expected to rotate the triangle by 90 degree anticlockwise direction and find out the new coordinate so pause the video for some time and think for the answer here you need to know what is sine 90 and cos 90 it may happen that in the examination the values of sine cos theta sine theta are given and if it is not known by the time you should get yourselves acquainted with some of these basic angle degrees so I hope by now you have solved so thus the new coordinates of corner C that is this initial line after rotation are okay 0 0 that is B is 0 1 and C is minus 1 1 this can be diagrammatically represented as shown here these are the references thank you for your patient listening