[Math] Obtain polar form of a line from two points

polar coordinates

I need to work with the lines in polar form, but i only have two points in cartesian form for each line. I tried this:

From the points, i got the slope-intercept form: $$y = mx + b$$From this url: $$y = (-cos(ø)/sin(ø))x + (r/sin(ø)) $$
Then: $$m = -cos(ø)/sin(ø) => tan(ø) = -1/m => ø = arctan(-1/m) $$
$$b = r/sin(ø) => r= bsin(ø) $$

But it didn't work. I never worked before with polar coordinates so i'm completely lost. Also, as you noticed i'm not a math guy. Can someone give me a hand and tell me why this reasoning is wrong? A solution to the problem would be also very welcome.

Thanks in advance!

Best Answer

If you have the slope-intercept form $y=mx+b$, you can substitute $y=r\sin\theta$ and $x=r\cos\theta$ to get $r\sin\theta=m(r\cos\theta)+b$, and then solving for $r$ in terms of $\theta$ gives $r=\frac{b}{\sin\theta-m\cos\theta}$.

More generally, if the line has equation $ax+by=c$, you can solve for $r$ in terms of $\theta$ to get $r=\frac{c}{a\cos\theta+b\sin\theta}$.