Presentation is loading. Please wait.

Presentation is loading. Please wait.

Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.

Similar presentations


Presentation on theme: "Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1."— Presentation transcript:

1 Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1

2 Math for CSLecture 12 Course Outline 1.Homogeneous Coordinates. 2.Solution of linear systems. 3.Diagonalization, LU, SVD, geometric interpretation. 4.Optimization with and without constraints. Lagrange Multipliers. 5.Differential Equations and their solution. 6.Fourier series and Fourier transformation. 7.Discrete and continuous convolution. 8.Partial differential equations.

3 Math for CSLecture 13 Linear Transformations The coordinate of the point is described by vector: Linear transformations are Translation, Scaling, Rotation and their combinations. Translation Translation is an addition of the vector.

4 Math for CSLecture 14 Scaling X  2, Y  0.5 Scaling Scaling with respect to the origin is done by multiplication on the scaling matrix.

5 Math for CSLecture 15 2-D Rotation  (x, y) (x’, y’) Rotation Rotation around the origin is done by multiplication on the rotation matrix.

6 Math for CSLecture 16 Homogeneous coordinates Translation is treated differently (as an addition) from rotation and scaling (as a multiplication). We would like to treat all transformations as multiplications. For example, we want to describe the sequence of Rotation, Translation, Rotation, Scaling of as Point Point is described as 3 components. The third component, usually equals to 1 and is utilized for matrix representation of the translation.

7 Math for CSLecture 17 Homogeneous coordinates scaled by a constant, represent the same point. Projective Planes x2x2 x1x1 W2W3 W1

8 Math for CSLecture 18 Translation Now, we can write the translation as the multiplication by specially designed matrix: Translation in Homogeneous coordinates

9 Math for CSLecture 19 Two translations We can check that the matrix representing two sequential translations can be written as the multiplication of their matrices. Translation in Homogeneous coordinates

10 Math for CSLecture 110 Scaling Scaling matrix looks similar to what it was for ordinary coordinates: Scaling in Homogeneous coordinates

11 Math for CSLecture 111 Two scalings The matrix of two successful scalings is the multiplication of two scaling matrices: Scaling in Homogeneous coordinates

12 Math for CSLecture 112 Rotation Rotation in Homogeneous coordinates Easy to check, that clock-wise rotation on angle θ is given by:  (x, y) (x’, y’)

13 Math for CSLecture 113 Matrix Multiplication Several Successful Rotations as Multiplication Two successful rotations can be represented by multiplication of their matrices:

14 Math for CSLecture 114 Rotation and Scaling around a point Rotation How to write the rotation around a point ? Bring p back Bring p to the origin Up to now, matrices of Rotation and Scaling represented transformations with respect to origin (0,0) Bring the point p to the origin; make a rotation, bring it back:

15 Math for CSLecture 115 Scaling with respect to a point Scaling Bring p back Bring p to the origin … the same procedure for scaling:

16 Math for CSLecture 116 Homogeneous coordinates in 3D PointTranslation Scaling The translation and scaling are very similar in 3D:

17 Math for CSLecture 117 The Rotation in 3D can be done around arbitrary axis. Euler angles representation: Any rotation is the composition of three basic rotation, a rotation around the axis x of an angle , a rotation around the axis y of an angle  and a rotation around the angle z of an angle  are called Euler angles In right hand coordinated these rotations are defined as follows Simple representation Order-dependent:  Not suitable for animation, because the interpolation between the angles of rotation leads to false locations Rotation in 3D: Axis needed

18 Math for CSLecture 118 The line equation in Euclidian Coordinates is: The Euclidian point (x,y) in Homogeneous Coordinates can be written as p=(x,y,1) or p=(αx, αy, α) Therefore, denoting Euclidian line (1) by the homogeneous triple u=(a,b,c) we obtain, that the point p lies on the line u iff: Note, that both p and u can be arbitrarily scaled in accordance with the rules, without change of (1). Lines in Homogeneous Coordinates

19 Math for CSLecture 119 Now, let us look for the interception point p=(x, y, w) of two lines u 1 =(a 1,b 1,c 1 ) and u 2 =(a 2,b 2,c 2 ): Solution of these equations yields the point (in the convenient scaling) This solution formally coincides with the 3-d Euclidian cross-product, applied to the Homogeneous Coordinates: Intersection of two lines

20 Math for CSLecture 120 Now, let us look for the line u=(a, b, c) passing through two points p 1 =(x 1,y 1,w 1 ) and p 2 =(x 2,y 2,w 2 ): Similarly to the solution of the lines intersection, we obtain The third point p 3 =(x 3,y 3,w 3 ) lies on the line u if (p 3,u)=0, which via definitions of determinant can be written as Due to duality of representation of lines and points in Homogeneous Coordinates, if the three lines u 1, u 2 and u 3 intersect in a single point, they satisfy Three points on the line


Download ppt "Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1."

Similar presentations


Ads by Google