Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Complex#phase

cmp.phase → float

Alias of #arg

Returns the angle part of its polar form.

Example
Complex.polar(3, Math::PI/2).arg  #=> 1.5707963267948966
See also #arg #numerator #polar #magnitude also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1