Practice: Using non-square matrices to do a projection
Last updated
Last updated
Shadows are an example of a transformation that reduces the number of dimensions. For example, 3D objects in the world cast shadows on surfaces that are 2D.
We can consider an example for looking at shadows using linear algebra.
The sun is sufficiently far away that effectively all of its rays come in parallel to each other. We can describe their direction with the unit vector.
We can describe the 3D coordinates of points on objects in our space with the vector . Objects will cast a shadow on the ground at the point along the path that light would have taken if it hadn't been blocked at , that is, .
The ground is at ; by using , we can derive the expression, , (where ​).
Rearrange this expression for and substitute it back into the expression for in order to get in terms of .
From the lecture video, we know that the projection and the dot product are the same things, which result in dimension reduction: e.g., 3D -> 2D as in the current case. The first two problems are just pure linear algebra to express the formula in different forms.
(1) r^′=r+λs ̂
The subscript refers to the dimension, the third dimension in this case, which is the vertical line. For r', there is no third dimension since it is 2D and thus it equals zero.
(3) r^′⋅e ̂_3=0
r' is perpendicular to the vertical line and thus the dot product of the two vectors is zero.
(4) s_3=s Ì‚â‹…e Ì‚_3
s Ì‚â‹…e Ì‚_3 is the projection of s Ì‚ onto e Ì‚_3 which is
(5) r⋅e ̂_3+λs_3=0
From (1), if we dot product both sides by e Ì‚_3, we get:
(1−1) r^′⋅e ̂_3=(r+λs ̂)⋅e ̂_3
Since we know, (3) r^′⋅e ̂_3=0 :
(1−2) 0=(r+λs ̂ )⋅e ̂_3
Or
(1−3) r⋅e ̂_3+λs ̂ ⋅e ̂_3=0
Finally, from (4), we get (5)
If we rearrange (5) in terms of λ
(5−1) λ=−(r⋅e ̂_3)/s_3
Plugging it into (1), we get:
(6) r^′=r − s ̂(r⋅e ̂_3)/s_3
Which is the answer for #1
If we apply Einstein's convention on (6):
(7) r_i^′=r_i −s_i [e ̂_3]_{j} r_j/s_3
is the projection of r to e Ì‚_3:
From (7), if we take as the common term:
(7−1) r_i^′=(I_ij −(s_i [e ̂_3]_j/s_3 ) r_j
Similarly, from (8), we get: