Purpose

The hyperbolic functions calculate the hyperbolic sine, cosine, or tangent of an angle.

Header File

math.h
(sinh, cosh, tanh)

Prototypes

double sinh (double x);
double cosh (double x);
double tanh (double x);

Argument

x
The angle in radians

Return Values

sinh
hyperbolic sine (x) = (ex - e-x) / 2
cosh
hyperbolic cosine (x) = (ex + e-x) / 2
tanh
hyperbolic tangent (x) = (ex - e-x) / (ex + e-x)

Example

#include <stdio.h>
#include <math.h> 
#include <stdlib.h>

void Display (double Angle);

int main () {
  Display (.08 * (double)(rand() % 100) - 4.0);
  Display (.08 * (double)(rand() % 100) - 4.0);
  Display (.08 * (double)(rand() % 100) - 4.0);
  return 0;
}

void Display (double Angle) {
  printf ("The hyperbolic sine of %f radians is %f\n",
          Angle, sinh (Angle));
  printf ("The hyperbolic cosine of %f radians is %f\n",
          Angle, cosh (Angle));
  printf ("The hyperbolic tangent of %f radians is %f\n\n",
          Angle, tanh (Angle));
}

Output

The hyperbolic sine of -0.320000 radians is -0.325489
The hyperbolic cosine of -0.320000 radians is 1.051638
The hyperbolic tangent of -0.320000 radians is -0.309507

The hyperbolic sine of -1.600000 radians is -2.375568
The hyperbolic cosine of -1.600000 radians is 2.577464
The hyperbolic tangent of -1.600000 radians is -0.921669

The hyperbolic sine of 2.560000 radians is 6.429256
The hyperbolic cosine of 2.560000 radians is 6.506561
The hyperbolic tangent of 2.560000 radians is 0.988119

See Also

C++ Hyperbolic   C++ Now
C# Hyperbolic   C# Now
FORTRAN Hyperbolic   FORTRAN Now
Java Hyperbolic   Java Now
Pascal Hyperbolic   Pascal Now
PHP Hyperbolic   PHP Now

External Links

cosh Function   Thinkage, Ltd
sinh Function   Thinkage, Ltd
tanh Function   Thinkage, Ltd

Valid HTML 4.01 Transitional

Valid CSS

Site Icon Copyright © 1999-2007, jhyoung, revised 5/23/2007