Given 2 points (x1,y1), (x2,y2) I wish to estimate a line defined by [cos(θ) sin(θ) -r], where r is the distance from origin to the line along a vector perpendicular to the line, and the angle theta is between the x-axis and the vector.
I am not quite sure, how one would do this.
First, find the slope of the line, $m = \tan \theta$ (where $\theta$ is the angle made by the line to the positive x axis) by using
$$ m = tan \theta = \frac{y_2 - y_1}{x_2 - x_1} $$
Hence, $$\theta = \tan^{-1}m $$
Next, find the equation of the line with point-slope form:
$$ y - y_1 = m(x - x_1) \\ y - y_1 - mx + mx_1 = 0 \\ - mx + y + (- y_1 + mx_1) = 0 \ \ \text{(equation of line)} $$
Now that you have the slope, the next thing you wanted was the perpendicular distance from the origin. This is equal to $$ d = \frac{|c|}{\sqrt{a^2 + b^2}} $$
where $a, b, c$ are the coefficients of the general line equation
$$ ax + by + c = 0 $$
Comparing to our line equation,
$$ a = -m \\ b = 1 \\ c = -y_1 + mx_1 $$
And hence
$$ r = \frac{|-y_1 + mx_1|}{\sqrt{(-m)^2 + 1}} = \frac{|y_1 - mx_1|}{\sqrt{(m)^2 + 1}} $$