distance between vectors

Started by
23 comments, last by angry 20 years, 5 months ago
And of course we can define a metric on any set using the discrete metric,

d(x,y) == 0 if x=y
d(x,y) == 1 if x!=y

and the sets don''t have to contain numbers at all. The discrete metric is useless in practice though (e.g. limits of sequences only defined for sequences which reach the limit and stay there).
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Advertisement
quote:Original post by LilBudyWizer
Just curious how you would define distance? Personally I would call distance a measure of how close two values are to one another. Also if a point is a position vector then how can there be a distance between points, but not vectors since a point is a vector.


Well, you''d find the vector that connects the two end points of the two position vectors. That''ll give you the displacement, find the magnetude of the displacement to find the distance.

Personally, I consider a point an abstract concept that can be accurately modelled using a position vector.

quote:
Vectors do not even have to contain numbers


So, what, a 0 dimensional vector? Sounds pretty useless to me. How can a vector contain no numbers?

You have to remember that you''re unique, just like everybody else.
If at first you don't succeed, redefine success.
Distance between two points (you''ll need to get actual positions to work with from the vectors):

distance = sqrt( ((x1-x2)*(x1-x2)) + ((y1-y2)*(y1-y2)) + ((z1-z2)*(z1-z2)) );

I am in the school of thought that points and vectors are different things. Look up "Affine Space" for the precise mathematical description of the relationship between points and vectors.

In practice, they both look like a list of numbers, like (1,4,-3). The difference is in the operations that you can perform with them. You can:
- add two vectors, getting a vector
- multiply a vector by a number, getting a vector
- add a point and a vector, getting a point
- substract two points, getting a vector
- compute the weighted average (or baricenter) of several points, with weights that are numbers whose sum is 1, getting a point.

If you use real numbers and on top of the affine structure you have a positive definite quadratic form (a metric) then we are in the realm of "Euclidean Space".

To find the distance between two points, substract them (you get a vector) and find the size of the vector, using your metric. If you represent your points using a orthonormal reference (which you probably do), then it boils down to the formula that everybody knows.

quote:Original post by python_regious
quote:
Vectors do not even have to contain numbers


So, what, a 0 dimensional vector? Sounds pretty useless to me. How can a vector contain no numbers?

The set of continuous functions is a vector space, therefore any continuous function is a vector in this vector space. For a set to be a vector space, certain rules have to be met, and functions can meet these requirements, and can therefore be considered vectors in a vector space.

To build a vector space, you need base vectors. The vectors in the identity matrix of size NxN (for scalar vectors) are orthogonal and spans an N-dimensional vector space. Sine-waves on the range [-Inf, Inf] of different frequencies, and Legendre polynomials on the range [-1, 1], are orthogonal and can be used to span an infinite-dimensional vector space.
quote:Original post by Brother Bob To build a vector space, you need base vectors.

Actually, you don''t. 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. A base does exist, indeed, provided that we accept the axiom of choice. But you don''t need to know one to build a vector space.
Is a base vector the equivalent of the mapping function described in the axiom of choice, but for many dimensions?
Hang on, continuous functions are vectors? I''m confused now, I''m thinking of vectors as the derivation from hypernumbers...

You have to remember that you''re unique, just like everybody else.
If at first you don't succeed, redefine success.
I could be wrong, but I don''t think contineous functions are a vector. Rather they are a vector space and a specific function is a vector within that vector space.
Keys to success: Ability, ambition and opportunity.
quote:
In practice, they both look like a list of numbers, like (1,4,-3). The difference is in the operations that you can perform with them. You can:
- add two vectors, getting a vector
- multiply a vector by a number, getting a vector
- add a point and a vector, getting a point
- substract two points, getting a vector
- compute the weighted average (or baricenter) of several points, with weights that are numbers whose sum is 1, getting a point.


Yes, you using the term ''vector'' as the semantic definition of offset-vector from an origin. If you really think about it, points are offset-vectors but just from the origin (our 3d space reference point). 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...

But I prefer to think of vectors as just arrays, not without any semantic meaning behind them.
do unto others... and then run like hell.

This topic is closed to new replies.

Advertisement