Vectors - Clemson University

3y ago
51 Views
6 Downloads
6.61 MB
9 Pages
Last View : 3d ago
Last Download : 3m ago
Upload by : Audrey Hope
Transcription

APPENDIXAVectorsCONTENTSA.1Scaling a vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321A.2Unit or Direction vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321A.3Vector addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322A.4Vector subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322A.5Points and vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322A.6Parametric definition of lines and rays . . . . . . . . . . . . . . . . . . . . . . . . 323A.7Dot or inner product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323A.8A.7.1Trigonometric interpretation of dot product . . . . . . . . . 324A.7.2Geometric interpretation of dot product . . . . . . . . . . . . . 324A.7.3Dot product example: The distance from a point to aline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325A.7.4Dot product example: Mirror reflection . . . . . . . . . . . . . . 325Cross Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326A.8.1Trigonometric interpretation of cross product . . . . . . . 326A.8.2Cross product example: Finding surface normals . . . . 327A.8.3Cross product example: Computing the area of atriangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327319

320 Foundations of Physically Based Modeling and AnimationTo a mathematician, a vector is the fundamental element of what is known as a vectorspace, supporting the operations of scaling, by elements known as scalars, and alsosupporting addition between vectors. When using vectors to describe physical quantities,like velocity, acceleration, and force, we can move away from this abstract definition, andstick with a more concrete notion. We can view them as arrows in space, of a particularlength and denoting a particular direction, and we can think of the corresponding scalarsas simply the real numbers. Practically speaking, a vector is simply a way of simultaneouslystoring and handling two pieces of information: a direction in space, and a magnitude orlength.An arrow is a convenient way to draw a vector; since both length anddirection are clearly indicated. A real number is a convenient wayto represent a scalar, which when multiplied by a vector changesits length. To the left are three visual representations of identicalvectors. They are identical, since they are all of the same length andthe same direction, i.e. they are parallel to each other. Their locationwithin the space is irrelevant.In the study of physically based animation, we will initially be interested in vectors in twodimensional (2D) and in three-dimensional (3D) space, whose elements are real numbers.But, we will see later that vectors can be defined in a space of any number of dimensions,with elements that may themselves be multidimensional.Notationally, a vector is usually denoted by a lower-case letter, which has a line over it,like v, or is printed in bold type, like v. For hand written notes, the line is most convenient,but in printed form the bold form is more usual. Throughout these notes the form v isused.Examining the diagram to the right, we see that vx denotes thehorizontal extent or component of the vector, and v y its verticalcomponent. Note, that in a computer program this structure can beeasily represented as a two-element array of floating point numbers,or a struct containing two floats. When working in 2D, the directionof the vector can be given by the slope m v y /vx . Its magnitude,also calledq its norm, is written kvk. By the Pythagorean Theorem,kvk vvyA vector in 2D Euclidean space is defined by a pair of scalars arrangedin a column, like" #vv x .vyvxv2x v2y .A vector in 3D space is defined by three scalars arranged in a column, vx v v y , vzwhere vx is the horizontal component, v y the vertical component, and vz the depth

Vectors 321component. The norm of a 3D vector v isqkvk v2x v2y v2z .In 3D there is no simple equivalent to the slope. The direction of a 3D vector is often givenin terms of its azimuth and elevation. But, for our purposes it will be best understood by itscorresponding unit vector, which we will describe after first defining some key algebraicvector operations.A.1SCALING A VECTORMultiplication of a vector by a real number scalar leaves thevector’s direction unchanged, but multiplies its magnitude bythe scalar. Algebraically, we multiply each term of the vectorby the scalar. For example" # " #a2ax2a 2 x .ay2a ya2aa/2A.2Division by a scalar is the same as multiplication by the reciprocal of the scalar:"#a /2a/2 x.a y /2UNIT OR DIRECTION VECTORSThe direction of a vector is most easily described by a unit vector, alsocalled a direction vector. A unit vector, for a particular vector, is parallelto that vector but of unit length. Therefore, it retains the direction, butnot the norm of the parent vector. Throughout these notes the notationv̂ will be used to indicate a unit vector in the direction of parent vectorv. For example, the unit or direction vector corresponding with the 2Dvector a would be"# " #ax /kakââ x .a y /kakâ yaâ

