Answer :
There are calculations that chart where an electron will be in it's orbit, which I turn influences whether or not it will form an ionic bond and the new orbitals if it does.
1) Preliminar explanation:
Atoms are neutral spieces: they have the same number of positive charges (protons inside the nucleous) as of negative charges (electrons around the nucleus).
Ions are formed by the gain or loss of electrons.
Positive ions are formed when neutral the atoms lose electrons, and negative ions are formed when neutral atoms gain electrons. Only the elctrons are gain or loss in ions formation (the number of protons remain unchanged).
2) Conclusion (answer)
Therefore, mathematically an ion is the result of adding or subtracting electrons to an atom, creating an imbalance of charge, positve when the atom ends up with less electrons than protons (loss of electrons) or negative when the atoms ends up with more electrons than protons (gain of electrons).