I have a line segment given by two points $A$ and $B$. $$A+u(B-A), u\in[0,1]$$

when doing calculations with this segment, it would be advantageous to have it written in polar coordinates around some point $S$. More specifically, in the form $$r=f(\phi)$$

I could brute force this expression but the result starts getting ugly, fast. Is there some insight I can use that would give me a simpler definition of $f$ using $A$, $B$ and $S$?

  • $\begingroup$ What is the meaning of point $S$? Since that is not clear, I used the origin in my answer. $\endgroup$ – Rory Daulton Aug 3 '15 at 0:17
  • $\begingroup$ S is supposed to be the relative origin of the polar coordinates. $\endgroup$ – Luka Horvat Aug 3 '15 at 0:22
  • $\begingroup$ Is $S$ given, or can the answerer choose $S$? And are $r$ and $\phi$ then relative to $S$? $\endgroup$ – Rory Daulton Aug 3 '15 at 0:36
  • $\begingroup$ S is given, and yes, $r$ and $\phi$ are relative to it. $\endgroup$ – Luka Horvat Aug 3 '15 at 10:52

Let's assume that points $A$ and $B$ are $(x_1,y_1)$ and $(x_2,y_2)$ in Cartesian coordinates and $(r_1,\theta_1)$ and $(r_2,\theta_2)$ in polar coordinates.

Then the direction angle of the line segment is given by

$$\theta_0=\begin{cases} \tan^{-1}\left(\frac{y2-y1}{x2-x1}\right), & x_1\ne x_2 \\ \frac{\pi}2, & x_1=x_2 \end{cases} $$ And the signed distance from the origin to the line containing points $A$ and $B$ is


(Use either formula for $d_0$: you get the same result.) If $d_0\ne 0$ then the line containing points $A$ and $B$ does not pass through the origin, and the polar equation of that line is


and to get only the segment on the line just require that $\theta$ is between $\theta_1$ and $\theta_2$.

If $d_0=0$ then the line containing points $A$ and $B$ does pass through the origin, and thus $r$ is not a function of $\theta$ and another kind of polar equation will be required to specify the line, such as $\theta=\theta_1$ with $r$ limited to be between $r_1$ and $r_2$.

Note that the "distance" $d_0$ may be negative. If that is not desired, replace $d_0$ with $-d_0$ and $\theta_0$ with $\theta_0+\pi$ or $\theta_0-\pi$.

This diagram explains much of those formulas.

enter image description here

  • $\begingroup$ That extremely neat. I am having trouble seeing how the formula for r is derived. $\endgroup$ – Luka Horvat Aug 3 '15 at 12:50
  • $\begingroup$ @LukaHorvat: From the diagram you can see that $d_0=r_1\sin(\theta_1-\theta_0)$ (up to $\pm$). But that same will hold for any other point on the line: $d_0=r\sin(\theta-\theta_0)$, so $r=\frac{d_0}{\sin(\theta-\theta_0)}$. I left out the general point in my diagram, thinking it would just clutter the diagram. Is it clear now? $\endgroup$ – Rory Daulton Aug 3 '15 at 14:48
  • $\begingroup$ Yes! Thanks for answering! $\endgroup$ – Luka Horvat Aug 3 '15 at 15:14
  • $\begingroup$ Do you know any way of getting $\theta_0$ (angle or slope) without converting to Cartesian coordinates? $\endgroup$ – Fernando Pelliccioni Feb 22 '16 at 17:49
  • $\begingroup$ @FernandoPelliccioni: I can see several ways, but probably the simplest is to substitute $x_1=r_1\cos\theta_1$ etc. into my formula for $\theta_0$, giving $$\theta_0=\tan^{-1}\left(\frac{r_2\sin\theta_2-r_1\sin\theta_1}{r_2\cos\theta_2-r_1\cos\theta_1}\right)$$ for the denominator non-zero, or $\pi/2$ otherwise. $\endgroup$ – Rory Daulton Feb 22 '16 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.