mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-12 03:04:51 -04:00
--User changes
-cosh, coth, csch, sech, sinh, tanh: Scale inputs by PI/4. This will produce different results, but is technically more correct. --Code changes -cos, csch: move position of sign flip, shouldn't change output. -cot, coth, csc, csch, sec, sech, tan, tanh: add optimization.
This commit is contained in:
@ -301,6 +301,17 @@ public:
|
||||
return v2T(a.x + x, a.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtract complex from complex.
|
||||
/// </summary>
|
||||
/// <param name="a">The first complex number</param>
|
||||
/// <param name="b">The second complex number</param>
|
||||
/// <returns>a - b</returns>
|
||||
static v2T ComplexMinusComplex(v2T a, v2T b)
|
||||
{
|
||||
return v2T(a.x - b.x, a.y - b.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtract real from complex.
|
||||
/// </summary>
|
||||
@ -333,6 +344,16 @@ public:
|
||||
return v2T(T(0.5) * std::log(a.x * a.x + a.y * a.y), std::atan2(a.y, a.x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute the inverse of the natural logarithm of a complex number.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <returns>exp(a)</returns>
|
||||
static v2T ComplexExp(v2T a)
|
||||
{
|
||||
return v2T(std::cos(a.y), std::sin(a.y)) * std::exp(a.x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve information about a piece of shared data by looking
|
||||
/// up its name.
|
||||
|
Reference in New Issue
Block a user