muppirgautham / DISTANCE-BETWEEN-TWO-POINTS

DISTANCE BETWEEN TWO POINTS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DISTANCE-BETWEEN-TWO-POINTS

AIM:

To write a python program to find the distance two 2 points

ALGORITHM:

Step 1:

Import math library using import statement

Step 2:

Define the two points into two separate lists

Step 3:

Substitute the values in the distance formula image

Step 4:

Print the final value rounded upto two decimals using format function. It would display the distance value

Step 5:

End the program

PROGRAM:

#Program to find the distance between two points.
#Developed by: GAUTHAM M G
#RegisterNumber: 21000182
import math
l1=[10,6]
l2=[4,2]
dist=math.sqrt(((l1[0]-l2[0])**2)+((l1[1]-l2[1])**2))
print("{:.2f}".format(dist))

OUTPUT:

image

RESULT:

Thus the python program to find the distance two points is successfully executed.

About

DISTANCE BETWEEN TWO POINTS

License:BSD 3-Clause "New" or "Revised" License