Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::units - converting from one derived_dimension to another across systems (imperial to metric)
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2018-11-15 15:49:22


On Thu, Nov 15, 2018 at 10:29 AM Damien Hocking via Boost-users
<boost-users_at_[hidden]> wrote:
>
>
>
> > On Nov 15, 2018, at 8:18 AM, Steven Watanabe via Boost-users <boost-users_at_[hidden]> 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.
> >
> >> *.h--------------------------------------------------------------------------------
> >> namespace dimensional_analysis {
> >> namespace lineal_force { //lb/in
> >> typedef boost::units::derived_dimension<
> >> boost::units::us::pound_force_base_unit, 1,
> >> boost::units::us::inch_base_unit, -1
> >> >::type lb_per_inch_dimension;
> >
> > units are not dimensions. You can't use
> > derived_dimension with base_units.
> >
> >> <snip>
> >>
> >
> > In Christ,
> > Steven Watanabe
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > https://lists.boost.org/mailman/listinfo.cgi/boost-users
>
> There is technically a kilogram force unit, kg-f or kilopond. I don’t know if that’s in Units though.

That, or, if memory serves, you need to factor out gravitational, or
whatever other force, is being masked by the lb.

Cheers...

> Damien
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users


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