Skip to content

Commit e5e5d35

Browse files
authored
[Term Entry] C# Math-functions: Acosh() (#7997)
* [Term Entry] C# Math-functions: Acosh() * Update acosh.md * Update acosh.md * no need for another line here * Update acosh.md ---------
1 parent 228e10e commit e5e5d35

File tree

1 file changed

+80
-0
lines changed
  • content/c-sharp/concepts/math-functions/terms/acosh

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
Title: 'Acosh()'
3+
Description: 'Returns the inverse hyperbolic cosine of a specified number.'
4+
Subjects:
5+
- 'Computer Science'
6+
- 'Web Development'
7+
Tags:
8+
- 'Functions'
9+
- 'Math'
10+
- 'Methods'
11+
- 'Numbers'
12+
CatalogContent:
13+
- 'learn-c-sharp'
14+
- 'paths/computer-science'
15+
---
16+
17+
The **`Math.Acosh()`** method returns the inverse hyperbolic cosine (also known as hyperbolic arccosine) of a specified number. It computes the value whose hyperbolic cosine equals the given number.
18+
19+
## Syntax
20+
21+
```pseudo
22+
Math.Acosh(number);
23+
```
24+
25+
**Parameters:**
26+
27+
- `number`: A double-precision floating-point value greater than or equal to `1`, for which to compute the inverse hyperbolic cosine.
28+
29+
**Return value:**
30+
31+
- The inverse hyperbolic cosine of the specified number in radians as a `double`.
32+
- `NaN` if the input is less than `1` or `NaN`.
33+
34+
## Example: Basic Usage of `Math.Acosh()`
35+
36+
This example calculates the inverse hyperbolic cosine of a number using `Math.Acosh()` and displays the result in radians:
37+
38+
```cs
39+
using System;
40+
41+
public class Example
42+
{
43+
public static void Main()
44+
{
45+
double number = 1.5;
46+
double result = Math.Acosh(number);
47+
Console.WriteLine($"Math.Acosh({number}) = {result} radians");
48+
}
49+
}
50+
```
51+
52+
This example outputs the following:
53+
54+
```shell
55+
Math.Acosh(1.5) = 0.9624236501192069 radians
56+
```
57+
58+
## Codebyte Example
59+
60+
In this example, the `Math.Acosh()` method is used to calculate the inverse hyperbolic cosine of a specified number in radians and degrees:
61+
62+
```codebyte/csharp
63+
using System;
64+
65+
public class Example {
66+
public static void Main() {
67+
double number = 100.0;
68+
69+
// Calculate Acosh in radians
70+
double resultRadians = Math.Acosh(number);
71+
72+
// Convert radians to degrees
73+
double resultDegrees = resultRadians * (180.0 / Math.PI);
74+
75+
// Display results
76+
Console.WriteLine($"Math.Acosh({number}) = {resultRadians} radians");
77+
Console.WriteLine($"Math.Acosh({number}) = {resultDegrees} degrees");
78+
}
79+
}
80+
```

0 commit comments

Comments
 (0)