Skip to main content
gamedev.net
🔒 Locked

A vector question???

Started by programering 4 replies 500+ views
Original Post
programering
programering
Is a vector defined by the difference/delta in the x, y and z axis? Or is it the length, the distance between two points? Or the first point being the origin (0,0,0) and the other point specifyed by x, y and z. Or i, j and k are the delta in x, y and z? If you can make it clear for me. Thanks! ------------ Poo Fighters Good Harlot CPU Burnout ------------------------------- Anton Karlsson Klingis Entertainment Games with silly humor Aleph One (Marathon Open Source) | My Homepage Packa bajs med winzip! Just dreaming wont make you (more) skilled in game programming/development.
shmoove
shmoove
A vector is an n-tuple of numbers. What the vector represents is up to the context it is used in. It could mean a point in space relative to a certain origin, or a direction in space, or something completely unrelated.

shmoove
teamonkey
teamonkey
quote:
Original post by programering
Is a vector defined by the difference/delta in the x, y and z axis?

Yes.

quote:

Or is it the length, the distance between two points?


No.

quote:

Or the first point being the origin (0,0,0) and the other point specifyed by x, y and z.


Yes.

quote:

Or i, j and k are the delta in x, y and z?


Yes.



All correct. A vector is the displacement between two points. It is not the distance, which is the length of the vector. It can be specified as the length and the direction of the vector, or in terms of the delta in x,y,z, or in a number of other terms.

i,j,k are generally assumed to be the unit vectors (length==1.0) for the x,y and z axes. You''d normally assume that i,j,k were perpendicular to each other for "normal" cartesian space (that is, you can take the cross product of i and j to find k, j and k to find i, and i and k to find j*. There are certain reasons why this might not be the case, but that''s a different matter entirely.

* Yes, I know that the result might be a negative vector, but I can''t remember which ones off-hand.
[teamonkey] [blog] [tinyminions]
alvaro
alvaro
For us mathematicians, vectors are things that can be added, substracted and scaled (multiplied by numbers).

In particular, n-tuples of numbers are vectors, because you can do all those things to them. In the context of game programming, you are unlikely to see any other types of vectors.
shmoove
shmoove
Being a former (read: never graduated) mathematician, I was tempted to give a similar answer. But I figured since we''re on a programming board, I stuck to the general "programmer''s meaning" of a vector. But the point remains that the "meaning" of the vector depends on the context it is used. They could be used to store the eulerian rotation angles of the camera, and also the carthesian location of the camera.

shmoove
dmounty
dmounty
A vector is, in general, a member of a vector space (strictly defined, check out mathworld if you feel like it) over any field. In abstract algebra.. it is common to consider spaces of functions (often polynomials) as infinite dimensional vector spaces, and in such a context... arbitrary polynomials are vectors .

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.