# Boost :

From: Valentin Samko (boost_at_[hidden])
Date: 2004-11-06 19:25:40

NS> Mathematically speaking, a point in an n-space is a 0-dimensional entity.
NS> No vector in n-space has ever been described as a 0-dimensional entity -
NS> it's always of dimension n. Although both are identified by n coordinates,
NS> they are clearly different beasts.

That is very true if we consider an abstract point, but in that case,
operation pointA-pointB is undefined, just like pointA+pointB. Do you
have any examples of any classical spaces, where pointA-pointB is defined,
but pointA+pointB is not?

NS> Although a point in 3D at (3,4,8) could be represented by the vector (3,4,8)
NS> from the origin, this doesn't make the point and the vector the same thing.

This makes them almost the same thing. You can treat vector as a
point, and point as a vector. Besides, we are talking about R^2,
which is a vector space.

NS> In almost all of the computer graphics literature I have read, points and
NS> vectors are not treated uniformly. Computer graphics uses a number of
NS> spaces: affine, projective, and Grassmann. I suggest reading the following
NS> brief introduction to the use of coordinate systems in computer graphics:

Do you really care about non Euclidean spaces, considering a GUI library? :)
Everything I said in this thread is only related to R^n spaces. I
think it is pointless to consider anything else for a GUI library.
Also, if we only consider a vector space R^n, are you saying that a
point in a vector space R^n is not actually a vector?

>> Now, there might be completely different reasons for treating points
>> and sizes differently in a C++ program, and that would be the type
>> safety. But if we go in this direction, we might as well introduce a
>> type for velocity, to be able to do something like this:

NS> That's a red herring.

It is nice/polite of you to quote several lines of text and call it all
a red herring. Type safety is actually is an important reason to distinguish
Point and Size classes, so that if you use one instead of another,
you program just wouldn't compile (and making it easier to read too).

Valentin Samko
http://val.samko.info