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

Go to the source code of this file.

Functions

complex cacsc (complex z)
 Inverse cosecant of complex number. More...
 

Function Documentation

complex cacsc ( complex  z)

Inverse cosecant of complex number.

Version
1.1
Date
14/10/01

Inverse cosecant expressed using complex logarithms:

arccsc z = -i * log(sqr(1 - 1/(z*z)) + i/z)

More info is available at Wikipedia:
http://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Logarithmic_forms

Definition at line 43 of file cacsc.c.

References cadd(), cdiv(), clog(), cmul(), cpack(), csqrt(), and csub().

Referenced by ComplexNumber::ArcCosecant().

44 {
45  complex one = cpack(1.0, 0.0);
46  complex i = cpack(0.0, 1.0);
47  complex j = cpack(0.0, -1.0);
48  complex iz = cdiv(i, z);
49  complex z2 = cmul(z, z);
50  complex p = cdiv(one, z2);
51  complex q = csqrt(csub(one, p));
52  complex w = cmul(j, clog(cadd(q, iz)));
53  return w;
54 }
complex csqrt(complex z)
Square root of complex number.
Definition: csqrt.c:46
complex cmul(complex a, complex z)
Multiplication of two complex numbers.
Definition: prim.c:150
complex cadd(complex a, complex z)
Addition of two complex numbers.
Definition: prim.c:128
complex csub(complex a, complex z)
Subtraction of two complex numbers.
Definition: prim.c:139
complex cdiv(complex a, complex z)
Division of two complex numbers.
Definition: prim.c:170
complex clog(complex z)
Natural logarithm of a complex number.
Definition: clog.c:46
#define one
Definition: ktan.c:64
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:71

Here is the call graph for this function:

Here is the caller graph for this function: