Descartes could have thought of cartesian coordinates in bed in the morning looking at the ceiling. Perhaps there were geometrical designs there. At least, the ceiling would have been rectangular.
However, the real story is he wasn’t trying to algebraise geometry, apparently, but rather analyze arbitrary 3-line geometry problems by adding 2 oblique lines with determinable relations with the original 3 lines, solvable using ruler and compass.
And the rest is history.
Back to ReneDescartes