Reading Time: 1 minutesDistance between points on Cartesian Plane in Python
Distance between points on Cartesian Plane in Python
Given two points represented by coordinates i.e. (x1, y1) & (x2, y2), write a Python program to calculate distance between points on Cartesian Plane. The distance is calculated as square root of summation of squares of difference between corresponding x and y values.
distanceBetweenPoints = math.sqrt( ( (pointOne[ 0 ] - pointTwo[ 0 ]) * * 2 ) + ( (pointOne[ 1 ] - pointTwo[ 1 ]) * * 2 ) ) |
print (distanceBetweenPoints) |
See also: