mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
un-templated a couple of functions to prevent them being accidentally called with integral type arguments
This commit is contained in:
parent
a48d70010f
commit
576c60fd15
1 changed files with 8 additions and 4 deletions
|
|
@ -356,12 +356,16 @@ const float float_Pi = 3.14159265358979323846f;
|
|||
|
||||
|
||||
/** Converts an angle in degrees to radians. */
|
||||
template <typename FloatType>
|
||||
FloatType degreesToRadians (FloatType degrees) noexcept { return degrees * static_cast<FloatType> (double_Pi / 180.0); }
|
||||
inline float degreesToRadians (float degrees) noexcept { return degrees * (float_Pi / 180.0f); }
|
||||
|
||||
/** Converts an angle in degrees to radians. */
|
||||
inline double degreesToRadians (double degrees) noexcept { return degrees * (double_Pi / 180.0); }
|
||||
|
||||
/** Converts an angle in radians to degrees. */
|
||||
template <typename FloatType>
|
||||
FloatType radiansToDegrees (FloatType radians) noexcept { return radians * static_cast<FloatType> (180.0 / double_Pi); }
|
||||
inline float radiansToDegrees (float radians) noexcept { return radians * (180.0f / float_Pi); }
|
||||
|
||||
/** Converts an angle in radians to degrees. */
|
||||
inline double radiansToDegrees (double radians) noexcept { return radians * (180.0 / double_Pi); }
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue