Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

10.2 Vectors and Vector Value Functions
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Demetriou/Loizidou – ACSC330 – Chapter 4 Geometric Objects and Transformations Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
UBI 516 Advanced Computer Graphics
General Physics (PHYS101)
Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
Math Foundations of CG Math 1 Hofstra University.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Math Foundations of CG Math 1 Hofstra University.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
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
Section 9.2 Vectors Goals Goals Introduce vectors. Introduce vectors. Begin to discuss operations with vectors and vector components. Begin to discuss.
Fall Scalar Quantity (mass, speed, voltage, current and power) 1- Real number (one variable) 2- Complex number (two variables) Vector Algebra (velocity,
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Computer Graphics Lecture 10 Fasih ur Rehman. Last Class Viewing – Perspectives – Projections.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Graphics Graphics Korea University cgvr.korea.ac.kr 1.2 Notation and Definition 그래픽스 연구실 정병선.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Math Primer for CG Ref: Interactive Computer Graphics, Chap. 4, E. Angel.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Monday, 26 January 2004 William H. Hsu Department of.
Geometry CSC 2141 Introduction to Computer Graphics.
1 Geometry. 2 Objectives Introduce the elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them in a coordinate-free.
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,
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Section 10.2a VECTORS IN THE PLANE. Vectors in the Plane Some quantities only have magnitude, and are called scalars … Examples? Some quantities have.
Vectors and the Geometry of Space 9. Vectors 9.2.
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
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.
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.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
Computer Graphics I, Fall 2010 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Mathematical Foundation for Graphics
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Introduction; Mathematical Foundations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
CA 302 Computer Graphics and Visual Programming
Spaces.
Mathematics for Computer Graphics
Outline Addition and subtraction of vectors Vector decomposition
CSC461: Lecture 12 Geometry Objectives
Lecture 03: Linear Algebra
Introduction to Computer Graphics with WebGL
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
2 Vectors in 2-space and 3-space
PPT&Programs
6.3 Vectors in the Plane Ref. p. 424.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

Mathematics for Graphics

1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a coordinate-free manner Define basic primitives  Line segments  Polygons

2 3D Cartesian co-ordinates

3 Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space  In computer graphics, we are interested in objects that exist in three dimensions Want a minimum set of primitives from which we can build more sophisticated objects We will need three basic elements  Scalars  Vectors  Points

4 Scalars Need three basic elements in geometry  Scalars, Vectors, Points Scalars can be defined as members of sets which can be combined by two operations (addition and multiplication) obeying some fundamental axioms (associativity, commutivity, inverses) Examples include the real and complex number systems under the ordinary rules with which we are familiar Scalars alone have no geometric properties

5 Vectors And Point We commonly use vectors to represent:  Points in space (i.e., location)  Displacements from point to point  Direction (i.e., orientation) But we want points and directions to behave differently  Ex: To translate something means to move it without changing its orientation  Translation of a point = different point  Translation of a direction = same direction

6 Vectors Physical definition: a vector is a quantity with two attributes  Direction  Magnitude Examples include  Force  Velocity  Directed line segments Most important example for graphics Can map to other types v

7 Vector A quantity characterized by a magnitude and direction Can be represented by an arrow, where magnitude is the length of the arrow and the direction is given by slope of the line 2 1 v Y X A vector in 2D Y X Z v A vector in 3D P (2, 1) O (0, 0) v = OP = จุดปลาย – จุดต้น = P-O

8 Vector Operations Every vector has an inverse  Same magnitude but points in opposite direction Every vector can be multiplied by a scalar There is a zero vector  Zero magnitude, undefined orientation The sum of any two vectors is a vector  Use head-to-tail axiom v -v vv v u w

9 Vectors Lack Position These vectors are identical  Same direction and magnitude Vectors spaces insufficient for geometry  Need points

10 Vector Addition Addition of vectors follows the parallelogram law in 2D and the parallelepiped law in higher dimensions:

11 Vector Multiplication by a Scalar Multiplication by a scalar scales the vectors length appropriately (but does not affect direction): 1.5v v

12 Subtraction u -v u Can be seen as an addition of u + (-1v) v Inverse vector?

13 Vector Magnitude The magnitude or “norm” of a vector of dimension 3 is given by the standard Euclidean distance metric: How about dimension n? D example3D example P2P2 P1P1 v

14 Unit Vectors Vectors of length 1 are often termed unit vectors (a.k.a. normalised vectors). When we only wish to describe direction we use normalised vectors – often to avoid redundancy For this and other reasons, we often need to normalise a vector: e.g. v

15 Examples Suppose point P 1 (-1,-3) and P 2 (2,-7). Find  Vector v obtained from these two points  Norm of vector v  Unit vector

16 Dot Product Dot product (inner product) is defined as: Note:  Therefore we can redefine magnitude in terms of the dot-product operator: The dot product operator is commutative and associative.

17 The Dot Product can also be obtained from the following equation: where  is the angle between the two vectors So, if we know the vectors u and v, then the dot product is useful for finding the angle between two vectors. Note that if we had already normalised the vectors u and v then it would simply be: Dot Product v u 

18 Dot Product Examples Find the angle between vectors { 1, 1, 0} and {0, 1, 0}?

19 Additional Properties For any three vectors u, v, w and scalars a, b  uv = vu  u(v+w) = uv + uw  (u+v)w = uw + vw  If uv = 0 then u and v are orthogonal or perpendicular, where u and v are not zero vector

20 Cross Product Used for defining orientation and constructing co-ordinate axes. Cross product defined as: The result is a vector, perpendicular to the plane defined by u and v: Magnitude :

21 Right Handed Coordinate System Cross Product

22 Cross product is anti-commutative: It is not associative: Direction of resulting vector defined by operand order: R.H.S. Cross Product

23 Consider, two vectors u =, v =, the cross product u x v Cross Product

24 Vector Spaces A linear combination of vectors results in a new vector: v =  1 v 1 +  2 v 2 + … +  n v n where  is any scalar If the only set of scalars such that  1 v 1 +  2 v 2 + … +  n v n = 0 is  1 =  2 = … =  3 = 0 then we say the vectors are linearly independent The dimension of a space is the greatest number of linearly independent vectors possible in a vector set For a vector space of dimension n, any set of n linearly independent vectors form a basis

25 Coordinate Systems 3D vector space  scalar component :  1,  2,  3  basis vector : v 1, v 2, v 3 define a coordinate system the origin : fixed reference point  column matrix v2v2 v1v1 v3v3 Coordinate System origin

26 Points Location in space Operations allowed between points and vectors  Point-point subtraction yields a vector  Equivalent to point-vector addition P = v + Q v = P - Q

27 Affine Spaces Point + a vector space Operations  Vector-vector addition  Scalar-vector multiplication  Point-vector addition  Scalar-scalar operations For any point define  1 P = P  0 P = 0 (zero vector)

28 Lines (in Affine Space) Consider all points of the form  P(a)=P 0 + a d  Set of all points that pass through P 0 in the direction of the vector d Affine addition

29 Parametric Form This form is known as the parametric form of the line  More robust and general than other forms  Extends to curves and surfaces Two-dimensional forms  Explicit: y = mx +h  Implicit: ax + by +c =0  Parametric: x(  ) =  x 0 + (1-  )x 1 y(  ) =  y 0 + (1-  )y 1

30 Rays and Line Segments If  >= 0, then P(  ) is the ray leaving P 0 in the direction d If we use two points to define v, then P(  ) = Q+  v = Q +  (R-Q) =  R + (1-  )Q For 0<=  <=1 we get all the points on the line segment joining R and Q

31 Convexity An object is convex iff for any two points in the object all points on the line segment between these points are also in the object P Q Q P convex not convex = concave

32 Affine Sums Consider the “sum” P=  1 P 1 +  2 P 2 +…..+  n P n Can show by induction that this sum makes sense iff  1 +  2 +…..  n =1 in which case we have the affine sum of the points P 1  P 2,…..P n If, in addition,  i >=0, we have the convex hull of P 1  P 2,…..P n

33 Convex Hull Smallest convex object containing P 1  P 2,…..P n Formed by “shrink wrapping” points

34 Curves and Surfaces Curves are one parameter entities of the form P(  ) where the function is nonlinear Surfaces are formed from two-parameter functions P( ,  )  Linear functions give planes and polygons P(  ) P( ,  )

35 Planes A plane be determined by a point and two vectors or by three points P( ,  )=R+  u+  v P( ,  )=R+  (Q-R)+  (P-Q) R P

36 Triangles convex sum of P and Q convex sum of S(  ) and R for 0<= ,  <=1, we get all points in triangle

37 Planes Extension of line P Q R normal to the plane P0P0 v u n P