Find perpendicular line using points on that line

后端 未结 2 810
情歌与酒
情歌与酒 2021-01-16 19:23

I have a line (P1, P2), and a point on that line (midpoint). What equation can I used to find the perpendicular line of line (P1, P2), that passes through midpoint. The poin

2条回答
  •  青春惊慌失措
    2021-01-16 19:50

    Coordinates of P1: (x1,y1) Coordinates of P2: (x2,y2)

    Coordinates of midpoint: ( (x1+x2)/2 , (y1+y2)/2) Slope of the P1P2 line: (y1-y2)/(x1-x2) Slope of any perpendicular line to P1P2: (x2-x1)/(y1-y2)

    Equation of the red line: y - (y1+y2)/2 = ((x2-x1)/(y1-y2))*(x - (x1+x2)/2)

    If you have the actual values of coordinates of P1 y P2, then just make a substitution.

提交回复
热议问题