📜  C#| Math.Sinh()方法

📅  最后修改于: 2021-05-29 19:24:07             🧑  作者: Mango

Math.Sinh()是内置的Math类方法,它返回给定双值参数(指定角度)的双曲正弦值。

句法:

public static double Sinh(double num)

参数:

返回值:该方法返回System.Double类型的num的双曲正弦值。如果num等于NegativeInfinity,PositiveInfinity或NaN,则此方法返回一个等于num的Double。

Input  : num = 60.0
Output : 5.71003695E25

下面的程序说明了Math.Sinh方法:

程序1:

// C# program to illustrate the
// Math.Sinh()
using System;
  
class GFG {
  
    // Main Method
    public static void Main(String[] args)
    {
  
        double num1 = 78.8, num2 = 0.0, num3 = 1.0;
  
        // It returns the hyperbolic sine of specified 
        // angle in radian
        double sinhvalue = Math.Sinh(num1);
        Console.WriteLine("The sinh of num1 = " + sinhvalue);
  
        sinhvalue = Math.Sinh(num2);
        Console.WriteLine("The sinh of num2 = " + sinhvalue);
  
        sinhvalue = Math.Sinh(num3);
        Console.WriteLine("The sinh of num3 = " + sinhvalue);
    }
}
输出:
The sinh of num1 = 8.34401696285252E+33
The sinh of num2 = 0
The sinh of num3 = 1.1752011936438

程式2:

// C# praogram to illustrate the
// Math.Sinh() Method
using System;
  
class GFG {
  
    // Main Method
    public static void Main(String[] args)
    {
  
        double num1 = (30 * (Math.PI)) / 180, num2 = 11.0, num3 = 45.0;
  
        // It returns the hyperbolic sine of 
        // angle in radian
        double sinhvalue = Math.Sinh(num1);
        Console.WriteLine("The sinh of num1 = " + sinhvalue);
  
        sinhvalue = Math.Sinh(num2);
        Console.WriteLine("The sinh of num2 = " + sinhvalue);
  
        sinhvalue = Math.Sinh(num3);
        Console.WriteLine("The sinh of num3 = " + sinhvalue);
    }
}
输出:
The sinh of num1 = 0.54785347388804
The sinh of num2 = 29937.0708492481
The sinh of num3 = 1.74671355287425E+19