Check is a point (x,y) is between two points drawn on a straight line

后端 未结 7 902
青春惊慌失措
青春惊慌失措 2020-11-27 06:18

I have drawn a line between two points A(x,y)---B(x,y) Now I have a third point C(x,y). I want to know that if C lies on the line which is drawn between A and B. I want to

相关标签:
7条回答
  • 2020-11-27 06:55

    An easy way to do that I believe would be the check the angle formed by the 3 points. If the angle ACB is 180 degrees (or close to it,depending on how accurate you want to be) then the point C is between A and B.

    0 讨论(0)
提交回复
热议问题