Link to code: https://editor.p5js.org/jihwanshin96/sketches/quRyhOjtc
Link to ppt: https://docs.google.com/presentation/d/1bPAoklxJha6gEeJqADsru1RmpAS3vR6W7ZY1D9AkBCM/edit?usp=sharing
For this week’s assignment, I wanted to play around with attractions and forces. I thought it’d be interesting to try to emulate the rings of a planet revolving around. So I placed an ellipse in the center and manipulated the particles to be attracted to the center sphere. But I must have written something wrong in declaring the class particles because it would not recognize various functions like force, attraction, or gravity. I implemented the methods I learned in class but had some trouble getting the code to work. In the end, I wasn’t able to achieve my desired result but I will keep tweaking the code to see what I did wrong.
**Update**
I realized that the ellipse has to be a particle with a specific mass for gravity to work around it. But I still wasn’t able to get a rotating orbit, more like a black hole.