Equation of a straight line in polar coordinates

1,744

As hinted by David Holden, sign of my slope equation was wrong, since during change of Δx, y changed by -Δy, not +Δy.

Share:
1,744

Related videos on Youtube

Puchatek
Author by

Puchatek

Software Developer at レキサス

Updated on August 01, 2022

Comments

  • Puchatek
    Puchatek over 1 year

    For line detection with Hough transform a line equation in Cartesian coordinates

    y = m⋅x + b (1)
    

    is transformed to polar coordinates to become:

    p = x⋅cos(θ) + y⋅sin(θ) (2)
    

    I'm trying to prove (2) from (1), but keep on getting

    p = -x⋅cos(θ) + y⋅sin(θ) (2)
    

    I attached my derivation below:

    Derivation

    Can anyone point me to where am I making a mistake?

    • David Holden
      David Holden almost 7 years
      check your expression for "m" with particular attention to the sign
    • Puchatek
      Puchatek almost 7 years
      @DavidHolden I appreciate that flipping sign on it I would get expected result, but don't see why that should be done. Slope of a line is defined by Δy/Δx, not -Δy/Δx
    • David Holden
      David Holden almost 7 years
      yes but Δx is negative! think about the definition of the slope of a line
    • Adriano
      Adriano almost 7 years
      $\sin\theta = \frac{\rho}{\Delta y}$ is incorrect, since the length of a hypotenuse should be positive, but here $\Delta y < 0$. You should have $\sin\theta = \frac{\rho}{- \Delta y}$.
    • Puchatek
      Puchatek almost 7 years
      @DavidHolden Ah, now I finally get it. Slope is a change of y during change in x. From 0 to x, or change Δx, y changed by -Δy. Thank you, a feel really silly now.
    • David Holden
      David Holden almost 7 years
      don't feel silly, it was an easy mistake to make, and having made it, the conclusion seems so logical that it is then difficult to find the flaw in the line of reasoning.