
On 2010-01-04, Steven Watanabe wrote:
AMDG
Matthias Schabel wrote:
I think we should probably have functions that return angles default to radians if not otherwise specified in the system. To my mind, that is consistent with the principle of least surprise and is consistent with existing library functionality... While the above solution should work and is consistent, it requires more understanding of Boost.Units than should be necessary for simple use of inverse trigonometric functions.
Yeah. That makes sense.
I ended up doing something like the following to get it to work. Please let me know if there is a better way. template<class Length> template<class Angle> physics::cylindrical_coordinate_system::point<Length, Angle>& point<Length>::to_cylindrical() const { static physics::cylindrical_coordinate_system::point<Length, Angle> cylindrical( boost::units::sqrt(boost::units::pow<2>(x_) + boost::units::pow<2>(y_)), static_cast<boost::units::quantity<Angle> >( boost::units::atan2( static_cast<boost::units::quantity<boost::units::si::dimensionless> >( y_.value()), static_cast<boost::units::quantity<boost::units::si::dimensionless> >( x_.value()))), z_ ); return cylindrical; } // to_cylindrical I didn't quite understand what you were getting at before. light_second is a measure of length, so I didn't want to include a measure of angle in it. Thanks, Brandon
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Brandon www.creatorspiritus.com Blog and forum discussing living a Christ-centered life Follow me on Twitter: http://twitter.com/devbanana