在 C# 中获取其正弦值为浮点值参数的角度
要获取其正弦值为浮点值参数的角度,代码如下 −
示例
using System; public class Demo { public static void Main() { float val1 = 0.1f; float val2 = 8.9f; Console.WriteLine("Angle (val1) = "+(MathF.Asin(val1))); Console.WriteLine("Angle (val2) = "+(MathF.Asin(val2))); } }
输出
这将产生以下输出 −
Angle (val1) = 0.1001674 Angle (val2) = NaN
示例
让我们看另一个示例 −
using System; public class Demo { public static void Main() { float val1 = 1.2f; float val2 = 45.5f; Console.WriteLine("Angle (val1) = "+(MathF.Asin(val1))); Console.WriteLine("Angle (val2) = "+(MathF.Asin(val2))); } }
输出
这将产生以下输出 −
Angle (val1) = NaN Angle (val2) = NaN
广告