Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part I.

Slides:



Advertisements
Similar presentations
Geometry of R2 and R3 Dot and Cross Products.
Advertisements

Fun with Vectors. Definition A vector is a quantity that has both magnitude and direction Examples?
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.

Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS 4731: Computer Graphics Lecture 6: Points, Scalars and Vectors Emmanuel Agu.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter Vector Tools for Graphics.
1 Computer Graphics Chapter 5 Vector Based Algorithms.
Vectors.
VECTORS AND THE GEOMETRY OF SPACE Vectors VECTORS AND THE GEOMETRY OF SPACE In this section, we will learn about: Vectors and their applications.
Scalar and Vector Fields
Copyright © Cengage Learning. All rights reserved.
Vector. Scaler versus Vector Scaler ( 向量 ): : described by magnitude  E.g. length, mass, time, speed, etc Vector( 矢量 ): described by both magnitude and.
Phys211C1V p1 Vectors Scalars: a physical quantity described by a single number Vector: a physical quantity which has a magnitude (size) and direction.
Vectors Tools for Graphics.  To review vector arithmetic, and to relate vectors to objects of interest in graphics.  To relate geometric concepts to.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Section 13.3 The Dot Product. We have added and subtracted vectors, what about multiplying vectors? There are two ways we can multiply vectors 1.One results.
Functions of several variables. Function, Domain and Range.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Physics 201 2: Vectors Coordinate systems Vectors and scalars Rules of combination for vectors Unit vectors Components and coordinates Displacement and.
Geometry CSC 2141 Introduction to Computer Graphics.
1.1 – 1.2 The Geometry and Algebra of Vectors.  Quantities that have magnitude but not direction are called scalars. Ex: Area, volume, temperature, time,
Section 13.4 The Cross Product. Torque Torque is a measure of how much a force acting on an object causes that object to rotate –The object rotates around.
Scalars A scalar is any physical quantity that can be completely characterized by its magnitude (by a number value) A scalar is any physical quantity that.
1. Vector Analysis 1.1 Vector Algebra Vector operations A scalar has a magnitude (mass, time, temperature, charge). A vector has a magnitude (its.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Chapter 6 Additional Topics in Trigonometry
Properties of Vector Operations: u, v, w are vectors. a, b are scalars. 0 is the zero vector. 0 is a scalar zero. 1. u + v = v + u 2. (u + v) + w = u +
Vectors CHAPTER 7. Ch7_2 Contents  7.1 Vectors in 2-Space 7.1 Vectors in 2-Space  7.2 Vectors in 3-Space 7.2 Vectors in 3-Space  7.3 Dot Product 7.3.
Scalars and Vectors A scalar quantity is one that can be described by a single number: temperature, speed, mass A vector quantity deals inherently with.
1 Chapter Objectives Parallelogram Law Cartesian vector form Dot product.
Physics. Session Kinematics - 1 Session Opener You fly from Delhi to Mumbai New Delhi Mumbai Hyderabad Then you fly from Mumbai to Hyderabad Does it.
Transformations of Objects – 3D
Vector Space o Vector has a direction and a magnitude, not location o Vectors can be defined by their I, j, k components o Point (position vector) is a.
Geology 5640/6640 Introduction to Seismology 16 Jan 2015 © A.R. Lowry 2015 Read for Wed 21 Jan: S&W (§ ) Last time: “Review” of Basic Principles;
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
Midterm Review  Five Problems 2-D/3-D Vectors, 2-D/3-D equilibrium, Dot Product, EoE, Cross Product, Moments  Closed Book & Note  Allowed to bring.
Copyright © Cengage Learning. All rights reserved.
Vector Tools for Computer Graphics
Sec 13.3The Dot Product Definition: The dot product is sometimes called the scalar product or the inner product of two vectors.
Calculus III Chapter 12 Br. Joel Baumeyer Christian Brothers University.
6.4 Vectors and Dot Products. Dot Product is a third vector operation. This vector operation yields a scalar (a single number) not another vector. The.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
Basic Entities Scalars - real numbers sizes/lengths/angles Vectors - typically 2D, 3D, 4D directions Points - typically 2D, 3D, 4D locations Basic Geometry.
DOT PRODUCT CROSS PRODUCT APPLICATIONS
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part III Intersections.
Learning Objectives Know the difference between scalar and vector quantities Know the graphical addition (subtraction) of vectors Know how to find the.
Vectors and Dot Product 6.4 JMerrill, Quick Review of Vectors: Definitions Vectors are quantities that are described by direction and magnitude.
12.3 The Dot Product. The dot product of u and v in the plane is The dot product of u and v in space is Two vectors u and v are orthogonal  if they meet.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Basics Normalizing a vector => unit vector Dot product Cross product Reflection vector Parametric form.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry.
Vectors in the Plane 8.3 Part 1. 2  Write vectors as linear combinations of unit vectors.  Find the direction angles of vectors.  Use vectors to model.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Direction in space Normalizing a vector => unit vector Dot product Cross product Parametric form of a line.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Introduction to Seismology
Dot Product of Vectors.
Warm up 1.) (3, 2, -4), (-1, 0, -7) Find the vector in standard position and find the magnitude of the vector.
Chapter 3 VECTORS.
Lecture 03: Linear Algebra
Copyright © Cengage Learning. All rights reserved.
2 Vectors in 2-space and 3-space
Vectors and Dot Products
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
6.3 Vectors in the Plane Ref. p. 424.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part I

