Skip to content
instance method

Complex#rectangular

() -> [ ::Numeric, ::Numeric ]
rect -> array

Returns the array [self.real, self.imag]:

Example
Complex.rect(1, 2).rect # => [1, 2]

See Rectangular Coordinates.

If self was created with polar coordinates, the returned value is computed, and may be inexact:

Example
Complex.polar(1.0, 1.0).rect # => [0.5403023058681398, 0.8414709848078965]

Complex#rectangular is an alias for Complex#rect.

See also .rectangular #rect #to_c #real? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0