Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.

Slides:



Advertisements
Similar presentations
Physics: Principles with Applications, 6th edition
Advertisements

Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Vectors and the Geometry of Space
Section 9.3 The Dot Product
Chapter 3 Vectors.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Copyright © 2014, 2010, 2007 Pearson Education, Inc. 1 Section 6.6 Vectors.
Vectors.
Chapter 3: VECTORS 3-2 Vectors and Scalars 3-2 Vectors and Scalars
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.
Copyright © Cengage Learning. All rights reserved.
VECTORS AND THE GEOMETRY OF SPACE 12. VECTORS AND THE GEOMETRY OF SPACE So far, we have added two vectors and multiplied a vector by a scalar.
Copyright © Cengage Learning. All rights reserved.
Chapter 3 Vectors.
Mathematical Fundamentals
UNIVERSITI MALAYSIA PERLIS
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Chapter 3 Vectors Coordinate Systems Used to describe the position of a point in space Coordinate system consists of A fixed reference point called.
1 CEE 451G ENVIRONMENTAL FLUID MECHANICS LECTURE 1: SCALARS, VECTORS AND TENSORS A scalar has magnitude but no direction. An example is pressure p. The.
Vectors and the Geometry of Space
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
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,
Introduction and Vectors
Adding Vectors, Rules When two vectors are added, the sum is independent of the order of the addition. This is the Commutative Law of Addition.
General physics I, lec 1 1 Chapter (1,2). general physics I, lec 1 2 Physical quantities (in mechanics) Basic quantities : in mechanics the three fundamental.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Chapter 3 Vectors. Coordinate Systems Used to describe the position of a point in space Coordinate system consists of a fixed reference point called the.
Vectors and the Geometry of Space 9. Vectors 9.2.
Vectors What is Vector?  In elementary mathematics, physics, and engineering, a Euclidean vector is a geometric object that has both a magnitude (or length)
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
L 2 – Vectors and Scalars Outline Physical quantities - vectors and scalars Addition and subtraction of vector Resultant vector Change in a vector quantity,
Chapter 3 Vectors. Coordinate Systems Used to describe the position of a point in space Coordinate system consists of a fixed reference point called the.
Types of Coordinate Systems
Introduction to Vectors (Geometric)
Copyright © Cengage Learning. All rights reserved. Vectors in Two and Three Dimensions.
Presented by: S. K. Pandey PGT Physics K. V. Khandwa Kinematics Vectors.
Copyright © Cengage Learning. All rights reserved. Vectors in Two and Three Dimensions.
Chapter 3 Vectors. Vector quantities  Physical quantities that have both numerical and directional properties Mathematical operations of vectors in this.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
CHAPTER 3: VECTORS NHAA/IMK/UNIMAP.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Vectors.
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.
STROUD Worked examples and exercises are in the text Programme 6: Vectors VECTORS PROGRAMME 6.
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
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.
Chapter 3 Lecture 5: Vectors HW1 (problems): 1.18, 1.27, 2.11, 2.17, 2.21, 2.35, 2.51, 2.67 Due Thursday, Feb. 11.
Physics 141Mechanics Lecture 3 Vectors Motion in 2-dimensions or 3-dimensions has to be described by vectors. In mechanics we need to distinguish two types.
STROUD Worked examples and exercises are in the text PROGRAMME 6 VECTORS.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
SCALARS & VECTORS. Physical Quantities All those quantities which can be measured are called physical quantities. Physical Quantities can be measured.
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.
Introduction to Vectors Section Vectors are an essential tool in physics and a very significant part of mathematics. Their primary application.
Copyright © Cengage Learning. All rights reserved. Vectors in Two and Three Dimensions.
Chapter 3 Vectors. Vector quantities  Physical quantities that have both numerical and directional properties Mathematical operations of vectors in this.
Vectors and the Geometry
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Chapter 3 Vectors.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin. The number of dimensions in the coordinate system is equal to the number of perpendicular (orthogonal) axes and is also the number of values needed to specify a location with respect to the origin Basic elements of 3-D coordinate systems and linear algebra

One dimension: the line Two dimensions: the plane Basic elements of 3-D coordinate systems and linear algebra

Three dimensions: the universe as we perceive it (A right handed coordinate system is shown. In a left handed system the direction of the positive z axis is reversed. ) Two dimensions: the plane Basic elements of 3-D coordinate systems and linear algebra

