
Boost : 
From: David Abrahams (dave_at_[hidden])
Date: 20030427 07:55:45
These are my (only slightly informed) opinions. I've heard Walter
Brown talk about angle in this context, which was a big influence.
Terje Slettebø <tslettebo_at_[hidden]> writes:
> Regarding this angle dimension, should it be treated like the other
> SIdimensions? That is, say that you represent an SI quantity/unit
> with an integer vector giving the exponents:
>
> template<int kg,int m,int s,int A,int K,int mol,int cd,int angle>
> class quantity;
>
> If you multiply two quantities, you multiply the value and add the
> exponents, so quantity<0,1,0,0,0,0,0,0>(10) * quantity<0,1,0,0,0,0,0,0>(10)
> = quantity<0,2,0,0,0,0,0,0>(100) (m * m = m^2)
>
> Would this hold for angle, as well?
Yes. Angle is a dimensionless scalar (length/length). All its
exponents are zero.
> That is, does it make sense to say angle * angle = angle^2?
Probably not, but only because angle * angle doesn't make much
sense. Does that ever come up in real life?
> I understand that e.g. angle/s (angular velocity) makes sense, but
> should a library allow any combination with angle and the other
> dimensions?
Not arbitrarily:
angle(pi/2) / mass(40); // OK
angle(pi/2) + mass(40); // error
 Dave Abrahams Boost Consulting www.boostconsulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk