Physics simulations I made during the WPI Frontiers program. My favorites are the 2D-wave, buoyancy, and boids.
View atL: https://www.glowscript.org/#/user/ToriD/folder/MyPrograms/
All programs have a run button and variables at the bottom to tweak before running. Ctrl+drag (cmd+drag on mac) in the program window orbits the camera, alt+drag or scroll zooms, and shift+drag pans.
These scripts implement simple wave propogation algorithms in 1D and 2D respectively. They simulate raindrops for display purposes, with variable raindrop force, amount, and size. They both also include a damping parameter to control how quickly waves decay.
A simple collision simulation with spheres of randomized size, density, and position.
This program simulates the "boids" algorithm, meant to mimic the flocking behavior of birds, fish, etc. The algorithm combines 3 "forces" to produce this effect:
- Cohesion - how much boids will stick in a pack vs as individuals
- Separation - how much boids will avoid getting too close to each other
- Alignment - how much boids try to match the velocities of surrounding boids
An extension of Balls, where the balls experience buoyancy in a liquid while colliding with each other.
A simulation of Earth and Mars orbiting the sun using Newtonian gravitational attraction. Will launch a satellite (also using Newton's formula for gravitational force) from Earth such that it will theoretically intercept Mars (through a pre-calculated angle to launch at). Because of imprecision in simulation it doesn't always hit the mark.
Run at at least 100,000x speed, because 1x speed is equivalent to how fast the planets actually move about the sun in realtime. Getting the zoom and camera orientation right on this one can be tricky.
The first project I did - simple projectile motion, with the addition of bouncing when it hits a table.