## Incongruent hash

Andreas Raab raab at isgnw.cs.Uni-Magdeburg.DE
Wed Feb 11 15:33:31 UTC 1998

```I actually didn't want to get into this discussion but I can't resist any
longer...

> But a point IS a location.

No. What we usually call a "point" is actually an element of a
2-dimensional vector space (i.e. a 2-dimensional vector). A vector space,
however, is defined as an algebraic structure V(+,*,K) with K(+,*)
being a field (for those who don't know: a field is another algebraic
structure) and a couple of associated operations. In particular, the
operation "*" needs to be defined  for all elements in K and V with a
number of conditions such as associativity etc.

_That_ is a point. The above definition means in particular that you can
build vector spaces (i.e. _points_) over arbitrary algebraic structures
not just numbers (during my math lectures we often used polynomal or
function spaces).

This opens two interesting questions: First, how closely should class
Point resemble math definitions? I personally think that it should be as
close as possible. The only well-known interpretation of a point is
the mathematic one. To give an example it took me a couple of hours to
find out that "0 at 0 + 1" yields "1 at 1" in VW. This operation is just not
defined in mathematics - why should I assume that PPD (or whoever) thinks
that they have to re-define mathematics in their own way? In my
understanding, the addition of a point and an integer should result in an
error. If I really need such an operation (although I don't see any
reason for this), I can easily add the method Point>>sumToAllElements:
or whatever I need there.

I'm now getting back to the actual question of this thread. Can we compare
two points? Yes we can, but there are several interpretations none of
which has any natural math background. One can compare points such as it
is done at the moment, although there is no much use for it besides _very_
few graphics operation. I, for instance, don't see a big deal in rewriting
Rectangle>>containsPoint: not to use "<" or ">". Then, there is the notion
of length which could also be used for points. One could define "a < b"
holds if "a length < b length". Although there isn't much practical use
for it it _can_ be defined as such and that's the whole point I'm trying
to make.

Coming back to class Point, my feeling is that the relations "<" and ">"
shouldn't be defined and that other operations such as "+" or "-" should
be defined as maths does it. Only math gives you an intuitive meaning of
the above operations and if these operations are not uniquely defined in
maths they should not be defined in the class library. If, however, we
need such methods (because of its signatures) then we should clearly
state what happens (now tell me where I do find that "0 at 0 + 1 = 1 at 1" in
VW).

Andreas
--