
Boost : 
From: Matthias Schabel (boost_at_[hidden])
Date: 20031209 21:07:45
> I click on http://groups.yahoo.com/group/boost/files/YANL.zip
> and I get a yahoo groups page saying,
>
> "The requested file or directory is not found on the server."
Hmmm...it's working for me. Anyone else having problems?
> I got sources I wrote years ago for angle types and trig functions.
> My primary intent was speed, rather than portability, and most
> functions are implemented in MMX/3DNow! inline assembly :), but they
> work, and you might find useful stuff in them. I defined also a type
> of fixed.point arithmetic, mod 2pi angle type (that can accumulate
> angle differentials adinfinitum without losing precision) and that
> recomputes and caches sine and cosine values, for use with angles
> that seldom change, but often need trig values taken from.
As it stands, the library is capable of wrapping any wellbehaved
arithmetic type, so as long as those classes support the basic
operations necessary, it should be no problem to add the
zeroruntimeoverhead unit checking to them. See in particular the
implementation in measurement.hpp and its use in test_units.cpp for an
example.
> My question about angles was a bit philosophical, though: They use
> units (cycles, quartercycles, radians, degrees) but they are
> dimensionless. Are there any other such animals, besides angles?
I guess there is sort of a dichotomy of definitions. Formally, for
physical measurables, the seven basic quantities are length, mass,
time, quantity, temperature, current, and luminous intensity (or any
linear combination thereof). However, as you note, in practical
situations you may want to keep track of other things  the library
allows dimensional manipulations of arbitrary tag types for precisely
this reason. Angles are really a ratio of two lengths  the distance
travelled along a circular perimeter relative to the total perimeter of
the circle, as contrasted with, for example, solid angle which is the
ratio of two areas. In fact, if the universe was spherical, length and
angle would be interchangeable. Of course, you may also want to keep
track of things like quantity_apples/quantity_oranges  important if
you're a grocer even though they're technically not dimensionally
distinct...
Matthias


Matthias Schabel, Ph.D.
Utah Center for Advanced Imaging Research
729 Arapeen Drive
Salt Lake City, UT 84108
8015879413 (work)
8015853592 (fax)
8017065760 (cell)
8014840811 (home)
mschabel at ucair med utah edu
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk