TITLE: How to construct a line with a given equal distance from 3 Points in 3 Dimensions?
QUESTION [10 upvotes]: Important: I'm now convinced that 4 points are needes in order to reduce the solutions to a finite number. (Which is necessary because I need ALL solutions)
In a computer science context I need to solve a geometrical problem which states:

Given three points in three-dimensional space, find a line $L$ (in any form, e.g. specify two points which lie on the line) so that the distance between each of the points and $L$ are equal to a given distance $d$, if possible.

By distance between a point $P$ and a line $L$, the euclidean distance between $P$ and the foot of the perpendicular on $L$ that passes through $P$ is meant.
In two dimensions (given two points) this is rather simple as it involves only a few trigonometric functions, altough I really struggle with it in three dimensions. The reason surely is that I'm not from a math background and don't know too much about linear algebra (which I believe is involved here).
It would be ideal if there is a solution for $N$ dimensions (I think that $N$ Points are needed then), altough I would be very happy if someone could give at least some hints about the three dimensional problem (maybe some sort of heuristic that i didn't thought of could also work). :)
EDIT: Clarification
The distance between the points and the line is a given constant. Example: 
Given three Points and a distance $d=3$, I want to find the line which has a distance of $d$ (in this case $3$) to every given point, if possible (of course there are many cases where such a line does not exist). And I am aware of the fact that this line is not unique (several, or in case of colinearity of the three points, infinitely many lines exist)
EDIT: Clarification II
It seems that my wording causes much confusion about exactly WHAT properties the line should have. A picture showing the two-dimensional case follows:

In this case the Points $P_1$ and $P_2$ are given and the task was to find the line $g$ such that every given Point has the same shortest distance $r_B$ (which is preset) to $g$. (In this context the line was specified by a point $C$ and the angle $\alpha$, altough I'm happy with any kind of parameterization).
Now I have given 3 three-dimensional points and want to find a line with the described properties and I do not have any idea how to do this.
EDIT III: 
I should also have mentioned that I should be able to find all solutions (I am 99% convinced that there is only a finite number of solutions for ordinary cases)

REPLY [2 votes]: As you have already noted, three points is not enough in general. In most case, you will need four points to constrain the line completely. Using Plücker coordinates makes this point obvious. For a line defined by Plücker coordinates 
$$p_{01},p_{02},p_{03},p_{23},p_{31},p_{12}$$
the distance $d$ between a point $(x,y,z)$ and the line satisfies
$$d^2=(p_{01}+zp_{31}-yp_{12})^2+(p_{02}+xp_{12}-zp_{23})^2+(p_{03}+yp_{23}-xp_{31})^2,$$ provided that $p_{23}^2+p_{31}^2+p_{12}^2=1$.
The Plücker coordinates obey $$p_{01}p_{23}+p_{02}p_{31}+p_{03}p_{12}=0$$ and you can always normalize them so that $$p_{23}^2+p_{31}^2+p_{12}^2=1.$$
The four points and the two equations above yield a system of six equations for six unknowns. It can be easily solved numerically for the given coordinates of the four points. Looking for a general analytical solution might be too onerous.
To illustrate, for $d=1$ and points
$$(0,0,0), (4,0,0), (6,2,0), (9,4,1)$$
I get the following lines
$$(-0.236073,0.351294,0.906014,0.91316,0.399015,0.0832224),$$
$$(0.0561098,-0.577272,0.814622,0.867865,0.431585,0.24606).$$