Skip to content

Commit f6e91aa

Browse files
authored
Merge pull request #4 from Pedrop19/patch-1
Update trigonometry.js
2 parents 2590c90 + 2b274a9 commit f6e91aa

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

adv-math/src/geometry-trigonometry/trigonometry.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,48 @@ class Trigonometry {
7979
}
8080
return this.arctangent(1 / value);
8181
}
82+
83+
// Method to calculate the hyperbolic sine of an angle in degrees
84+
static sinh(degrees) {
85+
const radians = (degrees * Math.PI) / 180;
86+
return Math.sinh(radians);
87+
}
88+
89+
// Method to calculate the hyperbolic cosine of an angle in degrees
90+
static cosh(degrees) {
91+
const radians = (degrees * Math.PI) / 180;
92+
return Math.cosh(radians);
93+
}
94+
95+
// Method to calculate the hyperbolic tangent of an angle in degrees
96+
static tanh(degrees) {
97+
const radians = (degrees * Math.PI) / 180;
98+
return Math.tanh(radians);
99+
}
100+
101+
// Method to calculate the hyperbolic arcsine in degrees
102+
static arsinh(value) {
103+
const result = Math.asinh(value);
104+
return (result * 180) / Math.PI;
105+
}
106+
107+
// Method to calculate the hyperbolic arccosine in degrees
108+
static arcosh(value) {
109+
if (value < 1) {
110+
throw new Error('Invalid input for arcosh.');
111+
}
112+
const result = Math.acosh(value);
113+
return (result * 180) / Math.PI;
114+
}
115+
116+
// Method to calculate the hyperbolic arctangent in degrees
117+
static artanh(value) {
118+
if (value < -1 || value > 1) {
119+
throw new Error('Invalid input for artanh.');
120+
}
121+
const result = Math.atanh(value);
122+
return (result * 180) / Math.PI;
123+
}
82124
}
83125

84126
module.exports = Trigonometry;

0 commit comments

Comments
 (0)