CMath is a library that provides trigonometric and transcendental functions for complex numbers.
To start using this library, simply:
require "cmath"
Square root of a negative number is a complex number.
CMath.sqrt(-9) #=> 0+3.0i
cbrt(z) Class Public methods returns the principal value of the cube root of
sin(z) Class Public methods returns the sine of z, where z
asin(z) Class Public methods returns the arc sine of z
tan(z) Class Public methods returns the tangent of z, where z
tanh(z) Class Public methods returns the hyperbolic tangent of z
log10(z) Class Public methods returns the base 10 logarithm of z
acos(z) Class Public methods returns the arc cosine of z
exp(z) Class Public methods Math::E raised to the z power
cosh(z) Class Public methods returns the hyperbolic cosine of z
log(*args) Class Public methods Returns the natural logarithm of
Page 3 of 4