Using this:
#include ();
set_from_radian<0>(p, atan2(y, x));
set_from_radian<1>(p, asin(z));
return true;
}
Here you see asin(z) . asin() requires the argument to be [-1,1]
(http://www.cplusplus.com/reference/clibrary/cmath/asin/). However,
this should just be the z component of any Cartesian point right? Is
there some restriction on the input Cartesian point to
cartesian_to_spherical_equatorial2 (and hence the
from_cartesian_3_to_spherical_equatorial_2 strategy)?
I see a restriction on from_cartesian_3_to_spherical_polar_2:
\note If x,y,z point is not lying on unit sphere, transformation will
return false
but I don't see the same restriction on
from_cartesian_3_to_spherical_equatorial_2. Additionally, it doesn't
seem to just be a missing comment because the transform() call
actually returns true even though this point is not on the unit
sphere. If I normalize the point and call the function:
CartesianType cartesian(-0.94862, -0.22167, -0.22580);
The conversion seems to work successfully, and the call still returns true.
Any thoughts? Is this a bug? If not, why is the function not returning
false? And better, shouldn't this condition have at least an assertion
(i.e. if the norm != 1, then return false or throw)?
Thanks,
David