
Boost : 
From: Dan W. (danw_at_[hidden])
Date: 20031211 02:11:31
First I would like to apologize for having started this debate over radians
and degrees, I did so deliberately, and now I halfregret it. My sneaky
intention was to sneakin a math sublayer under the units library. I only
halfregret it because I do feel it needs considering, if not
addressing; but I do halfregret it because I should have just said so,
rather than inject a philosophical monkeywrench.
In math there are dimensionless units routinely. The base of imaginary
numbers, as well as the bases of hyperimaginary numbers, for instance. 1
and 1j are both dimensionless, and yet they are distinct 'units'. In a
financial application, taking an even root of a negative number may be
meaningles, yet in a physics context it may be meaningful. Same goes for
logarithms of negative numbers. Same goes for factorials of real numbers.
Taking the derivative of order 2.666.. of a function may mean nothing in
one context, but fractional differintegration, as it is called, has its
applications.
If we were to ask the units library to deal with all these issues, we might
as well kill it. It can't, and it's outside the scope of what it was meant
to deliver, namely to make sure I don't add seconds to millimeters, and
assign the result to inches. If this library can simply do this, it will
revolutionize programming.
If we ask of it that it ensures that proper numbers be fed to inverse trig
functions, there will be no end to the growth in requirements. Degrees and
Radians are in the scope of math, not of physical units, and if the units
library offers a Degrees type, it should do so "For Entertainment Purposes
Only", IMO. There needs to be a comprehensive tackling of math issues,
eventually, but that should be the job of a math layer, between the
hardwareabstractionnumerical layer, and the physical units layer.
Re.: Degrees/Radians: I agree with Matthias Schabel philosophically, and
with Walter Landry in practical terms: Philosophically, both Radians and
Degrees are *units* of angle, and both are equally dimensionless. One is
more "natural" than the other, but this esthetic difference in no way
amounts to a semantic distinction. In practise, however, I think that
Walter is quite right not wanting Radians to be a formal unit, for, even if
we stress the dimensionlessness of Radians, if they are anything at all,
in programming terms, the are a type. If they are a type, but they need to
be assignable from AND assignable to nonRadian dimensionless numbers,
we'll just get redundant conversion errors, and their existance is
meaningless. Thus, in practical terms, I'd say that only Degrees should be
a unit, if any angle units were provided at all; and whose only
raisondetre would be to multiply themselves by pi/180, return a float and
die. I wouldn't even give them participation in a units system at all, and
I'd probably program them in assembler as symbolic of their type being a
temporary hack to get rid of ASAP ;)
Cheers!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk