mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibM: Add back ampsin() since it was still used by tan()
This commit is contained in:
parent
1282b778e7
commit
4565b2d2d9
1 changed files with 17 additions and 0 deletions
|
@ -84,6 +84,23 @@ double tanh(double x)
|
|||
return (plusX - minusX) / (plusX + minusX);
|
||||
}
|
||||
|
||||
double ampsin(double angle)
|
||||
{
|
||||
double looped_angle = fmod(M_PI + angle, M_TAU) - M_PI;
|
||||
double looped_angle_squared = looped_angle * looped_angle;
|
||||
|
||||
double quadratic_term;
|
||||
if (looped_angle > 0) {
|
||||
quadratic_term = -looped_angle_squared;
|
||||
} else {
|
||||
quadratic_term = looped_angle_squared;
|
||||
}
|
||||
|
||||
double linear_term = M_PI * looped_angle;
|
||||
|
||||
return quadratic_term + linear_term;
|
||||
}
|
||||
|
||||
double tan(double angle)
|
||||
{
|
||||
return ampsin(angle) / ampsin(M_PI_2 + angle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue