Skip to content
instance method

Complex#rect

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

Alias of #rectangular

Returns a new Complex object formed from the arguments, each of which must be an instance of Numeric, or an instance of one of its subclasses: Complex, Float, Integer, Rational; see Rectangular Coordinates:

Example
Complex.rect(3)             # => (3+0i)
Complex.rect(3, Math::PI)   # => (3+3.141592653589793i)
Complex.rect(-3, -Math::PI) # => (-3-3.141592653589793i)

Complex.rectangular is an alias for Complex.rect.

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