distance between vectors

Started by
23 comments, last by angry 20 years, 5 months ago
quote:Original post by FReY
Yes, you using the term ''vector'' as the semantic definition of offset-vector from an origin.

The terminology I am using is the standard for Affine Space.
http://mathworld.wolfram.com/AffineSpace.html

quote:
If you really think about it, points are offset-vectors but just from the origin (our 3d space reference point).

I guess what you mean is that once you select a point as origin (which is an arbitrary selection), you can represent a point by the vector that you have to add to the origin to get it. True, but doesn''t change anything I said.

quote:
It is easier to conceptualize your rules written as follows:

- add 2 direction vectors, getting a direction vector
- multiply a direction vector by a scale, getting a scaled direction vector
- add a position-vector and a direction-vector, getting a position-vector
etc...

You can come up with a new language if you want, but "point" and "vector" are the standard ways of saying it. On top of that, I would not like calling points "position-vectors", because the word "vector" implies that those things can be added and multiplied by scalars, which is not true of points.

quote:
But I prefer to think of vectors as just arrays, not without any semantic meaning behind them.

I can see that. In practical terms, there are good arguments for and against having separate classes for points and vectors.
FOR:
- It more closely reflects the mathematical structures that we are using.
- It prevents some mistakes in compile time (adding two points will give an error, as that operation is undefined).
AGAINST:
- Expressions like "midpoint = .5*(point_A + point_B);" are not allowed, although the result is perfectly well defined. You would have to re-write that as "midpoint = point_A + .5*(point_B - point_A);", which is probably a little slower to evaluate.

Advertisement
Of course points (position vectors) can be multiplied/divided by scalars or other vectors... Adding a position vector to another is just as valid and common. What else are you doing when you''re translating or rotating or scaling a 3d object? A transformation matrix is merely a convenient way to package together the vectors and scalars you''re adding and multiplying with.

Related to the original post, "distance" or difference between two (classical) vectors can also be a very useful concept. For example, in orbital mechanics you will often see people talking about "delta-v" which is the difference between two velocity vectors usually measured in m/s and calculated as |v2-v1| .
quote:Original post by alvaro
Functions that map real numbers into real numbers form a good example of a vector space for which it is very difficult to find a base.


Quite a few bases exist. That''s the theoretical fundation for Fourier transforms, Laplace transforms, wavelet transforms, Z transforms and many more (Mellin, Hankel, Gabor...)

Each of these transformations really is a function decomposition onto a specific orthonormal base of R->R (or C->).

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Fingers_
Of course points (position vectors) can be multiplied/divided by scalars or other vectors... Adding a position vector to another is just as valid and common. What else are you doing when you''re translating or rotating or scaling a 3d object? A transformation matrix is merely a convenient way to package together the vectors and scalars you''re adding and multiplying with.

When you translate or rotate or scale a 3d object you are applying an affine transformation, which a well defined operation. What I mean by "well defined" is that if your transformation does not depend on your choice of coordinates.

In a translation, you are adding a point and a vector, and you get a point. That was one of the allowed operations.

Multiplying by a scalar is not a well defined operation. If you change the origin, you get a different transformation.

quote:Original post by Fruny Quite a few bases exist. That''s the theoretical fundation for Fourier transforms, Laplace transforms, wavelet transforms, Z transforms and many more (Mellin, Hankel, Gabor...)

Those are not really bases of the vector spaces. It is not true that any function can be expressed as a linear combination of a finite number of members of the base.

All your proposed "bases" are numerable. A base of the set of continuous real functions, for example, cannot be numerable. The functions F_a(x) = |x - a|, where a is a real number, form a linearly independent set. Any linearly independent set can be expanded to form a base, so there is a base that is not numerable. And all bases have the same cardinal.

Based on the OPs very simple question, this discussion is waaaaaay off topic. As people have stated, yes... a vector space is a member of any member of a vector space see here for more details. You cannot really call points postitional vectors, as a many "normal" spaces would not necessarily fulfill the criterion of being a vector space. It is true however that most "normal" spaces are subsets of some vector space. As for bases, any vector space can have a basis, whether this basis is finite of not, is another matter entirely. I suspect the OP just wanted confirmation that their formula for distance between two Verticies formula was correct... which is was, so to the OP, You are correct .

PS: A vector space can be made over any field, and hence they are VERY general constructs. All you need is to fulfil the vector space criterion, and away we go. I think we should all assume that when someone says vector, unless otherwise specified... they mean a (1,2,3 or 4 dimensional usually) vector over the reals. If they want to refer to STL vectors (which are abstract vectors, over the template classes field) then they should qualify it. Just a suggestion, to try and cut down on ambiguity in future.

This topic is closed to new replies.

Advertisement