amath  1.8.5
Simple command line calculator
csin.c File Reference
#include "prim.h"
Include dependency graph for csin.c:

Go to the source code of this file.

Functions

complex csin (complex z)
 Sine of a complex number. More...
 

Function Documentation

◆ csin()

complex csin ( complex  z)

Sine of a complex number.

Calculated according to description at wikipedia:
https://wikipedia.org/wiki/Sine#Sine_with_a_complex_argument

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

Definition at line 50 of file csin.c.

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

Referenced by ComplexNumber::Sine().

51 {
52  complex w;
53  double a, b;
54  double ch, sh;
55 
56  a = creal(z);
57  b = cimag(z);
58  cchsh(b, &ch, &sh);
59  w = cpack((sin(a) * ch), (cos(a) * sh));
60 
61  return w;
62 }
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: