Advertisement

Direction and magnitude of a vector

Started by March 01, 2002 10:01 AM
3 comments, last by archon 22 years, 11 months ago
Ok, I''m wrapping my brain around vectors...and I have a question: A vector is 3 numbers, x,y,z, which taken together represent a single point in 3D space. How can direction and magnitude be derived from these 3 numbers? Are magnitude and direction derived from the 2 vectors used to derive the vector itself? If so, how am I supposed to know that? How does a vector keep this information by itself? tia for any tips, Archon
You are thinking of position vectors when you say "defines a point in space", which is true only for position vectors.

A 3D vector in cartesian form is a triplet, each value representing the length of the vector in each of the 3 cartesian axis. A position vector is one that starts from the origin ( sorta a contradiction in my eyes, as vectors aren''t supposed to have a position, but lets not bring that up again ), using what I said before, this means that at the termination of the vector that point has the same coordinates as the vectors deltas on each of the 3 axis...

There is an article coming up about all of this soon... ( Dave... )


Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Advertisement
Thanks for the reply, let me see if I can make sense of it...

You are saying that there are at least 2 types of vector, a position vector and a "A 3D vector in cartesian form".

The position vector assumes that it is pointing from the origin, and can be used to derive a new point in 3D space?

A cartesian vector is more general, and doesn''t fully make sense in my head yet. Am I right in assuming a cartesian vector has 3 values? What do these 3 values represent? And more generally, what does a cartesian vector represent?

Thanks again,
Sorry, I think I may have confused you further...

Vectors can be written in a few forms, one form is the "Cartesian" form of a vector, which is ( dx, dy, dz ). Each of the dx, dy and dz values says how long the vector is on each of the axis. Think of it as an arrow. Altering any of the values changes where the arrow points. This arrow can be anywhere, and it doesn''t matter ( the actual values will stay the same regardless of the position of the vector ). Position vectors start at the origin, and point to somewhere in space. Vectors can be used to simulate lots of things, mostly forces, velocity and displacement. So, for an example, you have a ball, this ball is moving and so has a velocity vector, which is the direction it is moving. This velocity vectors magnetude is it''s speed. This can be found using pythagorous.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
getting the magnitude of a vector. Square all of the components (x,y, and z), add those squares up, and then take the square root. Example (3,0,-4) sqrt(9+0+16) = 5, so the length is 5. Angle for 2d vectors is easy, but in 3d you''re going to need two angles. On angle will be around the axis that points up, the other angle will be with respect to the ground. You need to use inverse trig here, I think it is the arc tangent. There is a function: double atan(double d1, double d2) that does what you want, look in your math header. However you probably don''t really need angles as much as you think you do. You also need to learn about the dot product and cross product. I don''t mean just know the forumulas you have to get a fairly solid understanding. Or just make a 2d game, that''s what I''m doing.

This topic is closed to new replies.

Advertisement