当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


C# Math.Sinh()用法及代码示例


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

用法:

public static double Sinh(double num)

参数:


  • num:它是要返回其双曲正弦的数字,并且此参数的类型为System.Double。

返回值:该方法返回num类型为System.Double的双曲正弦值。如果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


相关用法


注:本文由纯净天空筛选整理自Akanksha_Rai大神的英文原创作品 C# | Math.Sinh() Method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。