mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Began phasing out double_Pi and float_Pi in favour of MathConstants::pi. Also added MathConstants::twoPi
This commit is contained in:
parent
daab5147c2
commit
d0111a4f96
49 changed files with 307 additions and 292 deletions
|
|
@ -53,7 +53,7 @@ void SpecialFunctions::ellipticIntegralK (double k, double& K, double& Kp) noexc
|
|||
{
|
||||
constexpr int M = 4;
|
||||
|
||||
K = double_Pi * 0.5;
|
||||
K = MathConstants<double>::pi * 0.5;
|
||||
auto lastK = k;
|
||||
|
||||
for (int i = 0; i < M; ++i)
|
||||
|
|
@ -62,7 +62,7 @@ void SpecialFunctions::ellipticIntegralK (double k, double& K, double& Kp) noexc
|
|||
K *= 1 + lastK;
|
||||
}
|
||||
|
||||
Kp = double_Pi * 0.5;
|
||||
Kp = MathConstants<double>::pi * 0.5;
|
||||
auto last = std::sqrt (1 - k * k);
|
||||
|
||||
for (int i = 0; i < M; ++i)
|
||||
|
|
@ -86,7 +86,7 @@ Complex<double> SpecialFunctions::cde (Complex<double> u, double k) noexcept
|
|||
*++kei = next;
|
||||
}
|
||||
|
||||
std::complex<double> last = std::cos (0.5 * u * double_Pi);
|
||||
std::complex<double> last = std::cos (0.5 * u * MathConstants<double>::pi);
|
||||
|
||||
for (int i = M - 1; i >= 0; --i)
|
||||
last = (1.0 + ke[i + 1]) / (1.0 / last + ke[i + 1] * last);
|
||||
|
|
@ -108,7 +108,7 @@ Complex<double> SpecialFunctions::sne (Complex<double> u, double k) noexcept
|
|||
*++kei = next;
|
||||
}
|
||||
|
||||
std::complex<double> last = std::sin (0.5 * u * double_Pi);
|
||||
std::complex<double> last = std::sin (0.5 * u * MathConstants<double>::pi);
|
||||
|
||||
for (int i = M - 1; i >= 0; --i)
|
||||
last = (1.0 + ke[i + 1]) / (1.0 / last + ke[i + 1] * last);
|
||||
|
|
@ -135,7 +135,7 @@ Complex<double> SpecialFunctions::asne (Complex<double> w, double k) noexcept
|
|||
for (int i = 1; i <= M; ++i)
|
||||
last = 2.0 * last / ((1.0 + ke[i]) * (1.0 + std::sqrt (1.0 - std::pow (ke[i - 1] * last, 2.0))));
|
||||
|
||||
return 2.0 / double_Pi * std::asin (last);
|
||||
return 2.0 / MathConstants<double>::pi * std::asin (last);
|
||||
}
|
||||
|
||||
} // namespace dsp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue