The complex numbers arise out of 3 mistakes, one of them being an attempt to correct the notion. one the use of a mirror pool, 2 the definition of arithmoi by "lengths", and the justification by rotation.
Aryabhatta and Brahmagupta inroduced the notion of voidness as coming from and returning to the void. It is Brahama gupta who termed these entities "misfortune". Brahmagupta and later Bombelli explained the rules of the combination of misfortunate and fortunate magnituces using the mirror pool, However they were forced o define misfortune factored by misfortune, and they both decided there only choice was to go against the mirror and make it turn out as fortune. This was only half the story the cross mirrors told for misfortune factored by misfortune was still misfortune in the mirrors, but behaving as a real magnitude if it was opposed to the other by rotation about the crosspoints of the mirrors. This rotation was ignored for centuries, even by Bombelli who used Neusis.
The next mistake was inducted from the arabic algebraic texts. Cardano and Tartelli began to use the lengths of the arithmoi perimeters as units, not the arithmoi themselves. Thus carlessly an arithmoi square was defined as i unit and the lengths of the sides were defined as i unit. The die was cast. xx=1 meant that the square unit was factored into length units. But how did one deal with the meno length units? There is no definition of the meno length units factored into a square. Such a definition according to the mirror should be -x*-x=-1, but Bombelli followed Brahmagupta and made it -x*-x=+1 that is pui, whence the conflct between negative lengths and positive arithmoi units.
The third mistake was Wessel, who noted the rotation involved and demonstrated that a consistent algebra of rotations could explain the algebra of Bombelli and Brahmagupta. Add to this the big guns of Gauss and the die was cast for Dedekind and his contemporaries to taxonomise a whole new class of algebras and magnitudes by set theory and the nascent group and ring theory. The complex field of magnitudes was born under the guise of "number".
An earlier explanation by Roger Cotes under Newton's wing alongside De Moivre went un noticed: That the magnitudes of the imaginaries were in fact arc vectors, which Cotes defined as radians. The unit circle, the basis of Newtons powerful analysis of geometry of the plane, equaled only by Steiner, perhaps surpassed by Steiner, and his decomposition of space into the spherical trigonometric ratios is the key to a proper foundation for the so called complex magnitudes. Cotes, had he lived may well have revived the insights of Brahmaguupta and Bombelli in their full form explaining the errors as special cases suitable only for solutions in the plane, where the objects disposition is not important.
The arrival of the vector algebras, initiated by Newton's powerful analysis of motion and Leibniz attempt at monadism, followed by Gauss and eventually Hamilton, harks back to the concerns of the arabic empire with spherical geometry and spherical trigonometry, particularly its use in Astronomy and Astrology. The Strange gematrias used by astrologers to predict planetary orbits and relative positions are a forerunner to any vector like algebras.
However it is Grassmann whose analysis cuts through the excrudescence of centuries to begin to found the generalised notion of dynamic magnitudes on the Indo Greek principles of Platonic Pythagoreanism. The consequence of Grassmann's analysis and analytical method are still being worked through, but mathematicians have got a lot to unlearn before they can properly apply Grassmann's insights