# Find the normal position vector to line

I wish to represent a line which is defined by $2$ points $(x_1,y_1), (x_2,y_2)$ by polar coordinates $(r, \theta)$ instead of $(m, b)$ so that I can avoid infinity with vertical line.

To do that, I figure I need to find the point lying on the line and position vector is normal to the line. How do I calculate that?

• A point on the line: $\;(x_1,y_1)\;$ , direction vector of the line determined by those two points: $\;\vec u:=(x_2-x_1,\,y_2-y_1)\;$ ...is this what you want? – DonAntonio Mar 25 '17 at 10:18
• You don’t need to use polar coordinates to avoid the vertical infinity. Write the equation of the line in the form $ax+by+c=0$. – amd Mar 25 '17 at 15:39
• You already have two points that lie on the line and can use them to compute a vector that’s parallel to it. Use the fact that the dot product of orthogonal vectors is zero to find a normal. – amd Mar 25 '17 at 15:40