cos(z)
returns the cosine of z, where z is given in radians
CMath.cos(1 + 1i) #=> (0.8337300251311491-0.9888977057628651i)
# File lib/cmath.rb, line 189 def cos(z) begin if z.real? cos!(z) else Complex(cos!(z.real) * cosh!(z.imag), -sin!(z.real) * sinh!(z.imag)) end rescue NoMethodError handle_no_method_error end end