cylinder shape around an arbitary curve I am trying to find an analytic way to describe a cable (like a cylinder) in order to calculate the exact point of intersection of the cable wall with a given ray (straight line) in $\mathbb{R}^3$. Unfortunately I cannot simplify the cable to being straight and I want to describe it as a curve. Are there any parameterizations of bent cylinders following a defined curve?
Thanks!
 A: Look up Frenet frames. Given a curve $\vec x(t):\Bbb R\to\Bbb R^3$, there are formulas which yield the vectors $\vec {\mathfrak t}(t)$, $\vec {\mathfrak n}(t)$ and $\vec {\mathfrak b}(t)$, the so called Frenet frame. Here $\vec {\mathfrak t}(t)$ is the tangent vector to $\vec x$ at $t$, and the vectors $\vec {\mathfrak n}(t)$ and $\vec {\mathfrak b}(t)$ are perpendicular to this tangent. You can use them to parametrize the tube of radius $r$ around $\vec x$, but this most probably will give no easy formula to deal with analytically:
$$T(s,t)=\vec x(t)+r\cos(2\pi s)\vec{\mathfrak n}(t)+r\sin(2\pi s)\vec{\mathfrak b}(t).$$

Also there are some restrictions on $\vec x$ to guarantee the existence of the Frenet frame, e.g. the curve is not allowed to have points of zero curvature.

For your application I would reccomend you just using an optimization strategy to  find the minimal distance between a ray $\vec r$ and your curve $\vec x$, e.g. repeated binary search or gradient descent to avoid getting trapped in local minima. If this distance is smaller than the radius of your cable, then there will be an intersection at this point.
A: Maybe you are overthinking this. The intersection occurs when the distance between the curve and the ray is less than $r$. So the condition is
$$ \| {\rm curve}(t) - {\rm ray}(s) \| \le r $$
Without any further details, it is difficult to go any further. This is equivalent to placing an infinite number of spheres of radius $r$ along the curve and finding which one intersects the ray.
