1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

AK: Add to_radians and to_degrees math functions

This commit is contained in:
Bastiaan van der Plaat 2023-09-09 14:43:39 +02:00 committed by Sam Atkins
parent 9b7aa8f6b6
commit 494a8cb816
15 changed files with 40 additions and 40 deletions

View file

@ -39,7 +39,7 @@ double Angle::to_degrees() const
case Type::Grad:
return m_value * (360.0 / 400.0);
case Type::Rad:
return m_value * (180.0 / AK::Pi<double>);
return AK::to_degrees(m_value);
case Type::Turn:
return m_value * 360.0;
}
@ -48,7 +48,7 @@ double Angle::to_degrees() const
double Angle::to_radians() const
{
return to_degrees() * (AK::Pi<double> / 180.0);
return AK::to_radians(to_degrees());
}
StringView Angle::unit_name() const