Class: Complex

Inherits:
Object show all
Defined in:
lib/flt/complex.rb

Instance Method Summary collapse

Instance Method Details

#absObject


37
38
39
# File 'lib/flt/complex.rb', line 37

def abs
  num_class.nil? ? abs! : num_class.context.hypot(real, imag)
end

#abs!Object


36
# File 'lib/flt/complex.rb', line 36

alias abs! abs

#polarObject


42
43
44
# File 'lib/flt/complex.rb', line 42

def polar
  num_class.nil? ? polar! : [num_class.context.hypot(real, imag), num_class.context.atan2(imag, real)]
end

#polar!Object


41
# File 'lib/flt/complex.rb', line 41

alias polar! polar