Skip to content

Instantly share code, notes, and snippets.

@superscott
Created March 7, 2014 22:41
Show Gist options
  • Save superscott/9421702 to your computer and use it in GitHub Desktop.
Save superscott/9421702 to your computer and use it in GitHub Desktop.
shitty math
n1 = ARGV[0]
n2 = ARGV[1]
e1 = ARGV[2]
e2 = ARGV[3]
n = n1.to_f - n2.to_f
e = e1.to_f - e2.to_f
nn = n * n
ee = e * e
puts "N^2: #{ n * n }"
puts "E^2: #{ e * e }"
puts "Left: #{ nn + ee }"
left = nn + ee
sqt = Math.sqrt(left)
puts "C: #{ sqt }"
### (N1-N2)^2 + (E1-E2)^2 = C^2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment