1
00:01:01,289 --> 00:01:08,289
Last time we had introduced this topic of
two dimensional transformations, we will go
2
00:01:10,600 --> 00:01:13,700
into details of this topic today. The first
two dimensional transformation is a operation
3
00:01:13,700 --> 00:01:20,700
of translation. So if you have any point xy
and that is translated by a vector given by
4
00:01:21,899 --> 00:01:28,899
Tx Ty then we can say that the transform point
x prime y prime will be equal to xy plus the
5
00:01:36,159 --> 00:01:43,159
transformation vector which is Tx Ty. So x
prime will be equal to x plus Tx and y prime
6
00:01:46,319 --> 00:01:52,610
will be equal to y plus Ty. This simple translation
operation in which all entities will get translated
7
00:01:52,610 --> 00:01:59,610
by a uniform vector, the shape etcetera of
the entities will be retained. The other operation
8
00:02:00,259 --> 00:02:07,259
that we had seen last time was rotation and
we said that in rotation about the origin
9
00:02:16,300 --> 00:02:23,300
by an angle theta, any point xy will get transformed
to a point in this manner and we had said
10
00:02:27,010 --> 00:02:34,010
that x prime y prime will be equal to xy multiplied
by a matrix which has cos theta sin theta
11
00:02:40,959 --> 00:02:44,830
minus sin theta and cos theta.
12
00:02:44,830 --> 00:02:49,540
So x prime will be equal to xy multiplied
by cos theta minus sin theta which is x prime
13
00:02:49,540 --> 00:02:56,540
will be equal to x cos theta minus y sin theta
and y prime will be x sin theta plus y cos
14
00:02:57,510 --> 00:03:02,180
theta. This will be the transform point x
prime y prime.
15
00:03:02,180 --> 00:03:09,180
The third transformation that we had seen
last time was the scaling operation and in
16
00:03:22,139 --> 00:03:29,139
scaling we had said that x prime and y prime
will be xy multiplied by a scaling matrix
17
00:03:32,379 --> 00:03:39,379
which will be Sx 0 and 0 Sy. The x coordinate
will get multiplied by Sx and y coordinate
18
00:03:40,359 --> 00:03:47,359
will get multiplied by Sy, this is a scaling
operation. So if you have a figure like this
19
00:03:55,309 --> 00:04:02,309
and scale it by a factor of 2 it will become
something like this. All the x coordinates
20
00:04:07,900 --> 00:04:14,900
will get multiplied by 2, the y coordinates
will also get multiplied by two of all the
21
00:04:18,769 --> 00:04:25,769
points. This is the scaling operation. Now
let's see reflection.
22
00:04:37,510 --> 00:04:44,510
If you have any arbitrary point xy and we
reflect it about the y axis, this point will
23
00:04:46,900 --> 00:04:53,900
be x prime y prime which will be nothing but
minus x y. So when you are reflecting about
24
00:04:56,630 --> 00:05:03,630
the y axis, the transformation can be written
as x prime y prime will be equal to xy multiplied
25
00:05:04,650 --> 00:05:11,650
by minus 1 0 0 1. Similarly if you are reflecting
about the x axis, this point will go somewhere
26
00:05:16,150 --> 00:05:23,150
down at this location and the coordinates
would then become x minus y and this matrix
27
00:05:25,250 --> 00:05:32,250
will become 1 0 0 minus 1. Similarly if you
reflect about the origin that means we take
28
00:05:37,050 --> 00:05:44,050
this radial line proceeded in this direction
and we get a point in that direction which
29
00:05:45,040 --> 00:05:52,040
is minus x minus y and for reflecting about
the origin the transformation matrix will
30
00:05:53,180 --> 00:05:54,610
be minus 1 0 0 minus 1.
31
00:05:54,610 --> 00:06:01,610
So when you are reflecting about the y axis,
the x axis will become, the x coordinate will
32
00:06:10,240 --> 00:06:17,230
change its sign and when you reflect about
the x axis the y coordinate will change the
33
00:06:17,230 --> 00:06:22,520
sign and when you reflect about the origin
both the coordinates will change the sign.
34
00:06:22,520 --> 00:06:29,520
Now if we compare these matrices with this
scaling operations, we notice that for reflecting
35
00:06:32,040 --> 00:06:37,430
about the y axis it is nothing but the scaling
operation when Sx equal to minus 1 and Sy
36
00:06:37,430 --> 00:06:44,430
equal to plus 1. Similarly the other two reflections
can also be captured as scaling operations.
37
00:06:44,690 --> 00:06:51,690
So reflection is nothing but a specific case
of scaling. Whenever you want to reflect a
38
00:06:57,950 --> 00:07:04,240
point or an entity about either x axis y axis
or about the origin that can always be obtained
39
00:07:04,240 --> 00:07:11,240
by scaling by having a correct values of Sx
and Sy either one or both of them will be
40
00:07:12,950 --> 00:07:14,050
minus 1.
41
00:07:14,050 --> 00:07:21,050
So for the four operations that we have seen
we can summarize in this manner. Translation
42
00:07:28,330 --> 00:07:35,330
is captured by x prime y prime is equal to
xy plus Tx Ty. Rotation is captured by x prime
43
00:07:45,410 --> 00:07:52,410
y prime is equal to xy multiplied by cos theta
sin theta sin theta cos theta and scaling
44
00:08:00,550 --> 00:08:07,550
is captured by the equations and of course
reflection is a specific case of scaling.
45
00:08:23,660 --> 00:08:30,430
Now in these three basic operations if you
notice translation is captured by the addition
46
00:08:30,430 --> 00:08:35,820
of two matrices while both rotation as well
as scaling are captured by multiplication
47
00:08:35,820 --> 00:08:42,820
of two matrices and multiplication is definitely
more convenient because let's say if you take
48
00:08:42,849 --> 00:08:49,849
any point in this coordinate system, we first
want to rotate it about the origin we get
49
00:08:50,589 --> 00:08:55,910
this point then maybe you want to translate
it and go the third point. We can capture
50
00:08:55,910 --> 00:09:02,450
that as a sequence of rotation or sequence
of transformation sorry. We will get point
51
00:09:02,450 --> 00:09:09,450
P1 will be equal to the point P multiplied
by some transformation matrix T1 where this
52
00:09:09,709 --> 00:09:12,490
T1 corresponds to this rotation.
53
00:09:12,490 --> 00:09:17,940
Now this point let's say is to be scaled.
If this point is to be scaled we will say
54
00:09:17,940 --> 00:09:24,940
P2 will be equal to P1 multiplied by some
other transformation matrix T2 which is nothing
55
00:09:28,709 --> 00:09:35,709
but P into T1 T2. So if all our matrix, all
our transformations are captured as matrix
56
00:09:40,949 --> 00:09:45,569
multiplications the transformations can be
very easily, multiple transformations can
57
00:09:45,569 --> 00:09:50,790
be very easily captured. Essentially with
this same we will define what are called as
58
00:09:50,790 --> 00:09:51,509
homogeneous coordinates.
59
00:09:51,509 --> 00:09:58,509
In homogeneous coordinates every point xy
will now be written as x multiplied by some
60
00:10:24,970 --> 00:10:31,329
number h, y multiplied by some number h and
h. So the point xy instead of being written
61
00:10:31,329 --> 00:10:38,329
as a tuple will now be written as consisting
of three numbers. So if you have a point let's
62
00:10:45,970 --> 00:10:52,970
say 2 3, this point can be written as 2 3
1, it can also be written as 4 6 2, it can
63
00:10:59,829 --> 00:11:06,059
also be written as 1 1.5 0.5, all these represent
the same point. Basically what we will do
64
00:11:06,059 --> 00:11:13,059
is whatever be the value of this homogeneous
coordinate, we will divide both of these by
65
00:11:20,779 --> 00:11:27,779
that value and then when this value is equal
to one these two will give us the exact x
66
00:11:29,170 --> 00:11:36,170
and y values. So any point xy can always be
represented as x y 1, so x y 1 is one of the
67
00:11:43,110 --> 00:11:50,110
homogeneous coordinate representation of the
point x y because we have basically added
68
00:11:51,619 --> 00:11:58,619
one more coordinate to the two dimensional
point and the advantage is, well to start
69
00:12:02,069 --> 00:12:09,069
with we were talking of translation.
70
00:12:09,329 --> 00:12:16,329
Earlier we had written x prime y prime is
equal to xy plus Tx Ty. Now x prime y prime
71
00:12:24,860 --> 00:12:31,860
will now be written as x prime y prime 1.
This will be equal to x y 1 and now since
72
00:12:39,110 --> 00:12:43,019
our points consists of three coordinates,
our transformation matrix will also be a 3
73
00:12:43,019 --> 00:12:50,019
by 3 matrix and for translation we will get
1 0 0 0 1 0 Tx Ty 1 and
we say this is h. So x prime will be x y 1
74
00:13:03,110 --> 00:13:10,110
multiplied by this column vector of 1 0 to
h which is nothing but x plus Tx, y prime
75
00:13:13,029 --> 00:13:20,029
will be x y 1 multiplied by this column vector
which is nothing but y plus Ty and the homogeneous
76
00:13:21,339 --> 00:13:28,339
coordinate h will be this row vector multiplied
by this column vector and we will get 1. This
77
00:13:32,139 --> 00:13:39,139
way even translation can be captured easily
as matrix multiplication.
78
00:13:41,279 --> 00:13:48,279
The other two operations, we were talking
about rotation x prime y prime h will be equal
79
00:14:05,730 --> 00:14:12,730
to x y 1 multiplied by. The basic matrix will
remain the same. In other places we will just
80
00:14:15,160 --> 00:14:22,160
add zero's and one's. This way x prime will
be equal to this row vector multiplied by
81
00:14:24,869 --> 00:14:29,959
this column vector which gives us the same
equation as we had earlier. Similarly y prime
82
00:14:29,959 --> 00:14:34,019
will be this row vector multiplied by this
column vector, it will again give us the same
83
00:14:34,019 --> 00:14:40,290
equation as earlier and the homogeneous coordinate
will just give one. So rotation can also be
84
00:14:40,290 --> 00:14:43,649
captured in a similar manner. Then scaling,
that can also be captured in a similar manner
85
00:14:43,649 --> 00:14:50,649
and we have to scale by an amount of Sx, this
row vector will get multiplied by this column
86
00:15:14,649 --> 00:15:21,649
vector and x prime is equal to Sx times this
x and y prime is equal to Sy times y, the
87
00:15:23,459 --> 00:15:28,199
homogeneous coordinate h will again be equal
to 1.
88
00:15:28,199 --> 00:15:35,199
So this way by using homogeneous coordinates,
we first want to capture translation by this
89
00:15:38,660 --> 00:15:45,660
matrix multiplication operation and similarly
even rotation and scaling are captured as
90
00:15:49,989 --> 00:15:56,989
matrix multiplication operations. We are keeping
h equal to 1. Yes. see if we divide h by 1
91
00:16:04,649 --> 00:16:07,369
over Sx we will get uniform scaling in the
both the directions. Again. Multiplying by
92
00:16:07,369 --> 00:16:14,369
1, see I will just come to that in a minute.
The reason why we have added homogeneous coordinates
93
00:16:16,009 --> 00:16:23,009
is, the first primary reason is that translation
should be captured as matrix multiplication.
94
00:16:26,199 --> 00:16:33,199
If we don't add the homogeneous coordinate,
translation will not be captured as a matrix
95
00:16:38,139 --> 00:16:45,139
multiplication. As a result of that we will
not be able to combine different kinds of
96
00:16:48,949 --> 00:16:55,749
transformation by a single matrix, we will
just see how that is to be done. The second
97
00:16:55,749 --> 00:17:01,769
thing that you are saying is that instead
of this one, if I change this to some value
98
00:17:01,769 --> 00:17:08,769
let's say 1 over S, if I change it to 1 over
S and these for the timing being I will let's
99
00:17:10,439 --> 00:17:13,459
say both equal to 1.
100
00:17:13,459 --> 00:17:17,850
Now we will get uniform scaling in the x and
the y direction, not different scaling we
101
00:17:17,850 --> 00:17:22,329
will get uniform. Yeah, you won't get different
scaling, you will get uniform scaling in the
102
00:17:22,329 --> 00:17:29,329
x and the y direction. This is 1, this is
1 and this is 1 over S this point will become
103
00:17:30,070 --> 00:17:37,070
x y and 1 over S which is identical to x times
S, y times S and 1. So if you want uniform
104
00:17:41,210 --> 00:17:48,210
scaling in both the directions, we can just
give a 1 over S factor in the bottom right
105
00:17:50,660 --> 00:17:57,660
corner of the transmission matrix. If you
want non uniform scaling then we need to give
106
00:18:00,350 --> 00:18:07,350
one factor over here and one factor over here.
If you want to translate a point then we need
107
00:18:08,520 --> 00:18:15,010
to add some value here and some value here.
If you need to rotate a point about the origin
108
00:18:15,010 --> 00:18:20,570
then you will have some value cos theta here,
sin theta here minus sin theta here and cos
109
00:18:20,570 --> 00:18:26,810
theta here. This is when you want to rotate
by an angle of theta counter clockwise about
110
00:18:26,810 --> 00:18:30,440
the origin.
111
00:18:30,440 --> 00:18:37,440
Now I had mentioned that if you want to combine
different operation, different transformations
112
00:19:02,600 --> 00:19:09,600
you can take any point P transformed by matrix
T1 and we will get let's say the point P1.
113
00:19:12,250 --> 00:19:19,250
We can take this point P1 transformed by another
matrix and we will get P2 will be equal to
114
00:19:22,430 --> 00:19:29,430
P times T1 T2 and we continue this operation,
we will finally get Pn which will be P T1
115
00:19:31,520 --> 00:19:38,520
T2 multiplied till Tn. This means that for
transforming any point P, you can take each
116
00:19:43,620 --> 00:19:50,620
of these individual transformations, multiply
them together or you can write it like this.
117
00:19:51,040 --> 00:19:58,040
I can get one combined transformation matrix
for all these transformations. This way we
118
00:19:59,460 --> 00:20:06,460
are able to do purely because all the transformations
are represented in the form of matrix multiplications.
119
00:20:09,560 --> 00:20:16,560
We just see one specific example of where
this kind of thing is very useful.
120
00:20:19,200 --> 00:20:26,200
So far when we were taking of rotation, we
were rotating a point about the origin. You
121
00:20:37,970 --> 00:20:44,970
have taken a point xy and you are rotating
it about the origin by an angle of theta.
122
00:20:50,890 --> 00:20:57,890
Instead of that if I have a point xy and I
want to rotate it about any arbitrary point
123
00:20:58,080 --> 00:21:05,080
ab, how do I find out the values of x prime
and y prime? I know that if I am rotating
124
00:21:26,230 --> 00:21:28,780
about the origin I know what is the transformation
matrix meant for that. If this is the case
125
00:21:28,780 --> 00:21:35,780
I can easily get x prime y prime 1 will be
equal to xy, x y 1 multiplied by some transformation
126
00:21:38,370 --> 00:21:45,370
matrix meant for rotation. But if I have to
rotate about the point ab, how do I find the
127
00:21:46,400 --> 00:21:53,400
transformation matrix for this case? What
we will do is we will translate the axis such
128
00:21:56,700 --> 00:22:03,700
that ab becomes the origin, this origin
should come to this location. We will then
rotate the point xy to x prime y prime and
129
00:22:24,750 --> 00:22:31,750
then we will translate this axis back to this
position. So our step 1 would be
to translate origin to ab, step 2 would be
130
00:22:59,060 --> 00:23:06,060
to rotate by theta about origin and step 3
would be to translate origin back to its original
131
00:23:31,520 --> 00:23:33,370
position.
132
00:23:33,370 --> 00:23:40,370
So for rotating a point about any arbitrary
point that can be done as a sequence of these
133
00:23:41,890 --> 00:23:48,890
three steps. And how do we translate the origin
to the point ab? What will be the transformation
134
00:23:50,840 --> 00:23:57,840
matrix for that? Anyone? Translate all the
points by minus a minus b. We will translate
135
00:23:59,370 --> 00:24:06,130
all the points by minus a minus b not by ab.
So transformation matrix for this will be
136
00:24:06,130 --> 00:24:13,130
1 0 0 0 1 0 minus a minus b 1. This is the
first transformation matrix, T1 will be equal
137
00:24:17,000 --> 00:24:24,000
to this. Is that okay? Is this clear? So why
we were using minus a and minus b over here?
138
00:24:31,380 --> 00:24:38,380
No. see what we want is that this point ab
should now have the coordinate of 0 0. So
139
00:24:39,100 --> 00:24:46,100
to a and b, I have to add minus a and minus
b that means what I am effectively doing is
140
00:24:46,410 --> 00:24:51,700
this point is being translated back to the
origin by this amount.
141
00:24:51,700 --> 00:24:58,700
So the translation vector is minus a minus
b not just ab. So when I am translating the
142
00:25:04,350 --> 00:25:11,040
origin to ab that is the origin should become
this point that means coordinates of ab should
143
00:25:11,040 --> 00:25:18,040
now become 0 0 that is a negative translation
by ab or translation by minus a minus b. So
144
00:25:20,140 --> 00:25:25,380
the first step is we translate the origin
to ab using this transformation matrix then
145
00:25:25,380 --> 00:25:32,380
you need to rotate by theta about the origin.
What is the transformation matrix for that?
146
00:25:36,920 --> 00:25:43,920
The same as a one for rotation, cos theta
sin theta 0 minus sin theta cos theta 0 0
147
00:25:45,690 --> 00:25:52,690
0 1. For rotation about the origin we use
the same matrix as that is meant for rotation
148
00:25:53,630 --> 00:26:00,630
by an angle theta. Then translating the origin
back, how do we translate the origin back?
149
00:26:02,340 --> 00:26:09,340
Again? The inverse of T1 or that could be
ab. this would be 1 0 0 0 1 0 ab 1 and I want
150
00:26:13,760 --> 00:26:20,760
to translate the origin back. Again this point
should retain the coordinate of ab. the points
151
00:26:32,470 --> 00:26:39,470
which are 0 0 should now retain the coordinate
of ab, so we will add ab to all the coordinates.
152
00:26:43,310 --> 00:26:50,310
So if you combine these three or combine transmission
matrix will be the product of the three transformation
153
00:26:54,330 --> 00:27:01,330
matrices or we can also write this as T1 T2
and T1 inverse. And now if you want to rotate
154
00:27:10,180 --> 00:27:15,760
any arbitrary point xy about the point ab,
all that we need to do is P prime will be
155
00:27:15,760 --> 00:27:22,760
equal to P times T. Is that okay? So this
way we can combine any sets of transformations
156
00:27:33,240 --> 00:27:38,450
into a single transformation.
157
00:27:38,450 --> 00:27:45,450
Similarly if we want to you have a point,
arbitrary point xy and you want to reflect
158
00:27:49,400 --> 00:27:56,400
it about an inclined axis, how do we reflect
the point about the x of the y axis. We use
159
00:27:58,430 --> 00:28:05,430
the scaling operations. Now we want to reflect
it about any arbitrary axis. Let's say the
160
00:28:07,410 --> 00:28:14,410
axis is passing through the point ab and I
have got direction cosines of (l, m). How
161
00:28:26,720 --> 00:28:33,720
do we reflect the point xy about this axis?
Anyone?. So first translate, we translate
162
00:28:52,280 --> 00:28:59,280
the origin to this point so that this ab now
becomes the origin. So we translating by a
163
00:29:01,210 --> 00:29:08,210
vector of minus a minus b. then we rotate,
for this you will get some transformation
164
00:29:12,470 --> 00:29:19,470
matrix T1. Then we rotate the axis so that
this direction coincides with the let's say
165
00:29:20,180 --> 00:29:27,180
the x axis that means in the first step my
axis has become like this. In the second step
166
00:29:36,720 --> 00:29:41,580
I rotate my axis so that my axis becomes like
this.
167
00:29:41,580 --> 00:29:48,580
That is rotate, this
will give us the transmission matrix T2 then
I will reflect about the x axis that will
168
00:30:07,010 --> 00:30:14,010
give us the transformation matrix T3 and then
I will do the reverse of these two. So the
169
00:30:14,370 --> 00:30:20,760
combined transformation will become T will
be T1 T2 T3 T2 inverse T1 inverse. The sequence
170
00:30:20,760 --> 00:30:27,760
is important; I cannot take the inverses in
the opposite order. I am doing T1 then T2
171
00:30:31,860 --> 00:30:38,860
so the inverses have to be taken T2 inverse
first then T1 inverse. Any questions on this
172
00:30:51,570 --> 00:30:58,570
part? These individual transformation matrices,
it will be able to write them on your own.
173
00:31:00,520 --> 00:31:05,390
Transformation matrix for translation, for
rotation, for reflection and the reverse of
174
00:31:05,390 --> 00:31:12,390
these two transformations, only one thing
you should be careful about is in step two.
175
00:31:19,220 --> 00:31:26,220
When we are rotating the axis, let's say this
angle with an angle theta, we will have to
176
00:31:32,600 --> 00:31:39,600
write the transformation matrix for minus
theta because what we want is that this direction
177
00:31:40,290 --> 00:31:44,960
should not become the x axis.
178
00:31:44,960 --> 00:31:51,960
So a point on this axis will be a point on
the x axis. So this point which is earlier
179
00:31:54,850 --> 00:32:01,850
xy should now become that is from x prime,
0 that will be obtained when I am rotating
180
00:32:02,980 --> 00:32:09,980
actually by an angle of minus theta. Similarly
translation we have done minus a minus b,
181
00:32:13,370 --> 00:32:20,370
so rotation will be by minus theta. Reflection,
in T2 inverse here we will have rotation by
182
00:32:23,780 --> 00:32:30,780
theta and translation by ab. So we have basically
seen how we can combine different operations
183
00:32:44,150 --> 00:32:51,150
and get a combined transformation matrix for
a series of operations.
184
00:32:52,500 --> 00:32:59,500
The
basic advantage that we have of using homogeneous
coordinates, the first advantage was that
185
00:33:08,500 --> 00:33:15,500
transmission can be captured as matrix multiplication.
The second advantage that we have seen is
186
00:33:20,870 --> 00:33:27,870
uniform scaling
can be captured by one single parameter. The
third we have seen is that the transformations
187
00:33:37,510 --> 00:33:44,510
can be combined. One more advantage of using
homogeneous coordinates is that if we want
188
00:33:52,170 --> 00:33:59,170
to represent the
point at infinity let's say infinity in this
direction, you can take any point here xy
189
00:34:07,420 --> 00:34:14,420
and x y 0 will be a point at infinity in that
direction because we have said that a homogeneous
190
00:34:20,260 --> 00:34:27,260
coordinate x y h actually corresponds to x
by h, y by h and 1. So this h is equal to
191
00:34:34,260 --> 00:34:41,260
0, so this point represents a point at infinity
in the direction of xy. So another advantage
192
00:34:45,550 --> 00:34:52,550
of using homogeneous coordinate is points
at infinity can be easily captured.
193
00:34:57,809 --> 00:35:04,809
Now in the homogeneous transformation matrix,
you have got 9 terms, I will just write them
194
00:35:07,260 --> 00:35:14,260
as a b c. Of these 9 we have seen that this
is a homogeneous coordinate, it gives uniform
195
00:35:25,480 --> 00:35:32,480
scaling, these four are giving us rotation,
these two in addition to rotation they also
196
00:35:40,670 --> 00:35:47,670
give us scaling and these two are giving us
translation. So far these two where retained
197
00:35:50,060 --> 00:35:55,240
at zero for all transformation, we have not
tried to modify these two. We will see later
198
00:35:55,240 --> 00:36:02,240
on that these two are used for capturing perspective
transformations. You know what is a perspective
199
00:36:06,660 --> 00:36:08,670
view? No, and you will see that later.
200
00:36:08,670 --> 00:36:14,660
If you want to capture the perspective view
of any object then we will be using these
201
00:36:14,660 --> 00:36:18,790
two coordinates to capture the perspective
transformation. So another advantage is that
202
00:36:18,790 --> 00:36:24,770
we will see of these homogeneous coordinates
later on will be perspective transformations
203
00:36:24,770 --> 00:36:31,770
can easily be captured, a perspective view
can easily be obtained by such transformations.
204
00:36:32,480 --> 00:36:39,480
So these are some of the advantages of using
homogeneous coordinates. Any question on this
205
00:36:46,160 --> 00:36:53,160
part? Then I will just explain this idea to
transformation in three dimensions.
206
00:36:58,020 --> 00:37:05,020
So if you have any 3 D point, if you have
any 3 D point which is x y z again we will
207
00:37:20,910 --> 00:37:26,510
directly go into homogeneous coordinate, this
we will represent as x times h, y times h,
208
00:37:26,510 --> 00:37:33,510
z times h and h. This would be, a 3 D point
would be represented as a four tuple where
209
00:37:37,530 --> 00:37:44,530
h is the, fourth coordinate will be the homogeneous
one. Translation, I don't know you need to
210
00:37:53,260 --> 00:38:00,260
define translation again. The translation
matrix will be a 4 by 4 matrix now. So we
211
00:38:13,100 --> 00:38:20,100
want to translate any point by Tx Ty Tz, in
the bottom row we have Tx Ty and Tz in one
212
00:38:28,260 --> 00:38:35,260
place. Scaling will get Sx 0 0 0, 1 by S is
for uniform scaling Sx Sy and Sz of a non-uniform
213
00:38:53,760 --> 00:38:57,060
scaling. Now let's come to rotation.
214
00:38:57,060 --> 00:39:04,060
In the two dimensional case we were rotating
about the point which was the origin. In a
215
00:39:19,430 --> 00:39:25,840
three dimensional case we can't rotate about
a point, we have to rotate about an axis.
216
00:39:25,840 --> 00:39:32,840
So let's take the first case. We want to rotate
about the z axis by an angle theta counter
217
00:39:46,160 --> 00:39:53,160
clockwise as you look from the top. For that
what will be your transformation matrix? x
218
00:39:58,130 --> 00:40:05,130
prime y prime z prime, these are the three
points. What will be the value of x prime?
219
00:40:09,720 --> 00:40:16,720
Our initial point was x y z 1, x prime will
be equal to x cos theta minus y sin theta,
220
00:40:26,660 --> 00:40:33,660
y prime will be equal to x sin theta plus
y cos theta and z prime will be the same as
221
00:40:38,860 --> 00:40:45,860
z. The value of z prime will not change, it
is rotating about the z axis.
222
00:40:47,020 --> 00:40:54,020
Any arbitrary point let's say here and you
are rotating it like this, the z value will
223
00:40:54,800 --> 00:41:01,800
remain the same. So the transformation matrix
for this case would be c s minus s c, c stands
224
00:41:13,750 --> 00:41:20,750
for cos theta and s stands for sin theta.
So this will be the transformation matrix
225
00:41:33,790 --> 00:41:40,790
for rotating about the z axis. We can write
it as Tz by an angle theta. This is by transformation
226
00:41:45,910 --> 00:41:48,020
matrix for this one.
227
00:41:48,020 --> 00:41:55,020
Now if we want to rotate about the x axis,
what will be the transformation matrix for
228
00:41:57,070 --> 00:42:04,070
rotation about the x axis by an angle theta?
The x coordinate has to remain unchanged,
229
00:42:09,310 --> 00:42:16,310
this will be 1 0 0 0. These four values we
have to fill up, what will they be? cos sin
230
00:42:28,780 --> 00:42:35,780
minus sin cos. Is that okay? I have directly
written the result, we got this. We want to
231
00:42:37,040 --> 00:42:44,040
rotate the, about theta sorry about the y
axis, the y coordinate will remain unchanged.
232
00:43:07,150 --> 00:43:14,150
These four coordinates these four values,
we will have to fill up. What will these values
233
00:43:28,010 --> 00:43:35,010
be? Anyone? c s minus s c. Is that correct?
Minus s c will be no, just think of the figure
234
00:44:04,210 --> 00:44:11,210
x y z. So on this xz plane I am drawing the
xz plane now, this is x, this is z. I am rotating
235
00:44:20,740 --> 00:44:27,740
by an angle of theta. This is my point P,
this will be my point P prime, the z value
236
00:44:31,260 --> 00:44:38,260
of this point is going to decrease. so this
will be plus, this will be minus. You can
237
00:44:44,510 --> 00:44:51,510
verify it from this figure, the z value is
decreasing, the x value is increasing. So
238
00:44:58,130 --> 00:45:05,130
the x value will be c prime or cos theta times
cos theta times x plus sin theta times z,
239
00:45:06,820 --> 00:45:10,790
the y value will remain unchanged.
240
00:45:10,790 --> 00:45:17,790
So when you want to rotate about the y axis
by an angle theta this will be your transformation
241
00:45:26,200 --> 00:45:33,200
matrix. So the basic transformations we have
seen, our basic transformations were translation,
242
00:45:39,390 --> 00:45:46,390
scaling then rotation about the x axis sorry
about the z axis and about the x and the y
243
00:45:48,390 --> 00:45:55,390
axis. Now from these basic operations let's
try and get some of the other operations.
244
00:46:00,470 --> 00:46:07,470
The first is reflections. If you want to reflect
about the xy plane, what will happen? The
245
00:46:17,260 --> 00:46:24,260
z value will become negative, the rest will
remain the same. Similarly if you want to
246
00:46:31,619 --> 00:46:38,619
reflect about the xz plane, the y value will
become negative so for that 1 minus 1 1 1,
247
00:46:45,220 --> 00:46:52,220
all the others will be 0. If you want to reflect
about the yz plane, you have minus 1 1 1 1,
248
00:46:59,540 --> 00:47:06,540
all the others will be 0. If you want to reflect
about an axis so if you want to reflect about
249
00:47:10,580 --> 00:47:17,580
the x axis, what will happen? Both y and z
values will. Both y and z values will become
250
00:47:24,220 --> 00:47:31,220
will change. Similarly with respect to the
y axis, x and z values will change. If you
251
00:47:34,790 --> 00:47:41,790
want to reflect about the z axis, x and y
values will change. If you want to reflect
252
00:47:45,750 --> 00:47:52,750
about the origin, reflecting about the origin
all the values will change. So reflections
253
00:47:56,960 --> 00:48:03,960
are very easily captured as scaling operations.
254
00:48:04,990 --> 00:48:11,990
Now let's again talk of rotation, a rotation
about any arbitrary point or an about an arbitrary
255
00:48:19,010 --> 00:48:26,010
axis. So
256
00:48:29,980 --> 00:48:36,980
we want to rotate about an axis like this.
This is let's say the point a b c and this
257
00:48:41,859 --> 00:48:48,859
vector has got direction cosines of l m n.
How do we rotate about this arbitrary vector?
258
00:48:56,410 --> 00:49:03,410
We have any arbitrary point x y z, this is
my x axis, this is my y axis, this is my z
259
00:49:06,760 --> 00:49:11,070
axis. I want to rotate this point x y z about
this vector, so we will get something like
260
00:49:11,070 --> 00:49:18,070
this again by an angle of theta. This will
be transformed to some point over here, this
261
00:49:20,000 --> 00:49:27,000
is P this will be transformed to P prime.
How do we find out the coordinates of P prime,
262
00:49:28,680 --> 00:49:35,680
what will be sequence of steps involved. Anyone?
We translate so that this becomes the origin,
263
00:49:47,869 --> 00:49:54,869
translate by minus a minus b minus c. So now
my axis would look something like this. What
264
00:50:02,910 --> 00:50:09,910
is the next step? We rotate so that rotate
such that vector l m n coincides with one
265
00:50:24,359 --> 00:50:31,359
axis, any axis for sake of argument let us
say this will be our z axis. This will take
266
00:50:40,890 --> 00:50:47,890
two rotations. This will take two rotations,
what will be the two rotations? We will first
267
00:50:49,440 --> 00:50:56,280
rotate so that this vector comes into the
xz plane then we will rotate so that x coincides
268
00:50:56,280 --> 00:50:56,790
with the z.
269
00:50:56,790 --> 00:51:03,790
So this will be one matrix T1, this will be
two rotations let's say R1 and R2 then we
270
00:51:07,450 --> 00:51:14,450
will carry out the rotation, that let's say
is R and then we will say reverse of steps,
271
00:51:21,880 --> 00:51:28,880
reverse 2 and 1. Whatever transformations
we have obtained in step 2, we will do the
272
00:51:31,710 --> 00:51:35,290
opposite of that. Whatever transformation
is obtained in step 1, we will do apposite
273
00:51:35,290 --> 00:51:42,290
of that. The combined transformation will
come out to be T1 R1 R2 R R2 inverse R1 inverse
274
00:51:42,400 --> 00:51:49,400
T inverse. So if we want to rotate a point
x y z about any arbitrary vector that would
275
00:51:55,760 --> 00:51:56,980
be done by a sequence of these 7 steps.
276
00:51:56,980 --> 00:52:03,980
In the next class what we will see is how
these two rotations are done, what will be
277
00:52:10,490 --> 00:52:15,720
angle then about which axis these two rotations
will be done. We will see that in detail in
278
00:52:15,720 --> 00:52:22,720
the next class. again. Same thing we will
put this as T2 and this will become T2 inverse.
279
00:52:27,130 --> 00:52:33,440
You take this as let's say T2 and then this
as T2 inverse. You can do that but once you
280
00:52:33,440 --> 00:52:40,440
have multiplied the three matrices, finding
out the inverse is going to be a difficult
281
00:52:42,590 --> 00:52:49,590
job. Four by four. four by four matrices you
have to find out the inverse by inverse by
282
00:52:51,740 --> 00:52:53,200
the matrix inverse algorithm. So each of these
individuals, the inverse is just a rotation
283
00:52:53,200 --> 00:53:00,200
by an apposite angle of minus theta. So this
T2 inverse can be found out easily by matrix
284
00:53:01,580 --> 00:53:08,580
multiplication little easier that is I will
prefer to do this kind of thing. Nevertheless,
285
00:53:10,390 --> 00:53:17,390
you can multiply them and then find out the
inverse, you will still get the same result.
286
00:53:34,880 --> 00:53:41,880
Any other questions?