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

Area between two points

How to calculate area between two points? Like p1 = (3,2) and p2 = (5,1). Please help.

28th Nov 2017, 2:04 AM
Clark Justine L. Gonzales
Clark Justine L. Gonzales - avatar
1 Answer
+ 2
Umm, points have no area. Neither do lines. Assuming you mean the distance, you can use Pythagoras' Theorem to find the distance (as Euler proposed): |AB| = โˆš(a**2 + b**2) where a and b are the difference between the x-coordinates and y-coordinates respectively. In this case, distance is โˆš((3-5)**2 + (2-1)**2) = โˆš(4+1) = โˆš5, approximately equal to 2.236. Hope this helped. ๐Ÿ˜‰
28th Nov 2017, 2:13 AM
blackcat1111
blackcat1111 - avatar