If a line is given by $\vec{p}\cdot\vec{n}=d$ where $\vec{p}=(x,y)$ is a point on the line, then $\vec{n}$ is the unit normal vector to the line (perpendicular direction) and $d$ is the minimum distance to the origin. For your case you have $ \vec{p}\cdot(0.3511,0.9263)=6 $, but unfortunately $\vec{n}$ is not a unit vector here. To make it a unit vector you have
$$ \vec{p}\cdot(0.3544,0.9351)=6.0569 $$
with $\vec{n}=(0.3544,0.9351)$ and $ d=6.0569 $. The distance between the point P and the closest point to the line is the perpendicular projection of the difference between P and A where is any point on the line. I choose the point A with coordinates $\vec{a}=\vec{n}\,d=(2.1467,5.6637)$ representing the closest point of the line to the origin. The distance of P with the line is $r=\vec{n}\cdot(\vec{p}-\vec{a})$ or
$$ r = \vec{n}\cdot\vec{p}-d $$
with $r = 16.189 $ for P=(10,20).
The point P' closest to the line is offset from P by $r$, with the equation $\vec{p}'=\vec{p}-\vec{n}\,r = \vec{p}-\vec{n}(\vec{n}\cdot\vec{p}-d) $, or
$$ \vec{p}' = \vec{p}-(\vec{n}\cdot\vec{p}-d)\vec{n} $$
with $\vec{p}'=(4.2621,4.8619)$
Here is the checks I did with GeoGebra.
So proceed similarly with point Q = (4,3) to get Q' and the distance between P' and Q' as 0.415
Best Answer
Suppose the two lines are given by $At+a$ and $Bs+b$, where $a$ is a fixed point on one, $b$ on the other. Then the vector between a point on each line is $$ At-Bs+(a-b). \tag{1}$$ Hence the problem is mathematically the same as finding the shortest distance from the plane given by $ At-Bs $ to the point $a-b$.
The shortest distance is when the vector in $(1)$ is perpendicular to $A$ and $B$, i.e. a multiple of $A \times B$, which is nonzero since $A \not\parallel B$ and $A,B \neq 0$. Hence we have $$ At^*-Bs^*+(a-b) = \nu (A \times B), $$ for the optimal values $t^*,s^*$.
We can now get straight to $\nu$ by dotting with $A \times B$: $$ (a-b) \cdot (A \times B) = \nu\lVert A \times B \rVert^2. $$ The length of the vector (and hence the distance between the lines) is then $$ \lVert \nu (A \times B) \rVert = \lvert \nu \rvert \lVert A \times B \rVert = \frac{\lvert (a-b) \cdot (A \times B) \rvert}{\lVert A \times B \rVert^2} \lVert A \times B \rVert = \frac{\lvert (a-b) \cdot (A \times B) \rvert}{\lVert A \times B \rVert}. $$