Boost logo

Boost Users :

Subject: Re: [Boost-users] [Units] How do you declare a plane angle to be dimensionless?
From: Matthias Schabel (boost_at_[hidden])
Date: 2011-12-06 14:57:18


> I am trying to figure out how to declare a plane angle to be
> dimensionless. In the code I have so far I am using:
>
> typedef boost::units::make_system<radii_base_unit,
> minute_base_unit,
>
> boost::units::angle::radian_base_unit >::type
> myproject_system_t;
>
> I have one velocity in radii^1.5/min and a second velocity in
> radian/min. When I divide the radii^1.5/min by radian/min I am
> expecting to see radii to be the final dimension. What I am seeing is
> the denominator has radians in it. Here is my equation
>
> ke = radii^1.5/min
>
> n = radian/min
>
> a1 = ( ke / n ) ^ (2/3)
>
> The 'min' dimension cancel out so I am left with radii^1.5/radian
> before applying the power of 2/3. Applying the power of 2 I see the
> units are radii^3/radian^2 and then the 1/3 to get a final of
> radii/radian^(2/3).

This is clearly not dimensionally correct, so the library is doing what is promises...
Your quantity in radian/min is not a velocity, it is an angular velocity. Somewhere your equations are
implicitly assuming that the object is moving on (probably) a circular trajectory of
known radius. In that case, the velocity is n * x where x is the radius in question (which
has units meters/radian.

> According to the almighty Wikipedia the radian angle is a
> dimensionless term. I am wondering what is the recommended course of
> action I should be taking here?

Either deal correctly with radians as units or just use a bare value_type for them.

Matthias


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