Using The Pearson Complete Guide For Aieee 2/e
By Khattar as a point of reference for the items below.
You want to convert
$$\tag 1 x-2y-3=0$$
into normal (perpendicular) form.
We have:
$$Ax + By = -C \rightarrow (1)x + (-2)y = -(-3)$$
This means $C \lt 0$, so we divide both sides of $(1)$ by:
$$\sqrt{A^2 + B^2} = \sqrt{(1)^2 + (-2)^2} = \sqrt{5}$$
This yields:
$$\dfrac{1}{\sqrt{5}} x - \dfrac{2}{\sqrt{5}} y = -\dfrac{-3}{\sqrt{5}}$$
In normal form, this is:
$$\cos(\alpha)~x + \sin(\alpha)y = p \rightarrow \dfrac{1}{\sqrt{5}} x - \dfrac{2}{\sqrt{5}} y = -\dfrac{-3}{\sqrt{5}}$$
Note that this has a positive $x$ coordinate, and a negative $y$ coordinate, which puts us in the $4^{th}$ quadrant.
So, we have:
$$\cos(\alpha) = \dfrac{1}{\sqrt{5}}, \sin(-\alpha) = -\dfrac{2}{\sqrt{5}} , p = -\dfrac{-3}{\sqrt{5}} = \dfrac{3}{\sqrt{5}}$$
This gives us:
$$\alpha \approx 1.10714871779409 ~\mbox{radians}~ \approx 63.434948822922 {}^{\circ}$$
Since we are in the $4^{th}$ quadrant, we can write this angle as:
$$\alpha \approx 2 \pi - 1.10714871779409 ~\mbox{radians}~ \approx 5.176036589385497 ~\mbox{radians}~ \approx 296.565 {}^{\circ}$$
As another reference point, see $10.3.4$ (including examples) at Straight Lines.
The general equation $ax+by+c=0$ of a straight line in $\mathbb R^2$ can be rewrtten as $\mathbf n\cdot\mathbf x=-c$, with $\mathbf n\ne0$. This form of the equation tells us that a line can be characterized as the set of points that have the same dot product with some fixed vector $\mathbf n$. If we normalize $\mathbf n$ by dividing both sides of the equation by its length, we have $${\mathbf n\over\|\mathbf n\|}\cdot\mathbf x=-{c\over\|\mathbf n\|}.$$ This is the so-called normal form of the equation for the line, characterized by $\mathbf n$ being a unit vector. The left-hand side of this equation is the (signed) length of the orthogonal projection of $\mathbf x$ onto $\mathbf n$, so an equivalent way to charactere the line is as the set of vectors $\mathbf x$ that have the same projection $\mathbf x_\parallel$ onto $\mathbf n$. The remainder $\mathbf x-\mathbf x_\parallel$ is perpendicular to $\mathbf n$, from which we can see that $\mathbf n$ is perpendicular to the line, and so the (perpendicular) distance of the line from the origin is ${|c|\over\|\mathbf n\|}$. Substituting the coefficients from the original equation yields the normal equation $${a\over\sqrt{a^2+b^2}}x+{b\over\sqrt{a^2+b^2}}y={-c\over\sqrt{a^2+b^2}}.$$ Since we have a unit normal, we can replace the coefficients on the left-hand side: $$x\cos\alpha+y\sin\alpha={-c\over\sqrt{a^2+b^2}},$$ where $\alpha$ is the angle made by the normal vector with the $x$-axis.
Now, as far as your equation (a) is concerned, remember that in computing $\tan\alpha$, you canceled a constant of proportionality that appeared in both the numerator and denominator, so the most that you can conclude from it is that the length of the hypotenuse of $\triangle{OAD}$ is proportional to $\sqrt{a^2+b^2}$. Indeed, in your diagram you have two other triangles that are similar to $\triangle{OAD}$: $\triangle{BOD}$ and $\triangle{BOA}$, so we have $$\tan\alpha = {\overline{AD}\over\overline{OD}} = {\overline{OD}\over\overline{BD}}={\overline{OA}\over\overline{OB}}.$$ The legs of the largest of these are the hypotenuses of the smaller ones, so there are at least two different lengths of hypotenuse in play. Moreover, it might be that none of the lengths is equal to $\sqrt{a^2+b^2}$!
Best Answer
There is a simple derivation of what you want to know. Without going into details, let me introduce the result:
Since you want distance of line from origin, the coordinates become $(0,0)$ and hence the perpendicular distance of a line from origin is $|\frac{Ax'+By'+c}{\sqrt{A^2+B^2}}|=|\frac{0+0+c}{\sqrt{A^2+B^2}}|=|\frac{c}{\sqrt{A^2+B^2}}|$.