Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2007-03-07 11:44:38


> On the other hand, a point is not a very interesting object. For
> example, can points be added or multiplied with a scalar? Strictly
> speaking, that makes sense only for distances, i.e. vectors.
>
> You're right, there is a difference between points and vectors. A
> point,
> for example, has a dimension of zero, while a vector has always a
> dimension of one, regardless what the dimension of the vector space
> is.
> (So when talking about a three-dimensional vector, we're actually
> talking about a one-dimensional object in a three-dimensional space.)
> But this distinction is hardly ever made in mathematics, unless in
> introductions and maybe in very special discussions. Typically a point
> and it's position vector are treated synonymously, so I wonder if we
> really need to make the distinction here? We could cleanly separate
> both

This issue also arises in the context of unit conversions. A salient
example
is the case of converting between temperatures in Fahrenheit and those
in Kelvin :

How do we convert 32 degrees Fahrenheit to Kelvin?

If we are talking about absolute temperatures (points), then the
correct expression
is

Absolute temperature (K) = (Absolute temperature (F) - 32)*5/9 +273.15

However, if we're talking about temperature differences (vectors),
then the
correct expression is

Temperature difference (K) = Temperature difference (F)*5/9

The same issue arises in times (time point vs. time difference). It
is unfortunately
very difficult to come up with a completely generic solution to this
problem - you
can define an algebra that behaves sensibly on points and vectors,
which for
many applications will be fine. This sort of value type will also
work with our
units library. However, in order to correctly implement conversions,
the unit and
the value type become entangled. It is possible to do this by
specializing the
quantity conversion helper, but requires separate specializations for
each unit
having affine conversion factors (demo coming).

Matthias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk