Calculating the distance between 2 points

后端 未结 7 2261
青春惊慌失措
青春惊慌失措 2020-12-17 18:37

I have two points (x1,y1) and (x2,y2). I want to know whether the points are within 5 meters of one another.

相关标签:
7条回答
  • 2020-12-17 19:39

    You can use the below formula to find the distance between the 2 points:

    distance*distance = ((x2 − x1)*(x2 - x1)) + ((y2 − y1)*(y2 - y1))
    
    0 讨论(0)
提交回复
热议问题