Distance between two points | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Distance between two points

15th Feb 2022, 11:53 AM
Ambica Yarramsetti
2 Antworten
+ 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 - avatar
+ 1
Sqrt((Xa - Xb)^2 + (Ya - Yb)^2) Pythagoras theorem
15th Feb 2022, 12:01 PM
WildGeese - avatar