Skip to content

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.

License

Notifications You must be signed in to change notification settings

suranwarnakulasooriya/Least_Time_to_the_Rescue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Languages