Issue with distance point-to-line I am having a small issue with the distance calculation of a point-to-line and I cannot find the mistake.
I have the line:
$$x + 2y + 3 = 0$$
And I am trying to compute its distance to point $(x_0, y_0) = (0,0)$. According to the well-known formula:
$$ d = \frac{\left|ax_0+by_0+c\right|}{\sqrt{a^2 + b^2}} = \frac{\left|3\right|}{\sqrt{5}} = 1.3416$$
Now, I try to compute the same distance on a different manner. The line intersects the $y$ axes at $p=(0, -1.5)$. I am trying to solve the following triangle (sorry for the cheap plotting):

The distance computed before should correspond to the length of the red segment (perpendicular to the line that goes through the desired point), which could also be computed as:
$$ d = 1.5 \cdot cos(30^{\circ}) = 1.299$$
Both results for the length of the red segment do not match. What am I doing wrong?
Thank you in advance!
 A: The angles are wrong - instead of $30^0$ it should be $\arctan(0.5) = 26.56^0$
A: Let's go through the process step by step instead of using a calculator/grapher, and (ultimately) verify Dhanvi's claim.
So, to find the distance from the line (call it $\ell$) to $(0,0)$, we will want the line perpendicular to $\ell$ through the origin (call this one $p$).
The equation of $p$ will have negative reciprocal slope to $\ell$ and $y$-intercept $0$. Then we have that
$$y_p (x) = 2 x$$
Meanwhile, $\ell$ has the equation
$$y_\ell(x) = -\frac 1 2 x - \frac 3 2$$
So your triangle has two points already: $(0,0)$ and $(0,-3/2)$. The third is where $\ell$ and $p$ intersect. Set the two equations equal and solve for $x$:
$$2x = - \frac 1 2 x - \frac 3 2 \implies x = - \frac 3 5$$
Substitution can get us that, then, the corresponding $y$ is at $y = -6/5$.
We can then find the distances between these points, and we get that
\begin{align*}
\Big( \text{distance from } (0,0) \text{ to } (0,-1.5) \Big) &= 1.5 \\
\Big( \text{distance from } (-3/5,-6/5) \text{ to } (0,-1.5) \Big) &= \frac{3}{2 \sqrt 5} \\
\Big( \text{distance from } (-3/5,-6/5) \text{ to } (0,0) \Big) &= \frac{3}{\sqrt 5}
\end{align*}
Obviously, one angle is formed by the first and last sides. It has angle $\theta$, and it will be given by
$$\theta = \arccos \left( \frac{3 / \sqrt 5}{1.5} \right) \approx \boxed{26.57^\circ}$$
This is where your problem lies. That top angle of your triangle is not $30^\circ$.
A: THe equation of  line:
$y=-\frac 12 x-\frac32$
Equation of red line:
$y=2x$
So the coordinates of intersection is : $(x=-\frac 35, y=\frac 65)$
The distance is:
$d=\sqrt {(-\frac 35)^2+(\frac{6}5)^2}=1.3416$
A: The polar form of the straight line is
$$ x\cos \alpha + y \sin \alpha = p =1.3496$$
where $\alpha = \cos^{-1}\dfrac{-1}{\sqrt 5}$ is counter-clockwise rotation of the red normal reckoned from x-axis lying in the third quadrant.
