using System; namespace Colourful.Implementation { /// /// Math helper functions /// internal static class MathUtils { /// /// Compute x^2 /// /// Base /// Result of the exponentiation public static double Pow2(double x) => x * x; /// /// Compute x^3 /// /// Base /// Result of the exponentiation public static double Pow3(double x) => x * x * x; /// /// Compute x^4 /// /// Base /// Result of the exponentiation public static double Pow4(double x) => x * x * (x * x); /// /// Compute x^7 /// /// Base /// Result of the exponentiation public static double Pow7(double x) => x * x * x * (x * x * x) * x; /// /// Compute sine of angle in degrees /// /// Given angle /// public static double SinDeg(double x) { var x_rad = Angle.DegreeToRadian(x); var y = Math.Sin(x_rad); return y; } /// /// Compute cosine of angle in degrees /// /// Given angle /// public static double CosDeg(double x) { var x_rad = Angle.DegreeToRadian(x); var y = Math.Cos(x_rad); return y; } } }