DOC PREVIEW
OSU CS 419 - Vectors

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1VectorsMike [email protected] State Universitymjb – September 5, 2014Oregon State UniversityComputer GraphicsVectors have Direction and Magnitudemjb – September 5, 2014Oregon State UniversityComputer Graphics222xyzV VVVMagnitude:2A Vector Can Also Be Defined as the Positional Difference Between Two Points( Qx, Qy, Qz )( Px, Py, Pz )mjb – September 5, 2014Oregon State UniversityComputer Graphics(,,)( , , )xyz x xy yz zVVV Q PQ PQ P  Unit Vectors have a Magnitude = 1.0mjb – September 5, 2014Oregon State UniversityComputer Graphics222xyzV VVVˆVVVThe circumflex (^) tells us this is a unit vector3Dot Product(,,)xyzAAAA(,,)xyzBBBBmjb – September 5, 2014Oregon State UniversityComputer Graphics()cosxx yy zzABABABAB AB-   Because it produces a scalar result (i.e., a single number),this is also called the Scalar ProductA Physical Interpretation of the Dot ProductAˆBThis is important –memorize this phrase!mjb – September 5, 2014Oregon State UniversityComputer GraphicsˆcosAB A-= How much of A lives in the B direction^4A Physical Interpretation of the Dot ProductFThe amount of the force accelerating the car along the road ismjb – September 5, 2014Oregon State UniversityComputer GraphicscosroadFFgg“how much of F is in the horizontal direction?”This is easy to see in 2D, but a 3D version of the same problem is trickier.A Physical Interpretation of the Dot ProductFRmjb – September 5, 2014Oregon State UniversityComputer GraphicsˆcosroadFFFR-The amount of the force accelerating the car along the road is“how much of F is in the R direction?”5A Physical Interpretation of the Dot ProductFRmjb – September 5, 2014Oregon State UniversityComputer GraphicsˆcosroadFFFR-Dot Products are CommutativeABBA--Dot Products are Distributive()()()ABC AB AC- --mjb – September 5, 2014Oregon State UniversityComputer Graphics()()()ABC AB AC- --6The Perpendicular to a 2D VectorV(x,y)IfV(y,x)thenYou can tell that this is true becauseV V (x,y) ( y,x) xy xy 0 cos90-- mjb – September 5, 2014Oregon State UniversityComputer GraphicsCross Product(,,)xyzAAAA(,,)yz zy zx xz xy yxABABABABABABAB   (,,)xyzBBBBmjb – September 5, 2014Oregon State UniversityComputer GraphicssinAB ABBecause it produces a vector result (i.e., three numbers),this is also called the Vector Product7A Physical Interpretation of the Cross ProductˆsinAB AAˆBThis is important –memorize this phrase!mjb – September 5, 2014Oregon State UniversityComputer Graphics= How much of A lives perpendicular to the B direction^The Perpendicular Property of the Cross ProductABThe vector is both perpendicular to A and perpendicular to BCurl the fingers of your right hand in the direction that starts at A and heads towards B. Your thumb points in the direction of AxB.AAxB.The Right-Hand-Rule Property of the Cross Productmjb – September 5, 2014Oregon State UniversityComputer GraphicsAB8Cross Products are Not CommutativeABBA AxB. BxA.ABABmjb – September 5, 2014Oregon State UniversityComputer GraphicsCross Products are Distributive()()()ABC AB AC A Use for the Cross Product :Finding a Vector Perpendicular to a Plane (= the Surface Normal)Sn()()nRQSQmjb – September 5, 2014Oregon State UniversityComputer GraphicsQR9A Use for the Cross Product :Finding a Vector Perpendicular to a Plane (= the Surface Normal) –This is used in CG Lightingmjb – September 5, 2014Oregon State UniversityComputer GraphicsA Use for the Cross and Dot Products :Is a Point Inside a Triangle? – 3D (X-Y-Z) VersionS()()RQ SQnLet:QP()()nRQ SQ()()qnRQPQ()()rnSRPRmjb – September 5, 2014Oregon State UniversityComputer GraphicsR()()snQSPS(),(),()qr snn nn andnn-- -Ifare all positive, then P is inside the triangle QRS10Is a Point Inside a Triangle?This can be simplified if you are in 2D (X-Y)Sn(,)xxyyRSSRSR()()RSEPR RS-where:QP()(,)xxyyyyxxRSRSSR ()()EPSSQ-Similarly,and:mjb – September 5, 2014Oregon State UniversityComputer GraphicsR,,RSSQQREEEIfare all positive, then P is inside the triangle QRS()()()()SQQREPSSQEPQ QR--A Use for the Cross Product :Finding the Area of a 3D TriangleS12Area Base HeightQheight2gBase QRsinHeight QSmjb – September 5, 2014Oregon State UniversityComputer Graphics11sin ( ) ( )22Area QR QS R Q S Q      QR11Derivation of the Law of CosinesSqrQRs22QRs22QRs)()(2QRQRs -)]()[()]()[(2QSSRQSSRs -mjb – September 5, 2014Oregon State UniversityComputer Graphics)()(2)])([()])([(2QSSRQSQSSRSRs-Sqrrqs cos2222Derivation of the Law of SinesS)()()(*2 QRQSQRSArea qrQRQrssinBut, the area is the same regardless of which two sides we use to compute it, so:SqrRqsQrs sinsinsin smjb – September 5, 2014Oregon State UniversityComputer GraphicsDividing by (qrs) gives:sSrRqQ sinsinsin12Distance from a Point to a PlanePnˆdIn high school, you defined a plane by:Ax + By + Cz + D = 0It is more useful to define it by a point on If you want the familiar equation of the plane, it is:which expands out to become the more familiar Ax + By + Cz + D = 0xyz xyzx, y,z Q ,Q ,Q (n ,n ,n ) 0-Qthe plane combined with the plane’s normal vectormjb – September 5, 2014Oregon State UniversityComputer GraphicspyThe perpendicular distance from the point P to the plane is based on the plane equation:ˆdPQ n-The dot product is answering the question “How much of (P-Q) is in the direction?”. Note that this gives a signed distance. If d > 0., then P is on the same side of the plane as the normal points. This is very useful.ˆnWhere does a line segment intersect an infinite plane?P1nˆIf point P is in the plane, then:xyzxyzxyzP,P,P Q ,Q ,Q (n ,n,n ) 0-P0P01(1 )PtPtPQThe equation of the line segment is:mjb – September 5, 2014Oregon State UniversityComputer GraphicsyyyIf we substitute the parametric expression for P into the plane equation, then the only thing we don’t know in that equation is t. Solve it for t*. Knowing t* will let us compute the (x,y,z) of the


View Full Document

OSU CS 419 - Vectors

Download Vectors
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Vectors and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Vectors 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?