The location of a point P in 3-D Euclidean space is given by a triple (p x, p y, p z ) The x, y, and z coordinates specify the distance you must travel in directions parallel to the the x, y, and z axes starting from the origin (0, 0, 0) to arrive at the point (p x, p y, p z ) Points in 3-D space

Some physical properties, such as temperature and area, are given completely by their magnitude, and only need a number to represent them (scalar). But, for other physical quantities such as force, velocity, or acceleration, we must know direction as well as size (magnitude). We represent these physical properties as direction lines or vectors. Vectors contain both magnitude and direction. Vectors in 3-D space

A vector in 3-D space is sometimes called a directed distance because it represents both –a direction and –a magnitude or distance In this context, the triple (p x, p y, p z ) can also be considered to represent –the direction from the origin (0, 0, 0) to (p x, p y, p z ) and –its length sqrt(p x 2 + p y 2 + p z 2 ) is the Euclidean (straight line) distance from the origin to (p x, p y, p z ) Vectors in 3-D space

Properties of Vectors 1.Two vectors are equal if and only if they are equal in both magnitude and direction. a != b (length is equal but not direction). Vectors c are equal! 2.If c is a vector, then –c is defined as having the same magnitude but the reverse direction to c. 3.Multiplying a vector by a number (or scalar) just has the same effect of changing its scale. Eg. 2a would be twice as long as a but the same direction as a. Vectors:

Free vs. Position Vectors Free Vectors: Two Vectors labelled c are defined to be equal although we need a shift to move them exactly on top of each other. Vectors that can be shifted about are called free vectors. Position Vector: A vector that indicates the position of a point in a coordinate system. –Eg: Vector r is called a position vector of the point P from the fixed origin O, and describes the displacement of P from O – must run from O to P and can’t be shifted. Vectors:

Points and Vectors Two points in 3D space implicitly determine a vector pointing from one to the other. Given to point P and Q, the vector R: R = P - Q = (p x - q x, p y - q y, p z - q z ) R represents the direction from Q to P. Note that the direction is a signed quantity. The direction from P to Q is the negative of the direction from Q to P. Example: Let Q = (8, 6, 5) and P = (3, 2, 0) Then: 1.Vector direction from Q to P is: (3-8, 2-6, 0-5) = (-5, -4, -5) 2.Vector direction from P to Q is: (8-3, 6-2, 5-0) = (5, 4, 5)

Points and Vectors The length is defined as the distance between P and Q. The distance from P to Q is always the same as the distance from Q to P. Example: Let Q = (8, 6, 5) and P = (3, 2, 0) Then: 2.Distance between Q and P is: Sqrt( ) = Sqrt(66) = 8.12.

Geometric Interpretation of Vector Arithmetic We illustrate vector addition in 2D, but in 3D the principles are same. Since we can think of vectors as displacements or journeys, to add two vectors, we just need to find the single displacement which gives the same result as doing the two displacements separately. Example: If a boat sets a course to move with velocity P in water flowing with velocity Q, then it will actually have a Resultant velocity of P + Q.

We define the sum of two vectors P and Q as the componentwise sums: R = P + Q = (p x + q x, p y + q y, p z + q z ) (3, 4, 5) + (1, 2, 6) = (4, 6, 11) The difference of two vectors is computed as the componentwise differences: R = P - Q = (p x - q x, p y - q y, p z - q z ) (3, 4, 5) - (1, 2, 6) = (2, 2, -1) Useful operations on vectors:

We also define multiplication (or scaling) of a vector by a scalar number a S = aP = (ap x, ap y, ap z ) 3 * (1, 2, 3) = (3, 6, 9) The length of a vector P is a scalar whose value is denoted: || P || = sqrt(p x 2 + p y 2 + p z 2 ) || (3, 4, 5) || = sqrt( ) = sqrt(50) Useful operations on vectors (cont’d):

A unit vector is a vector whose length is 1. Therefore an arbitrary vector P may be converted to a unit vector by scaling it by 1 / (its own length). Here U is a unit vector in the same direction as P. U = ( 1 / || P || ) P The inner product or dot product of two vectors P and Q is a scalar number. It is a value expressing the angular relationship between two vectors. The dot product is computed by taking the sum of the componentwise products of the two vectors. x = P dot Q = (p x q x + p y q y, + p z q z ) (2, 3, 4) dot (3, 2, 1) = = 16 Thus || P || = sqrt(P dot P) Useful operations on vectors (cont’d):

The dot product has the following relationship with the lengths of two vectors and the angle between them. If U and V are vectors and q is the angle between them, then U dot V = V dot U = || U ||* || V || * cos(q) If U and V are unit vectors and q is the angle beween them then: cos (q) = U dot V = V dot U In this course, we will refer to vectors as vectors. Useful operations on vectors (cont’d):

There are at least two easy ways to represent a vector: Array based representation: We can use the typedef facility to create a user defined type called vector_t. An instance of vector_t is a three element double precision array: typedef double vector_t[3]; An instance of vector_t is a three element double precision array and can be created as shown. vector_t vec; It is understood that vec[0] is the x-component (coordinate) vec[1] is the y-component vec[2] is the z-component Representing vectors in C

Array based representation (cont’d): To make this association explicit we use the #define facility #define X 0 #define Y 1 #define Z 2 We can then create an instance of the vector (11, 2, -4) as shown: vector_t v; v[X] = 11; v[Y] = 2; v[Z] = -4; Representing vectors in C

Structure based representation We can also define a structured type in which the elements are explicitly named typedef struct vector_type { double x; double y; double z; } vector_t; Representing vectors in C

Structure based representation vector_t v; In this representation, it is explicit that v.x is the x-component v.y is the y-component v.z is the z-component Representing vectors in C

The vector.h file contains the following definition: typedef struct vector_type { double x; double y; double z; } vector_t; Representing vectors in C

vector_t ray(vector_t v1, vector_t v2); Compute a non-unitized vector from point t1 to point t2. This is just computing the componentwise difference t2 - t1 and returning the new vector value. NOTE: The vector from t1 to t2 is not the same as the vector from t2 to t1!!! double length(vector_t v); Computes the length of the vector. The length is the square root of the sum of the squares of the components of the vector: || v || = sqrt(v x 2 + v y 2 + v z 2 ) Vector functions

vector_t scale(vector_t v, double factor); This function multiplies each component of the input vector “v" by a scaling factor "factor" and returns a new vector that is scaled. vector_t add(vector_t v1, vector_t v2); Compute the componentwise sum v1 + v2 and return a new vector. vector_t diff(vector_t v1, vector_t v2); Compute the componentwise difference v2 – v1 and return a new vector. Vector functions

vector_t unitize(vector_t v); Construct a unit length vector in the direction of the input vector v. A unit vector is a vector having length 1. To obtain the unit vector in the direction of a vector "v", scale "v" by (1 / ||v||). Hint: you can use length() and scale() to do much of the work for you in this function. If this function is called with the zero vector (0 = (0, 0, 0)) it should return zero vector (i.e. (0, 0, 0)). To avoid crashing on a divide-by-zero exception, check for a zero-length vector before calling scale(). Vector functions

double dot(vector_t v1, vector_t v2); The inner product or dot product of two vectors P and Q is a scalar number: x = P dot Q = (p x q x + p y q y + p z q z ). Thus || P || = sqrt(P dot P) We will find that the dot product operation is very useful in the construction of the ray tracer because the dot product of two UNIT vectors (a vector is just a type of vector) yields the cosine of the angle between the two vectors. That is, if P and Q are unit vectors then P dot Q is the cosine of the angle between the vectors P and Q. If they are not unit vectors then (P dot Q) / (|| P || || Q || ) yields the cosine. Vector functions

void printVector(FILE *outFile, char *label, vector_t t); Print the 3 elements of a vector on a line prefixed by a label to the output stream "outfile". Each value should be printed in a field that is a minimum of 8 characters wide and with 4 decimal places (e.g. " "). If t=(2.2, 0, ) the call: printVector(stderr, "Result: ", t); should result in the output: Result: Vector functions

vector_t readVector(FILE *inFile, char *errmsg) Try to read three double values from the input stream "inFile" and store the result in the vector pointed to by t. The return value from readVector() should be the vector_t value if no errors occur. On error readvector() should print the error message pointed to by "errmsg" and exit the program. Vector functions

We will also find other data types that are readily represented as 3 fields, in particular a point, a pixel, or color. Representing other data