public function fromMatrix(Matrix $mA)
    {
        $data = $mA->toArray();
        $rows = $mA->rows();
        $cols = $mA->columns();
        for ($y = 0; $y < $rows; $y++) {
            for ($x = 0; $x < $cols; $x++) {
                $this->append(new Vector2D($x, $y, $data[$y][$x]));
            }
        }

        return $this;
    }