src/Malenki/Math/RandomComplex.php
public function get()
    {
        if ($this->r || $this->i) {
            if (!is_object($this->i)) {
                return new Complex(
                    self::random($this->r->min, $this->r->max),
                    0
                );
            }

            if (!is_object($this->r)) {
                return new Complex(
                    0,
                    self::random($this->i->min, $this->i->max)
                );
            }

            return new Complex(
                self::random($this->r->min, $this->r->max),
                self::random($this->i->min, $this->i->max)
            );
        }

        if ($this->rho || $this->theta) {
            if (!is_object($this->theta)) {
                return new Complex(
                    self::random($this->rho->min, $this->rho->max),
                    0,
                    Complex::TRIGONOMETRIC
                );
            }

            if (!is_object($this->rho)) {
                return new Complex(
                    0,
                    self::random($this->theta->min, $this->theta->max),
                    Complex::TRIGONOMETRIC
                );
            }

            return new Complex(
                self::random($this->rho->min, $this->rho->max),
                self::random($this->theta->min, $this->theta->max),
                Complex::TRIGONOMETRIC
            );
        }
    }
public function get()
    {
        if ($this->r || $this->i) {
            if (!is_object($this->i)) {
                return new Complex(
                    self::random($this->r->min, $this->r->max),
                    0
                );
            }

            if (!is_object($this->r)) {
                return new Complex(
                    0,
                    self::random($this->i->min, $this->i->max)
                );
            }

            return new Complex(
                self::random($this->r->min, $this->r->max),
                self::random($this->i->min, $this->i->max)
            );
        }

        if ($this->rho || $this->theta) {
            if (!is_object($this->theta)) {
                return new Complex(
                    self::random($this->rho->min, $this->rho->max),
                    0,
                    Complex::TRIGONOMETRIC
                );
            }

            if (!is_object($this->rho)) {
                return new Complex(
                    0,
                    self::random($this->theta->min, $this->theta->max),
                    Complex::TRIGONOMETRIC
                );
            }

            return new Complex(
                self::random($this->rho->min, $this->rho->max),
                self::random($this->theta->min, $this->theta->max),
                Complex::TRIGONOMETRIC
            );
        }
    }
Gets one complex number randomly

@access public
@return Complex