Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::units - converting from one derived_dimension to another across systems (imperial to metric)
From: Richard Damon (Richard_at_[hidden])
Date: 2018-11-16 13:31:12


On 11/16/18 4:57 AM, Leon Mlakar via Boost-users wrote:
> On 15.11.2018 17:27, Michael Powell via Boost-users wrote:
>> On Thu, Nov 15, 2018 at 11:11 AM Roger Leigh via Boost-users
>> <boost-users_at_[hidden]> wrote:
>>> On 15/11/2018 15:18, Steven Watanabe via Boost-users wrote:
>>>> AMDG
>>>>
>>>> On 11/14/2018 05:04 AM, Matt Vinson via Boost-users wrote:
>>>>> I am having trouble converting from one derived_dimension to another across systems (imperial to metric). I'd like to convert, say, lb/in to, say, kg/m. I thought I would do the following but get a compiler error #:
>>>> It's not going to work. lb is a unit of
>>>> force, but kg is a unit of mass. They are not
>>>> compatible and there is no conversion between
>>>> them.
>>> lb·f (foot-pounds) is force; lb is mass.
>> No, lb-f is a unit of Torque. lb is a unit of Force.
>>
> Hmm, that pound is primarily unit of force is a news to me. The
> following is from the UK's Weights and Measures Act 1963:
>
>
> "The yard <https://en.wikipedia.org/wiki/Yard> or the metre
> <https://en.wikipedia.org/wiki/Metre> shall be the unit of measurement
> of length <https://en.wikipedia.org/wiki/Length> and the pound or
> the kilogram <https://en.wikipedia.org/wiki/Kilogram> shall be the
> unit of measurement of mass by reference to which any measurement
> involving a measurement of length or mass
> <https://en.wikipedia.org/wiki/Mass> shall be made in the United
> Kingdom; and- (a) the yard shall be 0.9144 metre exactly; (b) the
> pound shall be 0.45359237 kilogram exactly."
>
> To my knowledge, the US still adhere to 1894's update to Mendenhall
> Order which defined  that there shall be 2.20462234pounds to a kilogram.
>
> On the other hand, lbf is often used to denote "pound force" unit,
> with 1 lbf being approximately 4.448N or 0.454 kp.
>
> So Boost.Units should then not be used for cooking recipes as the
> conversions from pound based to gram based quantities would only work
> on Earth?
>
> Cheers,
>
> Leon
>
In Common, and legal, usage, the Pound represents both a mass unit and a
Force unit, a pound of food is mass, in a pound/sq-in it is a force. In
scientific uses, one shouldn't use the base pound unless it is totally
obvious which one is being used, but instead you use the units of
pound-force or pound-mass, lbf (not lb-f) vs lbm,

Boost, since it can't know which one is being used, as the context will
never be obvious to the compiler, probably should not have a raw lb
unit, but only lbf and lbm.

-- 
Richard Damon

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