|
Boost Users : |
Subject: Re: [Boost-users] Boost-users Digest, Vol 3537, Issue 1
From: Rick Aurbach (rick_at_[hidden])
Date: 2013-08-15 12:16:31
Michael,
It sounds to me like you're making this altogether too complicated. Don't focus on the software; focus on the science.
The size of the "degree" unit is the same for Kelvin and Celsius. (I.e., if the temperature changes by 1 degree K, it changes by exactly 1 degree C.) The only this that is different between Kelvin and Celsius is the zero point. For Kelvin, 0 degrees is absolute zero and there are no negative values of temperature. (Well, that's not quite right, but you'll never encounter the exceptions.) For Celsius, 0 degrees is the freezing point of water at sea level. To convert between Kelvin and Celcius, just add or subtract a constant. That constant has a value of 273.15.
That is, you can make a dimensionally-safe conversion from Kelvin to Celcius by subtracting 273.15. Converting from Celsius to Kelvin by adding 273.15.
Cheers,
Rick Aurbach
Aurbach & Associates, Inc.
On Aug 15, 2013, at 9:24 AM, boost-users-request_at_[hidden]<mailto:boost-users-request_at_[hidden]> wrote:
From: Michael Powell <mwpowellhtx_at_[hidden]<mailto:mwpowellhtx_at_[hidden]>>
Subject: [Boost-users] [units] "Simple" conversion from Kelvin to Celsius
Date: August 14, 2013 2:39:56 PM CDT
To: "boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>" <boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>>
Reply-To: "boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>" <boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>>
Hello,
It's been a couple of years since I've done any work with Boost.Units,
and I am finding that I want to make a dimensionally-safe conversion
from Kelvin to Celsius.
I've got an I2C controller that reports in Kelvin, but I want to
report it to the end-user in Celsius.
The examples I am finding seem to "almost" fit the bill, but I am
having a difficult time extrapolating a sane conversion.
First, would help if I understood what the Boost.Units SI (my assumed
base-system) base-temperature units were. I gather Fahrenheit? Or is
it indeed Kelvin? I could be mistaken.
Thank you...
Regards,
Michael Powell
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net