radian and degree conversions on Fix64

main
cosmonaut 2022-06-21 11:20:32 -07:00
parent b23792acd0
commit d32bbcd537
1 changed files with 16 additions and 0 deletions

View File

@ -321,6 +321,22 @@ namespace MoonWorks.Math.Fixed
return clampedPiOver2;
}
/// <summary>
/// Converts degrees to radians.
/// </summary>
public static Fix64 ToRadians(Fix64 degrees)
{
return degrees * (Pi / new Fix64(180));
}
/// <summary>
/// Converts radians to degrees.
/// </summary>
public static Fix64 ToDegrees(Fix64 radians)
{
return radians * (new Fix64(180) / Pi);
}
/// <summary>
/// Returns the sine of the specified angle.
/// </summary>