I know that for a two dimensional line, there are two degrees of freedom $(\theta, d)$ where $\theta$ is the angle that the normal makes with the $x$ axis, and $d$ is the distance from the line to the origin.
For a three dimensional line, I was reading this question here: 4-dof of a 3d line
The argument for $4$ degrees of freedom for a line in $3$d that I understood the best says that each line is tangent to a unique sphere of radius $r$, intersecting at a point $m = (r, \theta, \phi)$ in spherical coordinates. Then the angle that the line's direction vector makes with the ray from the center of the sphere to the point $m$ is the final degree of freedom.
I'm wondering if there is a generalization to lines of $n$ dimensions. I would be tempted to say it's $n+1$ degrees of freedom, however this isn't true for $n=2$. Any insights appreciated.