In a 3D Euclidean Cartesian space, a plane can be represented by the vector from origin to the nearest point in plane. This vector can be expressed in spherical coordinates $(r,\theta,\phi)$, with the condition that vector $(1,\theta,\phi)$ must be always orthogonal to the plane (this additional condition is necessary for the case when origin is included in the plane, r=0). Moreover, $r \ge 0$, $0 \le \theta \lt 2\pi$ and $0 \le \phi \le \pi$, $\theta=0$ if $\phi=0$ or $=\pi$, as usual for uniqueness of a point in spherical coordinates, and $\theta<\pi$ if $r=0$ as @Berci comment explains.
This representation is specially useful for my objectives because every plane has one and only one representation (for a plane, it is the only representation I known that fulfills this condition).
I'm looking now for an equivalent in the case of a line in 3D space. A starting point can be the vector from origin to nearest point in line, given also in spherical coordinates, $(r,\theta,\phi)$. In addition, a unary vector to define the line direction $(1,\theta',\phi')$.
However, this representation is not unique, it has one degree of freedom. The origin of this indeterminate in the representation is that vectors $(r,\theta,\phi)$ and $(1,\theta',\phi')$ must be orthogonal, but this condition is not implicit in (used to define) the definition of the line representation. $tan(\phi)tan(\phi')cos(\theta-\theta')=-1$.
Kwons someone a 3D line representation, valid for any line and unique for each one ? Or it doesn't exists ?