Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Some Mathematics CS 385 February 23, 2005.

Similar presentations


Presentation on theme: "Computer Graphics Some Mathematics CS 385 February 23, 2005."— Presentation transcript:

1 Computer Graphics Some Mathematics CS 385 February 23, 2005

2 Vectors Many physical quantities such as temperature and speed are measured with a single number. But other quantities require more than one number. Examples include velocity (which=speed + direction) and certain forces where the strength and the direction are important. Vectors can be looked both algebraically and geometrically. We will be using both representations

3 Vectors from the Algebraic Point of View Vectors have a dimension A one dimensional vector is a real number A two dimensional vector is an ordered pair of real numbers written (x, y). x and y are called the coordinates of the vector. This can be generalized to any positive integral dimension n

4 Vectors can be added Let’s think about 2 – dimensional vectors. Let v = (v1,v2) and let w = (w1,w2) be two 2- dimensional vectors. Define v+w = (v1+w1, v2+w2) We can do the same for 3-dimensional (or any dimensional) vectors (v1,v2,v3)+(w1,w2,w3) = (z1+z2+z3)= (v1+w1+z1, v2+w2+z2, v3+w3+z3)

5 Sometimes we don’t care about the coordinates of the vector and we just write v+w = z The idea here is to think of vectors as ordinary numbers whenever possible. This way we can use our intuition of numbers and apply it to vectors. Of course not everything will work. We need to be careful and check things.

6 The zero vector There is a special vector denoted 0 and called the zero vector. In 2 dimensions, 0 = (0,0). Let’s note that 0 shares many of the same properties of our good old regular number 0. For any 2-dimensional vector v, we have, v+0=0+v=v

7 The negative of a vector Let v be a 2-dimensional vector. Let us show that there exists a vector that when added to v yields the 0 vector. Define –v = (-v1,-v2) Theorem: v + (-v) = 0 Proof: v+(-v)=(v1,v2)+(-v1,-v2)= (v1+(-v1),v2+(-v2))=(0,0) = 0

8 Scalars Scalars can be thought of as ordinary real numbers. In general they can be complex numbers or any elements in an algebraic structure called a field. But for our purposes, the field is the ordinary real numbers. Scalars are often written as lower case greek letters but I will use a, b, c, d, e, f, or a1.a2,

9 The coordinates of a vector come from the set of scalars. We can multiply a scalar by a vector by multiplying it coordinatewise: aV = a(v1,v2) = (av1,1v2)

10 Vectors from the Geometric Point of View Geometrically a vector is an arrow It is characterized by two quantities, its direction and its length. Its length is often called its magnitude.

11 Important Consequence of Definition of Vector from Geometric point of view Two vectors with the same length and same direction are actually the same vector

12 Addition of Geometric Vectors v w v + w

13 Addition of Geometric Vectors v w v + w = ? v + w

14 Subtraction of Geometric Vectors We define: v-w to be v + (-w)

15 Example v w v - w

16 Dot product between 2 vectors v·w = v1w1 + v2w2 Notice: The dot product of 2 vectors is a scalar.

17 Interesting Fact If v·w=0 then v and w are perpindicular

18 Norm of a vector ||v||= The norm of a vector is its length

19 Bringing in a little trig Some Formulas cosθ =

20 Next Time Matrices and Transformations


Download ppt "Computer Graphics Some Mathematics CS 385 February 23, 2005."

Similar presentations


Ads by Google