322 Foundations of Physically Based Modeling and AnimationA.3VECTOR ADDITIONAddition of vectors can be expressed by a diagram. Placing thevectors end to end, the vector from the start of the first vector tothe end of the second vector is the sum of the vectors. One wayto think of this is that we start at the beginning of the first vector,travel along that vector to its end, and then travel from the startof the second vector to its end. An arrow constructed between thestarting and ending points defines a new vector, which is the sumof the original vectors. Algebraically, this is equivalent to addingcorresponding terms of the two vectors:" # " # "#aba bxa b x x x.aybyay bybaa bWe can think of this as again making a trip from the start of the first vector to the end ofthe second vector, but this time traveling first horizontally the distance ax bx and thenvertically the distance a y b y .A.4VECTOR SUBTRACTIONSubtraction of vectors can be shown in diagram form by placing thestarting points of the two vectors together, and then constructing anarrow from the head of the second vector in the subtraction to thehead of the first vector. Algebraically, we subtract correspondingterms:" # " # "#aba bxa b x x x.aybyay bya-bbaA.5POINTS AND VECTORS(x,y)Yp(0,0)OXpThis leads us to the idea that points and vectors can be interchanged — almost. While vectors can exist anywhere in space,a point is always defined relative to the origin, O. Thus, we cansay that a point, p" # (x, y), is defined by the origin, O (0, 0)xand a vector, p , i.e.yp O p.Because the origin is assumed to be the point (0, 0), points andvectors" canberepresentedthe same way, e.g. the point (2, 3) can be represented as the#2vector . This interchangeability can be very convenient in many cases, but can also lead3

Vectors 323to confusion. It is a good idea to make sure that when storing data, you clearly indicatewhich values are points, and which are vectors. As will be seen below, the homogeneouscoordinates used to define transformations can help with this.Equivalent to the above, we can write, p p O, i.e. a vector defines the measure fromthe origin to a particular point in space. More generally, a vector can always be definedby the difference between any two points, p and q. The vector v p q represents thedirection and distance from point q to point p. Conversely, the point q and the vector vdefine the point, p q v, which is translated from q by the components of v.A.6PARAMETRIC DEFINITION OF LINES AND RAYSx(t)tThis leads us to a compact definition of a line in space,written in terms of a unit vector and a point. Let p be aknown point (expressed in vector form) on the line beingdefined, and let â be a unit vector whose direction is parallel to the desired line. Then, the locus of points on theline is the set of all points x, satisfyingâx(t) p tâ.pThe variable t is a real number, and is known as the lineparameter. It measures the distance from the point p tothe point x(t). If t is positive, the point x lies in the direction of the unit vector from pointp, and if t is negative, the point lies in the direction opposite to the unit vector.The definition of a ray is identical to the definition of a line, except that the parameter tof a ray is limited to the positive real numbers. Thus, a ray can be interpreted as startingfrom the point p, and traveling in the direction of â a distance corresponding to t, as tgoes from 0 to increasingly large positive values. On a ray, the point p is called the rayorigin, â the ray direction, and t the distance along the ray.A.7DOT OR INNER PRODUCTVector-vector multiplication is not as easily defined as addition, subtraction and scalarmultiplication. There are actually several vector products that can be defined. First, wewill look at the dot product of two vectors, which is often called their inner product.Defined algebraically, the dot product of two vectors is given by" # " #aba · b x · x ax bx a y b y .aybyWe multiply corresponding terms and add the result. The result is not a vector, but is

324 Foundations of Physically Based Modeling and Animationin fact a scalar. This turns out to have many ramifications. The dot product is a mightyoperation and has many uses in graphics!A.7.1Trigonometric interpretation of dot productThe dot product can be written in trigonometric form asa · b kakkbk cos θ,lIaIIIIbIlcoswhere θ is the smallest angle between the two vectors.Note, that this definition of θ applies in both 2D and 3D.Two nonparallel vectors always define a plane, and theangle θ is the angle between the vectors measured in thatplane. Note that if both a and b are unit vectors, thenabkakkbk 1, and a · b cos θ. So, in general if you want tofind the cosine of the angle between two vectors a and b, first compute the unit vectorsâ and b̂ in the directions of a and b thencos θ â · b̂.Other things to note about the trigonometric representation of dot product that followdirectly from the cosine relationship are that1. the dot product of orthogonal (perpendicular) vectors is zero, so if a · b 0,for vectors a and b with non-zero norms, we know that the vectors must beorthogonal,2. the dot product of two vectors is positive if the magnitude of the smallest anglebetween the vectors is less than 90 , and negative if the magnitude of this angleexceeds 90 .Geometric interpretation of dot productbaaâ bA.7.2âbbAnother very useful interpretation of the dot product is thatit can be used to compute the component of one vectorin the direction parallel to another vector. For example, letâ be a unit vector in the direction of vector a. Then thelength of the projection of another vector b in the directionof vector a is â · b. You can think of this as the length ofthe shadow of vector b on vector a. Therefore, the vectorcomponent of b in the direction of a isba (â · b)â.So, ba is parallel to a and has length equal to the projection of b onto a. Note also thatb b ba will be the component of b perpendicular to vector a.The dot product has many uses in graphics that the following two examples will serve toillustrate.

