Distance between two lines, passing through origin How could I find the distance between two lines if I want that distance to be measured through a point (such as the origin)? The two lines would be straight lines, such as x=20, y=-15. The solution would create a triangle shape once the distance is introduced.
My goal is to further this by finding a way to check different distances from other possible points on those lines, while keeping the distance through the origin as a straight line. I'd also like to be able to find the angle of that distance.
Basically, I want to rotate the hypotenuse on the origin to find different angles and triangle dimensions.
 A: Let us suppose first that the two given lines are non-degenerate, i.e. they have the form $r_1: y=m_1 x + n_1$ and $r_2: y=m_2 x + n_2$, with $m_1,m_2 < \infty$. There is a third (unknown) line $r_3$, passing through the origin, with equation $y = mx$. If we had $m$ we could compute the intersection points $P_1$ and $P_1$, of $r_3$ with $r_1$ and $r_2$ as
$$x_1 = \frac{n_1}{m-m_1}, \; y_1 = m_1(\frac{n_1}{m-m_1}) + n_1$$
and 
$$x_2 = \frac{n_2}{m-m_2}, \; y_2 = m_2(\frac{n_2}{m-m_2}) + n_2.$$
Now, the Euclidean distance between $(x_1,y_1)$ and $(x_2,y_2)$ is
$$d(P_1,P_2)=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2},$$
which we want to minimize. 
Then we just have to find the value of $m$ that minimizes $d(P_1,P_2)$. That involves computing the derivative of $d(P_1,P_2)$ with respect to $m$, equating the derivative with zero, and then solving for $m$.
A: The horizontal line $(HL)$ has equation $y=-b$ with $b>0$.
The vertical line $(VL)$ has equation $x=a$ with $a>0$
$A(-t,-b)$ is an arbitrary point on $HL$ in the third quadrant $(t>0)$
$B(a,y)$ is the point on $VL$ such that $B$ is in the first quadrant ($y>0$) and $AOB$ is a straight line where $O$ is the origin.
the slopes of $AO$ and $OB$ are equal so that $\frac{y}{a}=\frac{b}{t}$ and $y=\frac{a b}{t}$
we can now calculate the length of the hypotenuse
$\text{AB}=\sqrt{(a+t)^2+\left(\frac{a b}{t}+b\right)^2}=\frac{a+t}{t}\sqrt{t^2+b^2}$
The derivative of this function is equal to $\frac{t^3-a b^2}{t^2 \sqrt{t^2+b^2}}$
so the hypotenuse is minimal when $t=\sqrt[3]{a b^2}$ and 
the shortest distance is given by $b\left(1+\left(\frac{a}{b}\right)^{2/3}\right)^{3/2}$
EDIT: 
a simpler form for the shortest distance: $\left(a^{2/3}+b^{2/3}\right)^{3/2}$
and the angle is given by $\tan  \theta = \left(\frac{b}{a}\right)^{1/3}$
Horizontal leg: $a^{1/3}\left(a^{2/3}+b^{2/3}\right)$
Vertical leg :   $b^{1/3}\left(a^{2/3}+b^{2/3}\right)$
