Distance between two points | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Distance between two points

15th Feb 2022, 11:53 AM
Ambica Yarramsetti
2 Answers
+ 6
Ambica Yarramsetti , as already mentioned, you can use the formula in the above post. but python also has the dist() function in the math library to perform requested task: from math import dist print(dist((17,5),(22,11)))
15th Feb 2022, 4:08 PM
Lothar
Lothar - avatar
+ 1
Sqrt((Xa - Xb)^2 + (Ya - Yb)^2) Pythagoras theorem
15th Feb 2022, 12:01 PM
WildGeese
WildGeese - avatar