amath  1.6.2
Simple command line calculator
ccoth.c File Reference
#include "prim.h"
#include "math.h"
#include "complex.h"
Include dependency graph for ccoth.c:

Go to the source code of this file.

Functions

complex ccoth (complex z)
 Hyperbolic cotangent of a complex number. More...
 

Function Documentation

complex ccoth ( complex  z)

Hyperbolic cotangent of a complex number.

acoth(z) = 0.5 * (log(1 + 1/z) - log(1 - 1/z))

or

a+bi
               sinh(2.0 * a)
real  = ---------------------------—
         cosh(2.0 * a) - cos(2.0 * b)
  -sin(2.0 * b)
imag = ---------------------------— cosh(2.0 * a) - cos(2.0 * b)

Definition at line 49 of file ccoth.c.

References cimag(), cos(), cosh(), cpack(), creal(), sin(), and sinh().

Referenced by ComplexNumber::HypCotangent().

50 {
51  complex w;
52  double a, b;
53  double d;
54 
55  a = creal(z);
56  b = cimag(z);
57  d = cosh(2.0 * a) - cos(2.0 * b);
58  w = cpack(sinh(2.0 * a) / d, -sin(2.0 * b) / d);
59 
60  return w;
61 }
double sinh(double x)
Hyperbolic sine function.
Definition: sinh.c:81
double cos(double x)
Trigonometric cosine function.
Definition: cos.c:87
double sin(double x)
Trigonometric sine function.
Definition: sin.c:87
double cosh(double x)
Hyperbolic cosine function.
Definition: cosh.c:84
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:71
double creal(complex z)
Real part of complex number.
Definition: prim.c:38
double cimag(complex z)
Imaginary part of complex number.
Definition: prim.c:47

Here is the call graph for this function:

Here is the caller graph for this function: