For each electron, the Paint event handler uses the Graphics object's RotateTransform and TranslateTransform methods to prepare to draw rotated and translated objects. It then draws an ellipse centered at the origin. The rotation and scaling position it appropriately for the atom.
Then code then uses trigonometry to figure out where the electron should be on its orbit and draws a circle there.
The angle Theta determines the electrons' positions. Note that the code multiplies Theta by different values for the different electrons so they move at different speeds.
Comments