public static double tricorn(double n, string str)
{
double pi = System.Math.PI;
switch (str)
{
case "sin": return System.Math.Sin(n * pi / 180);
case "cos": return System.Math.Cos(n * pi / 180);
case "tan": return System.Math.Tan(n * pi / 180);
case "cot": return 1.0 / System.Math.Tan(n * pi / 180);
case "asin": return System.Math.Asin(n)*180/pi;
case "acos": return System.Math.Acos(n))*180/pi;
case "atan": return System.Math.Atan(n))*180/pi;
case "acot": return System.Math.Atan(1.0 / n))*180/pi;
default:
return 0;
}
}
{
double pi = System.Math.PI;
switch (str)
{
case "sin": return System.Math.Sin(n * pi / 180);
case "cos": return System.Math.Cos(n * pi / 180);
case "tan": return System.Math.Tan(n * pi / 180);
case "cot": return 1.0 / System.Math.Tan(n * pi / 180);
case "asin": return System.Math.Asin(n)*180/pi;
case "acos": return System.Math.Acos(n))*180/pi;
case "atan": return System.Math.Atan(n))*180/pi;
case "acot": return System.Math.Atan(1.0 / n))*180/pi;
default:
return 0;
}
}