[Math] How to construct a line with a given equal distance from 3 Points in 3 Dimensions

euclidean-geometrygeometrylinear algebratrigonometry

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)

Best Answer

Maybe the following will help. It's not an answer, but it's too long for a comment.

Suppose the given distance is $d$. Then $L$ must be simultaneously tangent to three spheres of radius $d$, one centered at each of the given points.

Consider the case where the distances between some pair of the points is $D>2d$. The radius $d$ spheres can be nestled inside a ruled surface of this shape (so long as it's sized appropriately):

enter image description here

Any line of the ruled surface is tangent to both spheres.

You can also fit two spheres with centers distance $D$ apart into a ruled surface that's more (or completely) cone-like, or into one that's less cone-like and more (or exactly) cylindrical. Any of these ruled surfaces will yield an infinite number of lines $L$ tangent to these first two spheres.

If the sphere of radius $d$ about the third point intersects any of these ruled surfaces (hyperboloids of one sheet with axis containing the first two spheres' centers - the cone and the cylinder being degenerate ones), it seems like there will be either one or two lines $L$ from that ruled surface where $L$ equidistant from the three points.

I think that the third sphere will intersect one of these ruled surfaces if and only if it intersects either the cone or the cylinder, so maybe only the degenerate hyperboloids need to be considered.

If none of the points are more than $2d$ units apart, the first two spheres will intersect in a circle. The families of lines tangent to both will comprise a cylinder and some hyperboloids, but you can't twist them completely into a cone. Instead, there will be a different degenerate ruled family of tangent lines: those in the plane through the spheres' circle of intersection that are also tangent to that circle. Again, if the third sphere intersects any of these families of lines (and I think in this case it must), you'll get solutions.