Vectors 325A.7.3Dot product example: The distance from a point to a linebbaâbpxLet us look at how dot product can be used to compute animportant geometric quantity: the distance from a pointto a line. We will use the parametric definition of a line,described above, specified by point p and a direction vector â. To compute the distance of an arbitrary point x fromthis line, first compute the vector b x p, from the pointp on the line to the point x. The component of b in thedirection of vector â isba (â · b)â.The component of b perpendicular to a isb b ba ,and the distance of point x from the line is simply kb k.A.7.4Dot product example: Mirror reflectionAnother very useful example of the use of dot product ingeometric calculations is the computation of the mirrorreflection from a surface. Assume that we have a flat mirror surface, whose surface normal is the unit vector n̂. Thevsurface normal is defined to be a direction vector perpennâdicular to the surface. Since there are two such vectorsat any point on a surface, the convention is to take thedirection of the surface normal to be pointing in the “up”vrdirection of the surface. For example, on a sphere it wouldpoint out of the sphere, and on a plane it would point inthe direction considered to be the top of the plane. Now,we shine a light ray with direction v at the surface. The direction of the reflected ray willbe given by vr . What must be true is that the angle θ between the normal n̂ and the lightray v should be the same as the angle between the reflected ray and the normal, and allthree vectors v, n̂, and vr must lie in the same plane. Given these constraints, below isone way to calculate the light reflection ray vr .vnâvrvbbTo make the figure to the left, we first rotated the scene soeverything is in a convenient orientation, with the surfacenormal n̂ pointing vertically, and the surface horizontal.Now, move vector v so that its tail is at the reflectionpoint, as shown by the vector drawn with a dashed line inthe figure. If b is the vector parallel to n̂ from the head ofv to the surface, then by vector addition we havevr v 2b.Now the vector b is just the negative of the component of v in the direction of n̂. So,b (n̂ · v)n̂.

326 Foundations of Physically Based Modeling and AnimationThus,vr v 2(n̂ · v)n̂.A.8ax bCROSS PRODUCTbaThe cross product a b between two vectors a and b isa new vector perpendicular to the plane defined by theoriginal two vectors. In other words, the cross product oftwo vectors is a vector that is perpendicular to both ofthe original vectors. The figure to the left illustrates theconstruction.This notion of cross product does not make sense in 2Dspace, since it is not possible for a third 2D vector to be perpendicular to two (non parallel)2D vectors. Thus, in graphics, the notion of cross product is reserved for working in 3Dspace.Since there are two directions perpendicular to the planeformed by two vectors, we must have a convention to determine which of these two directions to use. In graphics, itis most common to use the right hand rule, and we use thisconvention throughout this text. The right-hand rule works asfollows. Hold your right hand out flat, with the thumb out,aligning the fingers so they point in the direction of a.abNow, rotate your hand so you can curl your fingers in thedirection from vector a to vector b. Your thumb will point in the direction of a b. Ifyou reverse this, and first align your fingers with b and then curl them towards a you willsee that you have to turn your hand upside down, reversing the direction in which yourthumb is pointing. From this it should be apparent that b a (a b). In other words,the order of the operands in the cross product changes the polarity of the resulting crossproduct vector. The result is still perpendicular to both of the original vectors, but thedirection is flipped.A.8.1Trigonometric interpretation of cross productThe magnitude of the cross product is given bywhere θ is the small angle between vectors a and b. Thus, ifa and b are unit vectors, the magnitude of the cross productis the magnitude of sin θ.Note, that the cross product of two parallel vectors will be theaxbka bk kakkbk sin θ ,ab

Vectors 327zero vector 0. This is consistent with the geometric notion that the cross product producesa vector orthogonal to the original two vectors. If the original vectors are parallel, thenthere is no unique direction perpendicular to both vectors (i.e. there are infinitely manyorthogonal vectors, all parallel to any plane perpendicular to either vector).Algebraically, the cross product is defined as follows. If two vectors are defined ax bx a a y , and b b y , azbzthen a y bz az b y a b a b a b z xx z . ax b y a y bxThe cross product has many uses in graphics, which the following two examples will serveto illustrate.A.8.2v02p0Cross product example: Finding surface normalsnâp2v01p1Suppose we have triangle (p0 , p1 , p2 ), and we want to findthe triangle’s surface normal. We can do this easily by useof a cross product operation. First, define vectors along twoof the triangle edges: v01 p1 p0 , and v02 p2 p0 . Thenthe cross product v01 v02 is a vector perpendicular to bothv01 and v02 , and therefore perpendicular to the plane of thetriangle. Scaling this vector to a unit vector yields the surfacenormal vectorn̂ (v01 v02 )/kv01 v02 k.A.8.3Cross product example: Computing the area of a triangleAnother application of cross product to triangles uses thetrigonometric definition of the magnitude of the crossproduct. Suppose we have a triangle, like the one shownbbhto the right. If we know the lengths of sides a and b, andwe know the angle θ between these sides, the area comaputation is straightforward. Relative to side a, the height ofathe triangle is given by h b sin θ, and we know that thearea of the triangle is A 1/2ah, so we have A 1/2ab sin θ. If we represent the sidesof the triangle by vectors a and b, a kak and b kbk. Since the magnitude of the crossproduct ka bk kakkbk sin θ , it follows thatA 1/2ka bk.

Two nonparallel vectors always define a plane, and the angle is the angle between the vectors measured in that plane. Note that if both a and b are unit vectors, then kakkbk 1, and ab cos . So, in general if you want to find the cosine of the angle between two vectors a and b, first compute the unit vectors aˆ and bˆ in the directions of a .

Related Documents:

Product: Clemson Ice Cream (variety of flavors) Page: 4 of 45 Plant Name: Clemson's '55 Exchange Creamery Issue Date: 12/9/2016 Address: Newman Hall, Clemson, SC 29634 Supersedes: N/A Product Description Product Name(s) Clemson Ice Cream (Variety of Flavors) Product Description, including important food safety characteristics Clemson Ice Cream is a frozen, ready-to-eat dessert that is

CAA Brand Guidelines . 3. CU BRAND POLICY / ARCHITECTURE. In order to protect use of the name "Clemson University," the wordmark, the seal and University tiger designed in 1995, the academic logo designed . in 2009, and other official subordinate graphic symbols, the Clemson . University Board of Trustees has determined that the name "Clemson

I think of atomic vectors as “just the data” Atomic vectors are the building blocks for augmented vectors Augmented vectors Augmented vectors are atomic vectors with additional attributes attach

with the 2013 football season. The new Clemson wordmark was boldly displayed in the end zone as Clemson defeated Georgia 38-35 to kickoff the season. In the spring of 2014, Clemson Athletics unveiled the overall Style and Brand Guidelines to the entire Athletic Department and also distributed it for use by all Clemson licensees to place on products

Draw vectors on your map from point to point along the trip through NYC in different colors. North Vectors-Red South Vectors-Blue East Vectors-Green West Vectors-Yellow Site Address Penn Station 33 rd St and 7th Ave Empire State Building 34th St and 5th Ave NY NY Library 41st and 5th Ave .

Chapter 6 139 Vectors and Scalars (ii) Vectors Addition is Associative: i.e. a b c a b c where . a , b . and . c . are any three vectors. (iii) O is the identity in vectors addition: Fig.9. For every vector . a O a Where . O. is the zero vector. Remarks: Non-parallel vectors are not added or subtracted by the .

6.1 An Introduction to Vectors, pp. 279-281 1. a.False. Two vectors with the same magnitude can have different directions, so they are not equal. b. True. Equal vectors have the same direction and the same magnitude. c. False. Equal or opposite vectors must be parallel and have the same magnitude. If two parallel vectors

ASTM A312 /A312M ASME SA312 Covers seamless, straight-seam welded, and heavily cold worked welded austenitic stainless-steel pipe intended for high-temperature and general corrosive service. ASTM A312 /A312M ASME SA312 Grades TP304, TP304L, TP304H, TP309S, TP309H, TP310S, TP310H, TP316, TP316L, TP316H, TP317, TP317L, TP321, TP321H, TP347, TP347H, TP348, TP348H Standard: ASTM A312/A312M .