Presentation is loading. Please wait.

Presentation is loading. Please wait.

Magnitude of a Vector The magnitude of a vector, denoted as |a|, is defined as the square root of the sum of the squares of its components: |a| = (x 2.

Similar presentations


Presentation on theme: "Magnitude of a Vector The magnitude of a vector, denoted as |a|, is defined as the square root of the sum of the squares of its components: |a| = (x 2."— Presentation transcript:

1 Magnitude of a Vector The magnitude of a vector, denoted as |a|, is defined as the square root of the sum of the squares of its components: |a| = (x 2 + y 2 ) ½. if a = (1, 2), its magnitude |a| = (1+4) ½ = 5 ½. The distance between any two points p(x 1,y 1 ) and q(x 2,y 2 ) in a plane is equal to the magnitude of a vector connecting p and q. |p-q| = [(x 1 -x 2 ) 2 + (y 1 -y 2 ) 2 ] ½.

2 Addition of Two Vectors (0,0) 246810121416 2 4 6 8 a b c (8, 2) (6, 6) (14, 8) c = a + b = (8+6, 2+6)

3 Subtraction of Two Vectors (0,0) 246810121416 2 4 6 8 a b c (8, 2) (6, 6) (2, -4) c = (a – b) = (8-6, 2-6)

4 Scalar Multiplication of a Vector (0,0) 246810121416 2 4 6 8 a = ha = (6, 4) (12, 8) h = 2

5 Normal Vector A normal vector has a magnitude equal to one. Any vector a = (x, y) can be normalized as a’ = (x’, y’), by dividing its respective components by its magnitude:

6 Inner Product of Two Vectors Inner product of two vectors is defined as the sum of the product of the respective components of the two vectors having the same number of components. if a = (x 1, y 1 ) and b = (x 2, y 2 ), the inner product a·b = x 1 x 2 + y 1 y 2

7 The inner product of two vectors is also directly related to the angle between them, denoted by: a · b = |a| |b| cosθ The cosine of the angle between two vectors is found by: cosθ= a · b / |a| |b| Inner Product of Two Vectors

8 Matrix A matrix is a rectangular array of numbers (referred to as elements) arranged in rows and columns. A = a 11 a 12 a 21 a 22

9 Addition of Two Matrices If two matrices have the same number of rows and columns, they can be added: A = and B = 3 6 0 3 2 4 5 2 3 1 2 A + B = 7 11 2 6 3 4

10 The product AB of two matrices A and B is defined if and only if the number of columns in A is equal to the number of rows in B. If A is an m x p matrix and B is a p x n matrix, the resulting matrix C is an m x n matrix. Each element of AB is defined as the inner product of the ith row of A and the jth column of B : c ij = a i1 b 1j +a i2 b 2j +... + a ip b pj Product of Two Matrices

11 4 5 2 3 1 2 If A =, B = 3 0 2 6 3 2 then AB = (4) (3) + (5) (6) (4) (0) + (5) (3) (4) (2) + (5) (2) (2) (3) + (3) (6) (2) (0) + (3) (3) (2) (2) + (3) (2) (1) (3) + (2) (6) (1) (0) + (2) (3) (1) (2) + (2) (2) = 42 15 18 24 9 10 15 6 6

12 Some Important Matrices (1) The zero matrix is any matrix whose elements are all zeroes A square matrix is any matrix having as many rows as columns The identity matrix, denoted as I, is defined as a square matrix whose diagonal elements are all ones and all other elements are zeroes Important properties of an identity matrix: IA = AI = A

13 The transposed matrix of a matrix A, denoted as A T, is formed by interchanging the rows and columns of A such that row i of A becomes column i of A T and column j of A becomes row j of A T The symmetric matrix S is a square matrix whose elements s ij = s ji. For symmetric matrix S, S T = S The reciprocal matrix of a square matrix A, denoted as A -1, is defined by its unique property: AA -1 = I Some Important Matrices (2)

14 Determinant( 行列式 ) of a Square Matrix Determinant is a scalar associated with a square matrix Let C = The determinant of C, denoted as | C |, is ascertained as: | C | = (x 1 y 2 – x 2 y 1 ) x1 x2 y1 y2

15 Usages of the Determinant (0,0) 246810121416 2 4 6 8 | C | (4, 6) (10, 2) (14, 8) a = b = C = a, b = 4 10 6 2

16 Homogeneous Coordinates Homogeneous coordinates are the extension of Cartesian coordinates from any dimension into the next higher dimension The homogeneous representation of a 2-D point (x, y) is (hx, hy, h), where h is any non-zero scalar When h = 1, the homogeneous coordinate of 2- D point (x, y) is (x, y, 1)

17 Translation is used to offset the origin of the coordinate system in order to describe the positional changes of a point (x, y). Suppose that T x and T y are increments on the X-axis and Y-axis of the new position of a point (x, y), then the new coordinates: x‘ = x + T x y‘ = y + T y Translation (1)

18 Translation (2) (0, 0) X Y X'X' Y'Y' (x', y') (x, y) x'x' x y y TxTx TyTy ( x' y' 1 ) = ( x y 1) 1 0 0 0 1 0 T x T y 1 = (x + T x y + T y 1)

19 The rotation transformation is used to rotate the original coordinate system about the origin by some angle θ measured in the counter-clockwise direction from the X-axis The rotation tranformations are defined as: x’ = x cosθ + y sinθ y’ = -x sinθ + y cosθ Rotation of the Coordinate System (1)

20 Rotation of the Coordinate System (2) X Y (x, y) X’X’ Y’Y’ x y x’x’ y’y’ (x’, y’) θ (x’ y’ 1) = (x y 1) cosθ -sinθ 0 sinθ cosθ 0 0 0 1

21 Rotation of the Symboles 0102030-10-20-30 10 20 30 40 X Y θ A B C A’A’ B’B’ C’C’ x’ = x cosθ – y sinθ y’ = x sinθ + y cosθ Tr =Tr = cosθ sinθ 0 -sinθ cosθ 0 0 0 1 (x’ y’ 1) = (x y 1) T r

22 Scaling (1) 0102030-10-20-30 10 20 30 40 X A B C Y B’B’ C’C’ A’A’ E F G H E’E’F’F’ G’G’ H’H’ x’ = S x · x y’ = S y · y

23 Scaling (2) X X Y Y S x = 0.5 S y = 1 x’ = S x · x y’ = S y · y

24 Concatenation of Point Transformation (1) Very often it is necessary to perform a sequence of point transformations known as concatenation. The matrix form of point transformation facilitates this process, because a series of transformations can be multiplied in order and stored in a single matrix that represents the whole transformation.

25 The sequence is important! Given a translation matrix T, and a scaling matrix S, a new point p’ = p·T·S. It is not necessarily equal to p·S·T. Concatenation of Point Transformation (2)

26 The concatenated matrix C = T·S is defined as: Concatenation of Point Transformation (3) The concatenated matrix C = S·T is defined as: 1 0 0 0 1 0 T x T y 1 Sx 0 0 0 Sy 0 0 0 1 = Sx 0 0 0 Sy 0 TxSx TySy 1 Sx 0 0 0 Sy 0 0 0 1 1 0 0 0 1 0 T x T y 1 = Sx 0 0 0 Sy 0 Tx Ty 1

27 The Representation of a Straight Line Ax + By + C = 0 X Y p (x 1, y 1 ) q (x 2, y 2 ) b m ABCABC (x y 1) = 0 y = mx + b; Where m = (-A / B) b = (-C/B) (-C/A)

28 Direction of a Line Segment A B C A B C y 1 – y 2 x 2 – x 1 y 2 x 1 – y 1 x 2 y 2 – y 1 x 1 – x 2 y 1 x 2 – y 2 x 1 = = Ax + By + C = 0 (0, 0) X Y p q v | C |

29 The two endpoints of a line segments can also define the straight line passing from p to q in a point-vector form: L = { (x1, y1) + h (x2 – x1, y2 –y1) | h ∊ R } The point-vector form preserves the direction of the line segment between p and q, and for any point lying on the line segment between p an q, the value of h will be in the closed interval [0, 1]. For example if h = 0.5, then the point lies at the middle of the line segment. Point-Vector Form

30 Normalized Straight Line A straight line L, is normalized by dividing its respective parameters by the magnitude of the vector between p and q, (A 2 +B 2 ) ½ A’ B’ C’ = A / (A 2 + B 2 ) ½ B / (A 2 + B 2 ) ½ C / (A 2 + B 2 ) ½ | v | = 1 A’x + B’y + C’ = 0 p’p’ q’q’

31 Questions for Review (1) If two points p (1, 2) and q (4, 1) are given, what is the magnitude of the vector v starting from the point p and ending at the point q? If vector a = (1, 2), b = (4, 3), what is (a + b)? What is (a – b)? What is the angle between these two vectors?

32 Suppose A = Questions for Review (2) 4 5 2 3 1 2 B = 3 0 2 6 3 2 What is the product of AB? Does the product BA exist? If it exists, what is BA? What do the point transforming matrices look like for translation of a point, rotation of the point of the symbol, and scaling the symbol?

33 Why is the concatenation of the matrices for point transformation important? What are the advantages of the concatenation? Why can one say that it is important to study the point and line relationships in digital cartography? ****( Many cartographic functions utilize point and line relationships ) Questions for Review (3)


Download ppt "Magnitude of a Vector The magnitude of a vector, denoted as |a|, is defined as the square root of the sum of the squares of its components: |a| = (x 2."

Similar presentations


Ads by Google