How can I tell if a point belongs to a certain line?

前端 未结 11 2220
你的背包
你的背包 2020-12-01 08:22

How can I tell if a point belongs to a certain line?

Examples are appreciated, if possible.

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 08:50

    y = m * x + c
    

    This is the equation of a line. x & y are the co-ordinates. Each line is characterized by its slope (m ) and where it intersects the y-axis (c).

    So given m & c for a line, you can determine if the point (x1, y1) is on the line by checking if the equation holds for x = x1 and y = y1

提交回复
热议问题