deg2rad constant is used in multiple places, it would be nice IMHO to have one shared contant.
Created attachment 16118 [details] First attempt I think MathExtras.h is the best place for reuse, but am open to other suggestions :) Cheers, Rob.
Heya Rob, sounds like a nice attempt to unify these. Some comments: - I'd rather define two inlined deg2rad / rad2deg functions instead of exposing a #define'd constant. and let all callers use these. - Maybe adding deg2grad, grad2deg is also a good idea, while you're at it. (at least SVG needs it) Greetings, Niko
At the very least, the constant should be defined as a static const double instead of a #define. It does seem like the inline function would read better if used everywhere.
Comment on attachment 16118 [details] First attempt r- to consider me and Niko's comments, but otherwise looks great.
Created attachment 16609 [details] Proposed patch Proposed patch based on Rob's original patch.
Comment on attachment 16609 [details] Proposed patch This patch adds conversions to/from double in code that was previously dealing entirely with floats. That will make the code slower. Instead there should be overloaded versions of these functions for both float and double.
Created attachment 16621 [details] Proposed patch 2 Now with float versions as well
Comment on attachment 16621 [details] Proposed patch 2 This looks great to me.
Landed in r26378