C# Math.Acosh() – Examples

In this tutorial, we will learn about the C# Math.Acosh() method, and learn how to use this method to find the angle whose hyperbolic cosine is the specified number, with the help of examples.

Acosh(Double)

Math.Acosh(d) returns the angle, in radians, whose hyperbolic cosine is the specified number d.

ADVERTISEMENT

Syntax

The syntax of Acosh(d) method is

Math.Acosh(Double d)

where

ParameterDescription
dA double value which is the hyperbolic cosine of the angle to be found out.

Return Value

The method returns Double value.

Example 1 – Acosh()

In this example, we will give different values ranging from Negative Infinity to Positive Infinity to Acosh() method, and find the corresponding angles, in radians.

C# Program

using System;
 
class Example {
    static void Main(string[] args) {
        Double d, result;

        d = Double.NegativeInfinity;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = -5;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = -1;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = 0;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = 1;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = 5;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");

        d = Double.PositiveInfinity;
        result = Math.Acosh(d);
        Console.WriteLine($"Acosh({d}) = {result} radians.");
    }
}

Output

Acosh(-∞) = NaN radians.
Acosh(-5) = NaN radians.
Acosh(-1) = NaN radians.
Acosh(0) = NaN radians.
Acosh(1) = 0 radians.
Acosh(5) = 2.29243166956118 radians.
Acosh(∞) = ∞ radians.

Conclusion

In this C# Tutorial, we have learnt the syntax of C# Math.Acosh() method, and also learnt how to use this method with the help of C# example programs.