The equation $x^2+y^2=0$ in $\mathbb{R}^2$ gives a degenerate circle of radius $0$ which is simply the point at the origin. In $\mathbb{R}^3$, the equation $x^2+y^2=0$ would be the point at the origin extruded along the z-direction which results in the line containing the z-axis. Since this gives the equation of a line in $\mathbb{R}^3$, by applying rotations and translations to the implicit equation of the z-axis line should mean that all lines in $\mathbb{R}^3$ can be described implicitly.
Given any line in $\mathbb{R}^3$, it is always possible to introduce a new coordinate system $\{x', y',z'\}$ centred at a point on the line $(x_0, y_0, z_0)$ and with the z' axis pointing in the direction of the line. The specific location of the x' and y' axis shouldn't matter as long as they are perpendicular to the z' axis due to the rotational symmetry around the z' axis. Then, the equation of the line in the $\{x', y',z'\}$ coordinate system should be $(x')^2+(y')^2=0$. The equation can then be rewritten with the $\{x, y, z\}$, coordinate system with a change of basis.
It should only take two rotations and one translation since spherical coordinates require two angular variables to describe any point on the unit sphere. The notation from spherical coordinates where $\theta$ represents the polar angle from the z-axis and $\phi$ represents the azimuthal angle from the x-axis will be used from now on. The change of basis should be as follows:
$ \begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}x_0\\y_0\\z_0\end{bmatrix}+\begin{bmatrix}\cos\phi && -\sin\phi && 0 \\ \sin\phi && \cos\phi && 0 \\ 0 && 0 && 1\end{bmatrix}\begin{bmatrix}\cos\theta && 0 && \sin\theta \\ 0 && 1 && 0 \\ -\sin\theta && 0 && \cos\theta\end{bmatrix}\begin{bmatrix}x'\\y'\\z'\end{bmatrix} \\ \begin{bmatrix}x-x_0\\y-y_0\\z-z_0\end{bmatrix}=\begin{bmatrix}\cos\phi && -\sin\phi && 0 \\ \sin\phi && \cos\phi && 0 \\ 0 && 0 && 1\end{bmatrix}\begin{bmatrix}\cos\theta && 0 && \sin\theta \\ 0 && 1 && 0 \\ -\sin\theta && 0 && \cos\theta\end{bmatrix}\begin{bmatrix}x'\\y'\\z'\end{bmatrix} \\ \begin{bmatrix}\cos\phi && \sin\phi && 0 \\ -\sin\phi && \cos\phi && 0 \\ 0 && 0 && 1\end{bmatrix}\begin{bmatrix}\cos\theta && 0 && -\sin\theta \\ 0 && 1 && 0 \\ \sin\theta && 0 && \cos\theta\end{bmatrix}\begin{bmatrix}x-x_0\\y-y_0\\z-z_0\end{bmatrix}=\begin{bmatrix}x'\\y'\\z'\end{bmatrix} $
By multiplying out those matrices and substituting the result for $x', y', (\text{and }z')$ into the equation $(x')^2+(y')^2=0$, this should give the implicit equation of a line in $\mathbb{R}^3$ containing the point $(x_0, y_0, z_0)$ in the direction given by the angular variables $\theta$ and $\phi$. My question is whether this result is actually correct? Does this actually produce the implicit equation of any line in $\mathbb{R}^3$? If it is, how come I have never seen it written anywhere before? Does the non-existence of the z' variable in the equation matter at all or break it?
You don't need rotation matrices at all, because the equation of a cylinder in $x,y,z$ whose axis passes through the point $\mathbf{P_0}$ and is parallel to the unit vector $\mathbf{a}$, and is of radius $R$ is given by
$ (\mathbf{p - P_0})^T (I - \mathbf{aa}^T ) (\mathbf{p - P_0} ) = R^2 $
Therefore, setting $R = 0 $ gives a quadratic equation of a line passing through $\mathbf{P_0}$ and whose direction vector is along $\mathbf{a} $
For example, if the unit direction vector of the line is
$ \mathbf{a} = \dfrac{1}{9} (1, 4, 8) $
Then
$(I - \mathbf{aa}^T ) = \dfrac{1}{81} \begin{bmatrix} 80 && -4 && - 8 \\ -4 && 65 && -32 \\ -8 && -32 && 17 \end{bmatrix} $
Moreover, suppose $\mathbf{P_0} = (2, 5, 12) $ then the equation of the line is
$ 80 (x - 2)^2 +65 (y - 5)^2 +17(z - 12)^2 - 8 (x - 2)(y - 5)\\ - 16 (x - 2)(z - 12) - 64 (y-5)(z - 12) = 0 $
Grouping terms, this equation becomes
$ 80 x^2 + 65 y^2 + 17 z^2 - 8 x y - 16 x z - 64 y z\\ - 88 x + 134 y - 56 z + 89 = 0 $
When feeding this equation to WolframAlpha it generates the following solution
$ y = 4 x - 3 , z = 8 x - 4 $
i.e.
$ (x, y, z) = (0, -3, -4) + t (1, 4, 8) $
Note that the point $(2, 5, 12)$ lies on this line (by choosing $t = 2$ ).