2 Topics l Why Vectors? l Vector 101 l Coordinate Systems l Inner Product l Cross Product

3 Why Vectors? l Solving geometric problems easily l Describing objects in computer graphics l Projection l Ray Tracing l Representing coordinate system l Etc…

4 Sample Vector Problems

5 Vector 101 l Definition zAn object that has length and direction l BUT, no inherent location l Displacement in space, force, velocity l Representation z2D: (x, y) z3D: (x, y, z) : zmD: (a 1, a 2, …, a m )

6 Vector 101 l Representation of vector and point zVector: boldface lowercase letter, e.g., v, a, n zPoint: Italic uppercase letter, e.g., A, B, P l Example zP = (1, 3) and Q = (4, 1), then vector v = Q – P = (4-1, 1-3) = (3, -2) y x P Q v v v

7 Basic Operations If a=(a x, a y ) and b=(b x, b y ) are vectors l Addition za + b = (a x + b x, a y + b y ) b a a+ba+b Displacement RuleParallelogram Rule b a a+ba+b

8 Basic Operations l Scaling zs a = (s a x, s a y ), where s is a scalar l Subtraction za - b = a + (- b) = (a x - b x, a y - b y ) b a a - b b a -b-b a -a-a 1.2 a

9 Linear Combination l Definition zThe linear combination of m vectors v 1, v 2, …, v m is a vector of the form w = a 1 v 1 + a 2 v 2 + … + a m v m, where a 1, a 2, …, a m are scalars l Affine combination zIf a 1 + a 2 + … + a m = 1 zE.g., 3a + 2b – 4c ? 3a + b – 4c ? zFor two vectors a and b, affine combination v = (1 – t) a + t b

10 Linear Combination l Convex combination zIf a 1 + a 2 + … + a m = 1 AND a i  0, for i = 1, …, m zIt implies that 1  a i  0, for i = 1, …, m (why?) zE.g.,.3a +.7b ? 1.8a -.8b ?

11 Set of Convex Combination l Of two vectors v 1 and v 2 : v = (1 - a)v 1 + a v 2 v = v 1 + a (v 2 - v 1 ) As a varies from 0 to 1, v “moves” from v 1 to v 2 along (v 2 - v 1 ) v1v1 v2v2 v a ( v 2 - v 1 )

12 Set of Convex Combination l Of three vectors v 1,v 2, and v 3 : v = a 1 v 1 + a 2 v 2 + (1 - a 1 - a 2 )v 3 v1v1 v2v2 v v3v3

13 Magnitude of Vectors l Magnitude (length, or size) of vector w = (w 1, w 2, …, w m ), denoted |w|, |w| = l E.g., w = (4, -2), |w| = ? w = (1, -3, 2), |w| = ? l If w = B – A, |w| = distance between points A and B

14 Unit Vector l Vector with unity length l Given a vector v, a unit vector having the same direction of v, denoted, can be obtained by normalization, (Are you sure | | = 1?)

