amath  1.8.5
Simple command line calculator
ccos.c File Reference
#include "prim.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

◆ ccos()

complex ccos ( complex  z)

Cosine of complex number.

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

Definition at line 45 of file ccos.c.

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

Referenced by ComplexNumber::Cosine().

46 {
47  complex w;
48  double a, b;
49  double ch, sh;
50 
51  a = creal(z);
52  b = cimag(z);
53  cchsh(b, &ch, &sh);
54  w = cpack((cos(a) * ch), (-sin(a) * sh));
55 
56  return w;
57 }
double sin(double x)
Sine function.
Definition: sin.c:86
Definition: mathi.h:48
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:68
double cimag(complex z)
Imaginary part of complex number.
Definition: prim.c:46
double cos(double x)
Cosine function.
Definition: cos.c:87
void cchsh(double x, double *c, double *s)
Calculate cosh and sinh.
Definition: prim.c:197
double creal(complex z)
Real part of complex number.
Definition: prim.c:38
Here is the call graph for this function:
Here is the caller graph for this function: