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

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
Copyright © Cengage Learning. All rights reserved.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Chapter 4.1 Mathematical Concepts
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
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.
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.
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
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.
CHAPTER 3: VECTORS NHAA/IMK/UNIMAP.
AP Physics C – Vectors. 1.1 Vectors. Vectors are mathematical quantities indicated by arrows. The length of the arrow denotes the magnitude or the size.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Copyright © Cengage Learning. All rights reserved. 6.3 Vectors in the Plane.
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.
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
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
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.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
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 Chapter 2.  Scalars and vectors : A scalar quantity: is a quantity that has magnitude only. Mass, time, speed, distance, pressure, Temperature.
Vectors and the Geometry
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Chapter 3 Vectors.
4.3 Vectors.
Math review - scalars, vectors, and matrices
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 (orthgonal) 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 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. The length as defined is the distance between P to 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: 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) 3.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 tuples. Useful operations on vectors (cont’d):

There are at least two easy ways to represent a tuple: Array based representation: We can use the typedef facility to create a user defined type called tuple_t. An instance of tuple_t is a three element double precision array: typedef double tuple_t[3]; An instance of tuple_t is a three element double precision array and can be created as shown. tuple_t tuple; It is understood that tuple[0] is the x-component (coordinate) tuple[1] is the y-component tuple[2] is the z-component Representing tuples 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: tuple_t t; t[X] = 11; t[Y] = 2; t[Z] = -4; Representing tuples in C

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

Structure based representation tuple_t t; In this representation, it is explicit that t.x is the x-component t.y is the y-component t.z is the z-component Representing tuples in C

The tuple.h file contains the following definition: typedef struct tuple_type { double x; double y; double z; } tuple_t; Representing tuples

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

tuple_t scale(tuple_t t, double factor); This function multiplies each component of the input tuple “t" by a scaling factor "factor" and returns a new tuple that is scaled. tuple_t add(tuple_t t1, tuple_t t2); Compute the componentwise sum t1 + t2 and return a new tuple. tuple_t diff(tuple_t t1, tuple_t t2); Compute the componentwise difference t2 – t1 and return a new tuple. Tuple functions

tuple_t unitize(tuple_t t); Construct a unit length tuple in the direction of the input tuple t. A unit tuple is a tuple having length 1. To obtain the unit tuple in the direction of a tuple "t", scale "t" by (1 / ||t||). 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 tuple (0 = (0, 0, 0)) it should return zero tuple (i.e. (0, 0, 0)). To avoid crashing on a divide-by-zero exception, check for a zero-length tuple before calling scale(). Tuple functions

double dot(tuple_t t1, tuple_t t2); The inner product or dot product of two tuples 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 tuple) 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. Tuple functions

void printTuple(FILE *outFile, char *label, tuple_t t); Print the 3 elements of a tuple 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: printTuple(stderr, "Result: ", t); should result in the output: Result: Tuple functions

tuple_t readTuple(FILE *inFile, char *errmsg) Try to read three double values from the input stream "inFile" and store the result in the tuple pointed to by t. The return value from readTuple() should be the tuple_t value if no errors occur. On error readTuple() should print the error message pointed to by "errmsg" and exit the program. Tuple 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