Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::units - converting from one derived_dimension to another across systems (imperial to metric)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-11-19 18:36:01


AMDG

On 11/16/2018 05:27 AM, Matt Vinson via Boost-users wrote:
> Thanks for input...Ok, I have errors creating a 'lineal force unit'.
> In our branch of engineering, we have kips****/ft, kips/in, lbs/foot, lbs/in, kN/meter, Kn/cm, KN/mm, N/meter, N/cm, N/mm, Metric Ton/meter, Metric Ton/cm, Metric Ton/mm, KiloGram/meter $, KiloGram/cm, KiloGram/mm, etc....All these units* are loosing force divided by length.
> After all the appreciated input in this thread, I thought I'd try this but it does not compile*** probably because force is "L M T^-2" and length is "L" which is not correct:        //Lineal Force
>         typedef boost::units::derived_dimension<
>             boost::units::force_dimension, 1,
>             boost::units::length_dimension, -1
>         >::type lineal_force_dimension;
>

derived_dimension works with the base_dimensions not a dimension list.
Use either:

boost::units::derived_dimension<
  boost::units::mass_base_dimension, 1,
  boost::units::time_base_dimension, -2>::type

or

boost::mpl::divides<
  boost::units::force_dimension,
  boost::units::length_dimension>::type

> How can I use Boost.Units to convert one force/length to another force/length: say, lb/in to, say, kg/m?
> *not Boost.Units**, the units in the engineering math equation**A set of base units raised to rational exponents, e.g. m^1, kg^1, m^1/s^2.
> *** ...\boost_1_68_0\boost\mpl\aux_\preprocessed\plain\less.hpp(20): error C2039: 'value': is not a member of 'boost::units::detail::dimension_list_tag'
> <snip>>

In Christ,
Steven Watanabe


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