C# Math.Sinh() – Examples
In this tutorial, we will learn about the C# Math.Sinh() method, and learn how to use this method to find the hyperbolic sine of given angle, with the help of examples.
Sinh(Double)
Math.Sinh(value) returns the hyperbolic sine of the specified angle value
. The angle is specified in radians.
Syntax
The syntax of Sinh() method is
</>
Copy
Math.Sinh(Double value)
where
Parameter | Description |
---|---|
value | The value represents radians for which hyperbolic sine is to be calculated. |
Return Value
The method returns value of type Double.
Example 1 – Sinh(Double)
In this example, we will find the hyperbolic sine of some angles like 1 radian, PI radians, PI/2 radians, 0 radians, Infinity radians, -Infinity radians.
C# Program
</>
Copy
using System;
class Example {
static void Main(string[] args) {
Double value, result;
value = 1; //1 radian
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
value = Math.PI; // PI radians or 180 degrees
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
value = Math.PI/2; // 90 degrees
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
value = 0; // 0 degrees
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
value = Double.PositiveInfinity;
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
value = Double.NegativeInfinity;
result = Math.Sinh(value);
Console.WriteLine($"Sinh({value} radian) = {result}.");
}
}
Output
Sinh(1 radian) = 1.1752011936438.
Sinh(3.14159265358979 radian) = 11.5487393572577.
Sinh(1.5707963267949 radian) = 2.30129890230729.
Sinh(0 radian) = 0.
Sinh(∞ radian) = ∞.
Sinh(-∞ radian) = -∞.
Conclusion
In this C# Tutorial, we have learnt the syntax of C# Math.Sinh() method, and also learnt how to use this method with the help of C# example programs.