
AMDG Brandon Olivares wrote:
I need to use the boost::units::atan2() function in boost/units/cmath.hpp, but am having trouble figuring out how. Do the units have to be dimensionless, or can they be any unit?
I have two variables, x_ and y_ which are of a scaled unit type, called light_second_unit. I'm calling it like this:
boost::units::atan2(y_, x_);
I get this error:
./physics/cartesian_coordinate_system/point.cpp:85: error: no matching function for call to `atan2(boost::units::quantity<boost::units::astronomical::light_second_unit, double>, boost::units::quantity<boost::units::astronomical::light_second_unit, double>)'
If it has to be dimensionless, how do I convert them to a dimensionless quantity?
The problem is that the library tries to determine the return type from the system. In this case, the system doesn't include a unit of angle, so the call fails. In Christ, Steven Watanabe