Skip to content

Instantly share code, notes, and snippets.

@zdw
Created November 3, 2013 22:00
Show Gist options
  • Save zdw/7295363 to your computer and use it in GitHub Desktop.
Save zdw/7295363 to your computer and use it in GitHub Desktop.
for pam
import math
p = [5,10]
q = [9,12]
print math.sqrt((p[0] - q[0])**2+(p[1] - q[1])**2)
@zdw
Copy link
Author

zdw commented Nov 3, 2013

when run, prints "4.472135955", which is the same as when done through bc with "sqrt((5-9)^2+(12-10)^2)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment