Processing math: 100%
< Back

Distance

Write a Python function distance(x1, y1, x2, y2) that returns the distance between the specified two-dimensional points, (x1, y1) and (x2, y2). The distance, d, between two points can be calculated with the equation:

d=(x1x2)2+(y1y2)2