I am doing a straight line best fit for certain data set. I am using the normal form of straight line. Suppose I have a set of points (x_1,y_1), (x_2,y_2), ... , (x_n,y_n). Suppose the normal form of a straight line is x*cos(theta) + y*sin(theta) = r.
So in my case I have the following set of equations:
x_1 cos(theta) + y_1 sin(theta) = r
x_2 cos(theta) + y_2 sin(theta) = r
...
x_n cos(theta) + y_n sin(theta) = r
I want to solve the equation for theta and r in least square fashion & trying to write the equations in the form of Ax=b. But in this case I can't separate the unknowns in vector x to solve the equations. Any suggestion?