Java Reference
In-Depth Information
// Java for Engineers
// Filename: HypFun
// Reference: Chapter 23
// Description:
//
Caculating hyperbolic functions
// Requires:
//
Keyin class in current directory
import java.lang.*;
strictfp class HypFun
{
public static void main(String[] args)
{
double rads, degs, sinHA, cosHA, tanHA, asinHA;
// Obtain angle in degrees from user
degs = Keyin.inDouble(“Enter angle in degrees: ”);
// Convert degrees to radian
rads = Math.toRadians(degs);
// Calculate hyperbolic sine
sinHA = (Math.exp(rads) - Math.exp(-rads))/2;
System.out.println(“Hyperbolic sine = ” + sinHA);
// Calculate Hyperbolic cosine
cosHA = (Math.exp(rads) + Math.exp(-rads))/2;
System.out.println(“Hyperbolic cosine = ” + cosHA);
// Calculate hyperbolic tangent
tanHA = sinHA/ cosHA;
System.out.println(“Hyperbolic tangent=”+tanHA);
// Calculate hyperbolic arc-sine
asinHA = Math.log(sinHA + Math.sqrt((sinHA * sinHA)+ 1.0));
degs = Math.toDegrees(asinHA);
System.out.println(“Arc hyperbolic sine=”+degs);
}
}
On the Web
The program HypFun.java can be found in the Chapter 23 folder at
www.crcpress.com .
Cartesian and polar coordinates
In mathematics the study of complex numbers leads directly to an alterna-
tive plane of trigonometric representation,usually called the polar coordi -
nate system. Conventionally,the polar coordinate system is depicted as
based on a point,called the pole ,located at the origin of the Cartesian plane,
Search WWH ::




Custom Search