Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2004-01-05 07:31:43


Alan Bellingham wrote:
> Daniel Frey:
>
>
>>Wait! I think the above mixes up some important concepts. Look at this:
>>
>>length <-> meter
>>time <-> hour
>>speed <-> mph
>>frequency <-> hertz
>>
>>I hope you see what I mean. 'hertz' is IMHO totally different than
>>length, time or speed.
>
>
> Only in that frequency is the inverse of period - and is therefore a
> 1/time unit.
>
> length <-> meter
> time <-> second
> speed <-> meters/second
> frequency <-> /second
>
> When you're doing dimensional analysis, you may multiply a length by a
> frequency to get a speed - for example, the wavelength of a particular
> radio band times its frequency should give you the speed of light.

Of course, but that's not a contradiction of what I said above. It just
shows that there is more to a unit-library like relationship. To make
this clear:

speed = length/time

(which you can't use that way directly, as C++-types don't work that
way) and

mph = mile/hour

The former can probably be written like this:

typedef divide< length, time >::type speed;

But I have to admit that I haven't put enough thinking into units so
far. I'd like to finish the constant libraries first (I'm working on the
documentation) before having a closer look at units. As I said already,
I think that meter, second and hertz are constants, so I think that
there is also a connection between the two fields...

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial solutions & technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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