Skip to content

Instantly share code, notes, and snippets.

@Haleluak
Created June 10, 2020 04:37
Show Gist options
  • Save Haleluak/7d86e45dc07ab0f4606577e55cd78a9c to your computer and use it in GitHub Desktop.
Save Haleluak/7d86e45dc07ab0f4606577e55cd78a9c to your computer and use it in GitHub Desktop.
Social Distancing Detector
def Check(a, b):
dist = ((a[0] - b[0]) ** 2 + 550 / ((a[1] + b[1]) / 2) * (a[1] - b[1]) ** 2) ** 0.5
calibration = (a[1] + b[1]) / 2
if 0 < dist < 0.25 * calibration:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment