
AMDG Damien R wrote:
I just discover boost::units and I want to know how it works in this case : quantity<si::plane_angle> angle(45 * degree);
When the constructor is called, is the argument converted in radian or not ?
The value is converted into radians.
Moreover, it is possible to have : quantity<??::plane_angle> angle(45 * degree); angle += pi / 4 * radian; cout << angle << endl; cout << quantity<degree::plane_angle>(angle) << endl; cout << quantity<radian::plane_angle>(angle) << endl; cout << angle.value<degree>() << endl; cout << angle.value<radian>() << endl;
output : 45 deg + pi / 4 rad
This is not possible.
90 deg pi / 2 rad
You would get 1.57..., not pi/2
90 1.57079632679
This can be done with quantity<degree::plane_angle>(angle).value() e.g.. In Christ, Steven Watanabe