
Boost : 
From: Anatoli Tubman (anatoli_at_[hidden])
Date: 20010812 02:20:56
On Saturday 11 August 2001 08:05, Michael Kenniston wrote:
> 4) In between "units" and "dimensionality" there is a third distinct
> concept of "quantitytype". For example "radian", "mil_angle", and
> "degree_angle" are different units but have the same quantity type
> (plane angle) and are thus freely convertible. However "pure number"
> and "plane angle" are different types, even though they have the same
> dimensionality, and so should not be freely convertible. My intuition
> is that this concept would be very useful, but at this time I have no
> clear idea how to implement it (or even define it) correctly, so I'd
> rather concentrate on just getting dimensionchecking right to start
> with.
Why not implement this concept by allocating to angles their own
dimension slots (one for plane angles, another for spatial angles)?
And while we're at it, why not allow userdefined dimensions?
SI framework is nice and useful, but a good library can (and
IMHO should) go beyond and above it. Adding two masses together
always has *some* physical sense, but it may not have sense in
context of a particular application (kilogram of apples plus
kilogram of oranges = ?).
I fully understand that providing for userdefined dimensions is not
trivial, but it *is* doable. A SI units library could be then implemented
on top of an arbitrarydimension library.
Last but not least, a good library *must* allow for rational
powers, not just integer ones.
[Once upon a time I've implemented such a library, for my own amusement.
Complete with rational powers and arbitrary number of userdefined
dimensions. The developmend didn't go much beyond proofofconcept stage. If
you're interested, feel free to contact me.]
 anatoli at ptc dot com  opinions are mine
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk