Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a 3D Vector and how does it differ from a 3D point?

Does a 3D vector differ from a 3D point tuple (x,y,z) in the context of 3D game mathematics?

If they are different, then how do I calculate a vector given a 3d point?

like image 793
Robin Rodricks Avatar asked Oct 12 '10 10:10

Robin Rodricks


2 Answers

The difference is that a vector is an algebraic object that may or may not be given as the set of coordinates in some space. (thanks to bungalobill for correcting my sloppiness).

A point is just a point given by coordinates. Generally, one can conflate the two. If you are given a set of coordinates, and told that they constitute a 'point' with no further information (choice of basis, etc), then you can just hand that set of numbers back and legitimately claim to have produced a vector.

The largest difference between the two is that it makes no sense to do things to one that you can do to the other. For example,

  1. You can add vectors: <1 2 3> + <3 2 1> = <4 4 4>
  2. You can multiply (or scale) a vector by a number (generally called a scalar) 2 * <1 1 1> = <2 2 2>

  3. You can ask how far apart two points are: d((1, 2, 3), (3, 2, 1) = sqrt((1 - 3)2 + (2 - 2)2 + (3 - 1)2) = sqrt(8) ~= 2.82

A good intuitive way to think about the association between a vector and a point is that a vector tells you how to get from the origin (that one point in space to which we assign the coordinates (0, 0, 0)) to its associated point.

If you translate your coordinate system, then you get a new vector for the same point. Although the coordinates that make up the point will undergo the same translation so it's a pretty easy conflation to make between the two.

Likewise if rotate the coordinate system or apply some other transformation (e.g. a shear), then the coordinates and vector associated to the point will also change.

It's also possible for a vector to be something else entirely, for example a bounded function on the interval [0, 1] is a vector because you can multiply it by a real number and add it to another function on the interval and it will satisfy certain requirements (namely the axioms of a vectorspace). In this case one thinks of having one coordinate for each real number, x, in [0, 1] where the value of that coordinate is just f(x). So that's the easiest example of an infinite dimensional vector space.

There are all sorts of vector spaces and the notion that a vector is a 'point and a direction' (or whatever it's supposed to be) is actually pretty vacuous.

like image 138
aaronasterling Avatar answered Sep 19 '22 13:09

aaronasterling


A vector represents a change from one state to another. To create one, you need two states (in this case, points), and then you subtract the initial state from the final state in order to get the resultant vector.

like image 36
Ignacio Vazquez-Abrams Avatar answered Sep 18 '22 13:09

Ignacio Vazquez-Abrams