Complex Numbers and GSL::Complex Class

Class Methods

GSL::Complex.new(re, im)
GSL::Complex.rect(re, im)
GSL::Complex[re, im]
These create a GSL::Complex object with real and imaginary part re, im.
GSL::Complex.polar(r, theta)
This returns a GSL::Complex object in polar representation, with the amplitude r and the phase (argument) theta.

Methods

GSL::Complex#real
GSL::Complex#re
Returns the real part
GSL::Complex#imag
GSL::Complex#im
Returns the imaginary part
GSL::Complex#arg
Returns the argument
GSL::Complex#abs, abs2, logabs
Returns the magnitude, squared magnitude, and the logarithm of the magnitude

Complex arithmetic

GSL::Complex#add
GSL::Complex#sub
GSL::Complex#mul
GSL::Complex#div
GSL::Complex#add_real
GSL::Complex#sub_real
GSL::Complex#mul_real
GSL::Complex#div_real
GSL::Complex#add_imag

.....

GSL::Complex#conjugate
Returns the complex conjugate

back