This is just a visual demo. Press space to add lines & dots. Press L to hide the lines. Watch the animation as you add more lines & dots. Press the Green Flag to start over. A "rotating circle" seems to emerge as you add more lines & dots, but there is no "circle". It's just dots moving back and forth along their line.
Learn to program games with this free online Scratch course: https://inventwithscratch.com/class I'll add an explanation for the code later. But this is what you can do if you have a little geometry and trigonometry knowledge. Pay attention in math class! :)