15 Coordinate Systems l 2D l Right-handed 3D l Left-handed 3D Right-handed x z y x z y Left-handed

16 Coordinate Systems l Standard unit vectors in 3D z i = (1, 0, 0), j = (0, 1, 0), and k = (0, 0, 1) l Any 3D vector (a, b, c) can be represented by a i + b j + c k Right-handed x z y x z y Left-handed i j k i j k

17 Dot Product l Inner product l Definition v = (v 1, v 2, …, v m ) and w = (w 1, w 2, …, w m ), the dot product d = v w l E.g., a = (3, 4), b = (1, 6)  d = a b = 3x1 + 4x6 = 27 l Result of dot product is a scalar

18 Properties of Dot Product l Symmetry: a b = b a l Linearity: (a + c) b = a b + c b l Homogeneity: (s a) b = s (a b) l |b| 2 = b b, i.e., |b| =  b b

19 Angle Between Two Vectors l Let  =  c -  b,  = ? b = (|b|cos  b, |b|sin  b ) c = (|c|cos  c, |c|sin  c ) b c = |b|cos  b x |c|cos  c + |b|sin  b x |c|sin  c = |b||c|(cos  b x cos  c + sin  b x sin  c ) = |b||c|(cos(  b -  c )) = |b||c|(cos  )  cos  =  cos  is the dot product of the normalized vectors b c  bb cc

20 Angle Between Two Vectors l  0 l  = 90 o, if b c = 0 l  > 90 o, if b c < 0 l Definition Vectors b and c are perpendicular (orthogonal, or normal) if b c = 0

21 2D Perpendicular Vector l Definition Let a = (a x, a y ) then a  = (-a y, a x ) is the counterclockwise perpendicular to a l a a  = 0 ?? l |a| = |a  | ?? l Perpendicular of a 3D vector? l Examples a aa -a-a a aa

22 Vector Resolution l A vector can be resolved into 2 vectors l We are interested in resolving into 2 perpendicular vectors zGiven a vector c and a vector v, we want to resolve c into two vectors Kv and Mv  zM=? K=? v MvMv vv c KvKv c = Kv + Mv 

23 Vector Resolution l c = Kv + Mv  c v = Kv v + Mv  v = Kv v c v  = Kv v  + Mv  v  = Mv v 

24 Distance from Point to Line l Distance d from point C to line through point A in direction v = ? l Example: zC=(6,4) and line through (1,1) and (4,9) d = ? v MvMv vv c KvKv C A

25 Orthogonal Projection l Orthogonal projection of c onto v is l Example zc = (6, 4) and a =(1, 2) zthe orthogonal projection of c onto a = ? v MvMv vv c KvKv C A

26 Applications of Projection - Reflection l Reflection zr = ? zm + e = a e + (-m) = r  2m = a - r  r = a - 2m n (known) a (known) r (unknown)  r n a  m -m-m ee

27 Reflection l m is the orthogonal projection of a onto n  l Example za = (4, -2), n = (0, 3) r = ? r n a  m -m-m ee

28 Cross Product l Defined for 3D vectors l Definition a = (a x, a y, a z ), b = (b x, b y, b z ), the cross product of a and b is a  b = (a y b z - a z b y ) i + (a z b x - a x b z ) j + (a x b y - a y b x ) k or ijk a  b = a x a y a z (determinant) b x b y b z

29 Properties of Cross Product l i  j = k l j  k = i l k  i = j l a  b = - a  b l a  (b + c) = a  b + a  c l (s a)  b = s (a  b) l Why is it useful? zGiven two 3D vectors, find a 3D vector perpendicular to them

30 Geometrical Interpretation of Cross Product l a  b is perpendicular to both a and b l |a  b|=|a||b|sin , where  is the angle between a and b that is less than 180 o l Area of parallelogram = |a  b| a b a  ba  b

31 Applications of Cross Product l Finding the normal of a plane zGiven three points P 1, P 2, P 3 that are not collinear (do not lie in a in a straight line) zFind the normal n of the plane determined by P 1, P 2, P 3 l Let a = P 2 - P 1 and b = P 3 - P 1, then n = a  b l Example zFind the normal to the plane passes through (1,0,2), (2,3,0), and (1,2,4) x z y P1P1 P3P3 P2P2 a b