 I now want to get to rotation and in order to do that I want to generalize a little bit and I want to talk about linear transformations and I am going to drop one dimension down and generalize a bit. So, I am going to instead of going directly to 3D rotations I am going to talk about 2D linear transformations and then I want to talk about the kinds of properties that a 2D rotation should have because 2D is very easy for us to understand then when we understand those properties we will generalize back up to 3D and we will see some structure I think that is interesting that perhaps you have not seen before. So, let us think about 2D linear transforms 2D linear transformations. So, I will just have a 2 by 2 matrix M 1 1 M 2 1 M 1 2 and M 2 2 just 2 by 2 matrix with real valued entries and I have a 2 dimensional point. So, instead of having x, y, z I just have x, y I am writing it vertically so that we can perform matrix operations someone thought it was a good idea to write it that way. So, we consistently do that in linear algebra. So, if I perform a linear transformation I get let us say x prime y prime right. So, in other words I have some point x, y and by applying that matrix I get some x prime y prime right. So, some kind of transformation has been performed again we are just in 2 dimensions here let us write a 2D coordinate system Cartesian coordinate system. So, I have x axis y axis and I want to think about simplest case this is the point 1 comma 0 right here and this is the point 0 comma 1. These are the standard bases that we use for Cartesian coordinates all the time and I want to think about what happens to these when we perform our transformation. So, we have M 1 1 M 1 2 M 2 1 M 2 2 let us transform this first point here 1 comma 0 right. So, if we transform that 1 0s I put the point here I look at what we get when we perform the multiplication and we get M 1 1 M 2 1 right. So, I perform this multiplication and it drops off the second column all I get remaining here is the first column by doing this operation. So, very interesting. So, it looks like when I perform this linear transformation it tells me exactly what happens to the x coordinate axis right. So, so basically this column here tells me exactly what is going to happen to the x coordinate is that right because I have just taken it exactly of length 1 I am lined up perfect with this axis. So, it is telling me what happens to this basis element right you may write these as i hat and j hat and engineering and if there is a third dimension you may write these as k hat right. These are just the unit basis elements for Cartesian coordinates when you start doing basic vector calculus correct. So, I am just saying that what happens is with a linear transformation you may have seen this before just pay attention that every column here is going to correspond to what happens to the coordinate axis in its particular place. So, the first column says what happens or indicates what happens directly happens to the x coordinate and if we do similar thing for the y coordinate m 1 you may write the matrix again m 1 1 m 1 2 m 2 1 m 2 2 and now I put the 0 1 here notice how it just nicely selects right I have picked this point here which is representing the y part the y basis element then it just nicely picks the second column 1 2 m 2 2 right. So, I just wanted to point that out right just you may have heard this before somewhere in linear algebra it is very very simple in two dimensions to see it happening. So, each one of these columns just tells what happens to the corresponding basis element or the corresponding coordinate. So, if I think like this then it is very helpful now to take some very simple matrices and look at what they do. So, let me just make some examples here and again I am trying to set this up I am reminding you about basics of linear algebra which most of you have seen before I assume, but I am also going to connect it a little bit later to something more complicated. So, please bear with me if this is painfully simple. So, but I wanted to be very clear and then we get to more complicated things. So, if my matrix now is this and I apply it to my point x y should be very clear what happens then again I just look at these columns if I apply this to 1 0 it is no change right. So, if I apply if I take this matrix and substitute it in here I apply it to 1 0 it remains 1 0 if I apply it to 0 1 it remains 0 1 perfect. So, this is the identity matrix. So, it has no effect right just think about how it is going to transform this space. So, if I now put something in the space here right. So, I now put some kind of object in here right and I start transforming all of the points in it. So, I can transform anything in this space here including a simple triangle of course, I just want to think about what happens to it. This one has no effect well good thing we call it the identity matrix it should have algebraically no effect. Let us try another one. So, what if I have 2 0 0 2 right what will it do in that case it just scales it right. So, this should stretch along the x axis by a factor of 2 stretch along the y axis by a factor of 2 simply scales it if I pick one half instead it will shrink it right. So, it is a scaling of some kind and of course, I could put different numbers for different axes and then I will get different kinds of stretchings right I can stretch it out along one axis or another that will distort what we call it the aspect ratio when it comes to monitors and things like that right. So, it will distort the aspect ratio all right um negative 1 0 0 1. So, what will that give us right. So, it is a kind of flip right. So, it gives us a mirror image let us say right it is an informal way to say it. So, we get a mirror image now that is not something I am going to consider to be satisfying from the perspective of rigid body transformations. You should not be able to move a body through space and then say ah it is been mirror image now right that does not seem like something that happens right. So, this one is not going to be a legal kind of motion the scaling is also not legal when you move a body through space it should not all of a sudden be a different size. So, very interesting to think about let us try this one let us do a double mirror image. So, what if I go and see here draw a line here. So, what if I do this I do negative 1 0 0 negative 1 right. So, what will that do. So, if I if I flip with respect I do the mirror kind of flip let us say a symmetry flip I do the flip with respect to the x axis and then the flip with respect to the y axis after flipping twice I have mirrored the mirror which makes it unmirrored and I have turned this object upside down right. So, very nice. So, that actually is a rotation because it is upside down and it is not been mirror image. So, this one is rotate by 180 degrees which when we put our math hats on we will use radians. So, so rotate by pi right um there is some other more complicated ones which we do end up needing somewhere else when we get outside of rigid bodies, but what would this do right if I apply this transformation. So, now for the x coordinate it will start increasing as y gets greater right because x is going to get replaced by x plus y. So, that will have an effect of taking something that is um let me draw it here um I will if I start off with a square it will turn into something like this right. So, it is what is called a shearing transformation. So, if I do this I get an x shear and if you want a y shear you can just go the other way you get a y shear which will be stretching upward in the other direction you can have combinations of shears of all different scales and you can have mirror images all of these things combined together is the power of 2 d linear transformations right. So, the question now is if I only want to apply rotations what am I allowed to do let us let us just add constraints let us tear away or delete all of the things we do not like and see what is left. How many degrees of freedom do we have if we can make any 2 by 2 matrix we want 4 right just 4 independent real numbers we can put in here um and so, we have 4 degrees of freedom to start with. So, I want to think about it from the elimination perspective I want to eliminate degrees of freedom that I do not want to allow happening and eliminate anything else I might need to be on that. So, that I am satisfied that what I am left with is just rotations. So, 4 rotations again we are still in 2 d um what am I not allowed to have. So, I want um no I think a very informal no stretching of axes in other words I want to preserve scale. So, let us start off we have 4 degrees of freedom in this matrix M 1 1 M 2 1 M 1 2 M 2 2 right we have 4 degrees of freedom in it and now I am going to start imposing constraints. So, constraint number 1 here if I have no stretching of axes that means these columns remember I told you what the each column represents the distortion of the axis or the transformation of the axis it must have length 1 at the column overall has to have length 1 otherwise um if you think about it right is the matrix multiplication just performing a simple dot product or inner product and. So, if the magnitude of the vector that you are multiplying with is not normalized then you get a different scale. So, it has to have unit length. So, constraint number 1 here means that columns. So, have length 1. So, in other words when I have this matrix I look at the columns and I must have the case that um M 1 1 squared plus M 2 1 squared equals 1 right. So, I get this constraint and I must have this constraint here very similarly M 1 2 squared plus M 2 2 squared equals 1. How many degrees of freedom did I just lose 2? So, I lost 2 degrees of freedom. So, I had 4 each one of these circles here I am like a you know imagine I am the professor marking off points here right I had taking off points from your grade. So, let us say you lost 1 for that you have 1 degree of freedom less you lost 1 for that now you only have 2 degrees of freedom left 2 I want to have no shearing right I do not like these strange shearing effect that is not natural for rigid body transformations. So, what it means in that case is that these coordinate axes here right remember each one of these is the transformed coordinate axis they have to remain orthogonal or perpendicular right. So, in basic when you when you multiply vectors together using a dot product or inner product what is the condition you have for that what has to be satisfied for them to be perpendicular 0 right. So, that is the condition you just have to say that these columns when you take the inner product right because these each one of these represents a vector by itself that says where the coordinate axis is getting transformed to right the coordinate basis is getting transformed to. So, when I take these 2 and take their inner product I get a constraint that looks like this. So, this is the number 2 condition there which is m 1 1 m 1 2 plus m 2 1 m 2 2. So, just a dot product or inner product these 2 columns has to be equal to 0 how many degrees of freedom did I lose there 1 1 lost 1 degree of freedom 1 nice constraint here lost 1 degree of freedom. So, let us say that one is minus 1 I hope we have some degrees of freedom left right by the time we are done with this. Maybe we are done are we done we got down to 1 degree of freedom and you said it was and you and I we all agree that 1 degree of freedom was appropriate for 2 dimensional rotation. So, are we done do we have all the constraints or not we will do this democratically who thinks we are done we just and if the majority thinks so then we will just finish who thinks we are not done the majority is not sure I think is ok. Well there is one more constraint remaining we got the number of degrees of freedom right, but we do not tolerate mirror images right. So, we have to fix that. So, after we impose these 2 constraints the last thing I want to think about now is I want to say no mirror images the formal way to say that mathematics is you need to preserve orientation. So, no orientation changing if you do not pay attention to that then your left handed coordinate system can become right handed all kinds of bad things can happen right. So, we need to preserve orientation alright. So, no mirror images after we perform these 2 constraints it turns out that there is not very many options left for the determinant of that matrix it can only be 1 or minus 1. So, it ends up being a beautiful detector of whether or not someone is trying to perform a mirror image right by by making that matrix. So, the only thing you have to have happen for the remaining case well I will write it over here I guess to implement that is determinant of the matrix put the whole matrix I am just writing dots, but I should put the m's in there needs to be equal to 1 not negative 1 those are the only 2 possibilities left how many degrees of freedom did I lose there 0 I did not lose any degrees of freedom. So, what is interesting is that what remains is going to be a circle of possible 2 dimensional rotations before I did not constraint number 3 I actually had 2 circles there is a circle of the standard rotations and then there is a circle of mirror image rotations and so this last constraint just eliminates the bad circle the circle that does not correspond to rigid bodies right. So, that is the next kind of interesting question is which matrices remain right because these are going to be the ones that are rotations. So, after I perform all of this and in fact, when I look at these equations here I look somewhat familiar right. So, if I instead of writing m 1 1 m 2 1 if I just wrote that with x and y coordinates you recognize this as the equation of a unit circle in the plane. So, it is enough to just parameterize this circle and then derive the other 2 parameters of the matrix from the point on the circle. So, that is what turns out to be fairly easy to do and ends up working very nicely. So, that if I do it in that way then I can just parameterize the circle. So, what I just said there let me do it along here then I just say m 1 1 is equal to cosine theta m 2 1 is equal to sine theta that is just a standard parameterization of the unit circle right right. So, a standard parameterization of the unit circle some amount theta I guess my coordinate system in this particular case is the m 1 1 axis and the m 2 1 axis right. So, that is all I have done I am just taking these the first column here and showing that you can parameterize it nicely as a circle. So, the matrices I get are cosine theta sine theta and now I just do simple substitutions to figure out from the algebra here in these equations in number 1 and number 2 to figure out the rest of it I get minus sine theta and cosine theta and you can do simple substitution up here for example, to verify that constraint number 2 is just fine you can easily see that constraint number 1 is satisfied for the second column this one here because it is still when I square these and add them up I get that famous trigonometric identity sum of squares of sine and cosine is 1. So, that happens for the columns the inner product clearly works and adds up to be 0. So, these are the matrices that remain and a beautiful parameterization has been found by simple recognition that these fall onto a unit circle. So, 2D rotation ends of being very easy for that reason.