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

Go to the source code of this file.

Functions

complex ccos (complex z)
 Cosine of complex number. More...
 

Function Documentation

complex ccos ( complex  z)

Cosine of complex number.

Version
1.1
Date
2007/08/20
a+bi
real =  cos(a) * cosh(b)
imag = -sin(a) * sinh(b)

Definition at line 51 of file ccos.c.

References cchsh(), cimag(), cos(), cpack(), creal(), and sin().

Referenced by ComplexNumber::Cosine().

52 {
53  complex w;
54  double a, b;
55  double ch, sh;
56 
57  a = creal(z);
58  b = cimag(z);
59  cchsh(b, &ch, &sh);
60  w = cpack((cos(a) * ch), (-sin(a) * sh));
61 
62  return w;
63 }
void cchsh(double x, double *c, double *s)
Calculate cosh and sinh.
Definition: prim.c:210
double cos(double x)
Trigonometric cosine function.
Definition: cos.c:87
double sin(double x)
Trigonometric sine function.
Definition: sin.c:87
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: