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

Go to the source code of this file.

Functions

complex casin (complex z)
 Inverse sine of complex number. More...
 

Function Documentation

◆ casin()

complex casin ( complex  z)

Inverse sine of complex number.

Inverse sine expressed using complex logarithms:

arcsin z = -i * log(iz + sqrt(1 - z*z))

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

Definition at line 42 of file casin.c.

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

Referenced by ComplexNumber::ArcSine().

43 {
44  complex one = cpack(1.0, 0.0);
45  complex i = cpack(0.0, 1.0);
46  complex j = cpack(0.0, -1.0);
47  complex iz = cmul(i, z);
48  complex z2 = cmul(z, z);
49  complex p = csqrt(csub(one, z2));
50  complex q = clog(cadd(iz, p));
51  complex w = cmul(j, q);
52  return w;
53 }
complex csub(complex y, complex z)
Subtraction of two complex numbers.
Definition: prim.c:130
Definition: mathi.h:48
complex cmul(complex y, complex z)
Multiplication of two complex numbers.
Definition: prim.c:140
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:68
complex csqrt(complex z)
Square root of complex number.
Definition: csqrt.c:42
complex cadd(complex y, complex z)
Addition of two complex numbers.
Definition: prim.c:120
#define one
Definition: ktan.c:67
complex clog(complex z)
Natural logarithm of a complex number.
Definition: clog.c:42
Here is the call graph for this function:
Here is the caller graph for this function: