Skip to content

Instantly share code, notes, and snippets.

@cust0m
Last active April 11, 2017 23:00
Show Gist options
  • Save cust0m/3accdb3b9b6b52a94b1b9776de522f82 to your computer and use it in GitHub Desktop.
Save cust0m/3accdb3b9b6b52a94b1b9776de522f82 to your computer and use it in GitHub Desktop.
def avegare_distance x1, y1, x2, y2, x3, y3
distance_1_2 = Math.sqrt(4)
distance_1_2 = Math.sqrt(((x1-y2)**2)+((y1-y2)**2))
distance_2_3 = Math.sqrt(((x2-y3)**2)+((y2-y3)**2))
distance_1_3 = Math.sqrt(((x1-y3)**2)+((y1-y3)**2))
(distance_1_2+distance_2_3+distance_1_3)/3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment