|
-
Nov 30th, 2004, 11:09 PM
#9
After all these years I always thought vectors only represent Direction and Magnitude. Vector's mathamatically don't have position (Remember that vector's aren't points.) Vectors are made by subtracting two points in 3D space. That means that a Vector always has a head (Point2) and a tail (Point1, which is the origin of the vector.)
Like for example, let's say Point1 is located at (10,0,0) and Point2 is located at (30,0,0). When you create a vector, you always subtract Point2 from Point1. So that would mean:
V.X = P2.X - P1.X
V.Y = P2.Y - P1.Y
V.Z = P2.Z - P1.Z
V.W = 1
Calculating that, your vector is now (20,0,0) . To get the magnitude of it, you do this:
Sqr(V.X * V.X + V.Y * V.Y + V.Z * V.Z)
Using the value we have now, the magnitude is 20 (obviosly). Playing around with the Y and Z values would increase/decrese the magnitude.
Now saying that the vector is located at 20,0,0 wouldn't really make any sence mathamatically. It only represents Magnitude and Direction. The XYZ components of the vector were only needed to later be calculated for magnitude and direction.
Last edited by Jacob Roman; Nov 30th, 2004 at 11:13 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|