Calculating hyperbolic functions : Math : Development Class : Java examples (example source code) Organized by topic

Java
C++
PHP


Java  »  Development Class   » [  Math  ]  Screenshots 
 



Calculating hyperbolic functions

/*
Java Programming for Engineers
Julio Sanchez
Maria P. Canton


ISBN: 0849308100
Publisher: CRC Press
*/

//Java for Engineers
//Filename: HypFun
//Reference: Chapter 23
//Description:
//         Calculating 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 = 20d;
     // 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);
}
}



           
       
Related examples in the same category
1.  Absolute value
2.  Get the power value Get the power value
3.  Using the Math Trig Methods Using the Math Trig Methods
4.  Using BigDecimal for Precision Using BigDecimal for Precision
5.  Demonstrate our own version round() Demonstrate our own version round()
6.  Demonstrate a few of the Math functions for Trigonometry Demonstrate a few of the Math functions for Trigonometry
7.  Exponential Demo Exponential Demo
8.  Min Demo
9.  Basic Math Demo Basic Math Demo
10.  Using strict math in applications Using strict math in applications
11.  Conversion between polar and rectangular coordinates
12.  Using the pow() function
13.  Using strict math at the method level
14.  Calculating trigonometric functions
15.  Weighted floating-pioint comparisons
16.  Solving right triangles
17.  Applying the quadratic formula
18.  Trigonometric Demo Trigonometric Demo
19.  Complex Number Demo
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.