File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
adv-math/src/geometry-trigonometry Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff 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
84126module . exports = Trigonometry ;
You can’t perform that action at this time.
0 commit comments