Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 914 Bytes

README.md

File metadata and controls

12 lines (8 loc) · 914 Bytes

Least Time to the Rescue

A paper and Python simulation applying the law of refraction and principle of least time to find the most time-efficient position for a lifeguard to jump into the water to save a drowning person using realistic values.

Dependencies

Every Python file uses sympy

simulation.py uses pygame

heatmap.py uses seaborn

Use

The Python files in this repository are the files used to generate the graphs used in the paper and are not of much use on their own. simulation.py is a simulation that visualises the straight path and lifeguard's path to the target with user-specified conditions. Click anywhere in the water region to set the target location and use w and s to move the lifeguard farther or closer to the waterfront, respectively. There is a bug in sympy that makes it fail to find any valid solutions when the target is close to the left edge of the screen.