JESSIE ZHAI

Digital artist

A documentation page of rambling and experimenting.

@jessiehaseyes
jessiejiranzhai@gmail.com
03 FORCES
NOC WEEK2


GO TO:
FORCES

For the forces assignment, I made a solar system simulation depicting 10 planets with proportional masses and forces.



PROCESS




The sketch for this week is a depiction of the solar system, and I wanted to use force and gravity to be as accurate as possible.




I first started with researching the proportional ratio of each planets, as well as their mass and gravity.
Since the P5 canvas is only so big, I need to made a few adjustments so everything are not too far apart to make it visually pleasing.



I first started with only using the sun as an attractor and the earth as a mover.
At first, I set the angle from the earth to the sun as 30 degrees, and the speed as 0.2. Then I realized I could simply these using the createvector function.





This was pretty exciting to apply what we learned from last week!
Since the angle pretty much represent rotation speed in the sketch, I then added another speed value and mass to my chart for reference.



The next thing I wasn’t so sure about was adding other planets as movers. I understand that I would need to use a for loop, so far I only know how to use for loop for the same object with equal distance. Since the planets have different diameters, speed, material, and masses, I wasn’t really sure how to go about it.

I first experimented with just another another planet, I already have an array for the movers and some values attached to the constructor, so I got the feeling I just need to add all the values that are different depending on the different planets and make them public.



My first attempt is pretty successful! Now you can see a tiny mercury rotating around!



I went ahead and added the other planets, weeee!

The next thing I wanted to do is to add a moon that rotate around the sun.



I bascially did what we had for planets, but translating the position of the moon to the planet that it is orbiting around, which is the moon.

I was getting a lot of bugs saying that the planet is not defined, which confused me for a while, then I realized it was because I put the if statement outside of the curly brackets for the planets.



Now I have a tiny moon that orbit around the earth!

In the future I would love to make this sketch interactive, for example using a slider to change the size of the planets or change the gravity to see how the planets orbit patterns would change.

A quick try:



thank you to my friend Ben for explaning physics to me <3



SOLVED PROBLEMS

  • making values public using constructor
  • making objects with different values using array
  • gravity and mass


REFERENCES

Forces - Nature of Code
Solar System - amcc
Planetary Fact Sheet - Ratio to Earth Values
 


JESSIEZHAI