sinh function
dynamic
sinh(
- dynamic x
Returns the hyperbolic sine of a number.
Example 1:
print(sinh(1)); // Output: 1.1752011936438014
Example 2:
print(sinh(Complex(1, 2))); // Output: -0.4890562590412937 + 1.4031192506220405i
Example 3:
print(sinh(Matrix.identity(2))); // Output: [[1.0, 0.0], [0.0, 1.0]]
Implementation
dynamic sinh(dynamic x) {
if (x is num) {
return (exp(x) - exp(-x)) / 2;
} else if (x is Complex) {
return x.sinh();
} else if (x is Matrix) {
return MatrixFunctions(x).sinh();
} else {
throw ArgumentError('Input should be either num or Complex');
}
}