7 #include "cl_complex.h"
15 const cl_N tan (const cl_N& x)
18 // x reell -> (/ (sin x) (cos x))
19 // x = a+bi -> (/ (complex (* (sin a) (cosh b)) (* (cos a) (sinh b)))
20 // (complex (* (cos a) (cosh b)) (- (* (sin a) (sinh b)))) )
23 var cl_cos_sin_t trig = cl_cos_sin(x);
24 return trig.sin / trig.cos;
28 var const cl_R& a = realpart(x);
29 var const cl_R& b = imagpart(x);
30 var cl_cosh_sinh_t hyp_b = cl_cosh_sinh(b); // cosh(b), sinh(b) errechnen
31 var cl_cos_sin_t trig_a = cl_cos_sin(a); // cos(a), sin(a) errechnen
33 complex_C(trig_a.sin * hyp_b.cosh, // sin(a)*cosh(b)
34 trig_a.cos * hyp_b.sinh // cos(a)*sinh(b), nicht Fixnum 0
36 / complex(trig_a.cos * hyp_b.cosh, // cos(a)*cosh(b)
37 - (trig_a.sin * hyp_b.sinh) // -sin(a)*sinh(b)