I'm aware that a very similar question has been asked before (Question 888147) but this one is its 3D version, which doesn't seem to easily generalize.
I'm given two lines $\ell_1$ and $\ell_2$ that intersect at the origin, and I'd like to know what the locus of the points such that $$\text{d}(X,\ell_1)=k\cdot\text{d}(X,\ell_2)$$ looks like.
I know that if a point $X$ has this property, multiplying it by a scalar yields another point with it, which leads me to suspect the shape I'm looking for is some kind of double cone (or two of them, as analogy with the 2D case makes me suspect), but I'm clueless on how to prove this.
Since I don't even have a formula for distances between points and lines in 3D in terms of the coordinates, I really don't know where to start.
A formula for the distance from a point to a line shows that the condition $\operatorname d((x, y, z), l_2) = k \operatorname d((x, y, z), l_1)$ gives a quadric surface. The quadric is symmetric wrt the plane containing $l_1$ and $l_2$. If we already know that the cross-section by this plane is a pair of lines and also know that the quadric is not a pair of planes for $k \neq 1$, it follows that the only possibility is a cone.
If we choose a coordinate system such that $l_1$ goes through the origin in the $x$ direction and $l_2$ goes through the origin in the direction $(\cos \phi, \sin \phi, 0)$ and rotate the lines by the angle $$-\arctan(k^2 - \cos 2 \phi, -\sin 2\phi)/2$$ around the $z$ axis from the positive $x$ direction to the positive $y$ direction to eliminate the $x y$ term, the equation of the cone becomes $$\frac {1 - k^2 + \rho} 2 x^2 + \frac {1 - k^2 - \rho} 2 y^2 + (1 - k^2) z^2 = 0, \\ \rho = \sqrt {1 + k^4 - 2 k ^2 \cos 2 \phi}.$$