Calculate hyperbolic sine in Java
Description
The following code shows how to calculate hyperbolic sine.
Example
//from w ww . j a v a 2s. c om
public class Main {
public static void main(String[] args) {
// Obtain angle in degrees from user
double degs = 20d;
// Convert degrees to radian
double rads = Math.toRadians(degs);
// Calculate hyperbolic sine
double sinHA = (Math.exp(rads) - Math.exp(-rads)) / 2;
System.out.println("Hyperbolic sine = " + sinHA);
}
}
The code above generates the following result.