|
Boost : |
From: Hubert Holin (Hubert.Holin_at_[hidden])
Date: 2004-11-08 05:16:07
Somewhere in the E.U., le 08/11/2004
Bonjour
What Reece described is the difference between a vector space and
an affine space. A vector space has one "special" element, the zero
vector, whereas an affine space has none (every point is equivalent to
every other). You *have* to choose one point in an affine space and
label it as the "origin". There is (intrinsically) no way to choose such
a point canonically. The confusion (that there is some magical way to
choose the origin) comes from the fact that a vector space can *also* be
endowed with an affine space structure (usually, but not necessarily, by
choosing the zero vector as the origin). Likewise, one can derive a
vector space from an affine one, but both are conceptually, and
practically, two very different beasts. "Point+Point" is meaningless,
"Point+Vector" is meaningful.
Hubert Holin
In article <1852440446.20041105235430_at_[hidden]>,
Val Samko <boost_at_[hidden]> wrote:
> RD> MFC gets the intended use of CPoint/CSize wrong.
>
> RD> In a mathematical sense, a point is a 0-size location in an nD
> RD> coordinate system. In this case, it is a 2D coordinate system, so is
> RD> (x,y). This is used for positioning, e.g. moving the graphics cursor, so
> RD> I call it gui::position. It does not make sense to perform point [+-*/]=
> RD> point since points are locations in a space (how do I add the location
> RD> of my house to the location of Jupiter)?
>
> I do not follow your logic. In mathematics, in Cartesian nD coordinate
> system, a point is represented by a set of distances between that
> point and the centre of coordinates, along each axe. Just like a vector.
> And vectorA + vectorB is a very common operation.
>
> RD> The size type stores width and height information, so it can be treated
> RD> as a 2D vector. In this case, standard arithmetic operations make sense.
> RD> Also, it is possible for sizes to interact with points, e.g. point +=
> size.
>
> Once again, in geometry, vector and point are practically the same thing.
>
> RD> If you do point - point, then the resulting type is a size type that
> RD> represents the distance between the two points.
>
> Just like size - size.
>
> RD> So in a mathematical sense, the difference between size and position is
> RD> entirely relevant, it's just that some libraries (not mentioning names)
> RD> do not adhere to the above mathematical rules.
>
> There are no mathematical rules, which say that a point in nD
> Cartesian coordinate system is not just a set of corresponding
> distances along each axe.
>
> Valentin
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk