[x] Read through sections 2.9 (Gravitational Attraction) in chapter two of our textbook and then watch Daniel Shiffman’s 16 minute Gravitational Attraction video.
[x] Using the code provided in the textbook/video create the same sketch developed in the chapter/video where a single attractor interacts with several mover objects.
[x] Spend some time playing around with your coder and thinking about where you’d like to take this sketch. This is an opportunity for an interactive portfolio piece! Some possible directions:
· A solar system simulation. (Might be tricky to stabilize the system!) · A world of attractors and “repellers” as seen in this video.
· A dynamic painting algorithm where movers draw their gravitational motion in various colours to the canvas. · An investigation or “explorable explanation” of the three-body problem.
· Develop an idea of your own.
[x] Write a short plan for where you’d like to take this sketch including:
[x] Get to work implementing the plan you devised in the previous section. You may need to pare down your idea and hence your ambitions as you go. An elegantly simple and complete sketch is better than a complex incomplete one.
Be sure to submit two sketches:
Follow Along
Dreams and Plans
Implementation
Coding Conventions
Task Needed Done: Create an interactive sketch that will simulate gravitational/magnetic forces.
Dreams (some ideas that are good to implement):
Plans (how to implement the idea that I have chosen):
My Idea: To create a sketch that will have the objects point to the direction of my mouse (attraction)
Learning Goal: To implement the proper coding structure that I have learned in the previous lessons as well as to implement a force similar to gravitational forces (instead of gravity, it would be magnetic which is a similar concept)
Additions/Modifications (in the mover class and the sketch): Instead of having an attractor, I have made it to become the mouse itself. As for the movers, I have assigned it as sticks to demonstrate how the objects are magnetically attracted to the mouse (it will always point out to the direction of the mouse and the attraction is greater the closer the mouse is to the stick).
Notes: I have decided to stick with something simple because of the crunch week but originally I wanted to do the duet-like game in p5.js but I realized that it might not be used with gravitational/magnetic force but that idea inspired me to pursue doing a magnetic force sketch instead of a gravitational force sketch.