Parametric equations for a curved helix in 3D I am using a helix to parameterise biological molecules in 3D.
Currently I have a script that first fits a straight cylinder to my molecule and then plots a helix. I refine this helix using a least squares method.
Now I would like to use a similar method to plot for curved molecules. In this instance I would:

*

*fit a spline

*fit a cylinder to spline with constant radius, R

*fit helix, helix points lie on the cylinder

What I am struggling with is what would the parametric equations be for my curved helix points? I use standard parametric equations for my x, y and z coordinates for my straight helix.
Does anyone have any literature/suggestions to go on? I am not a mathematician at all so stuggling!
 A: $\newcommand{\Vec}[1]{\mathbf{#1}}$Here's one standard framework: A generic regular path $\Vec{x}$ (twice continuously differentiable mapping from an open interval into Euclidean three-space, with non-vanishing velocity) has a Frenet frame, an ordered orthonormal triple of vectors $\{\Vec{t}, \Vec{n}, \Vec{b}\}$ at each point.
These vectors, the tangent, normal, and binormal fields, are defined recursively by
$$
\Vec{t}(t) = \frac{\Vec{x}'(t)}{\|\Vec{x}'(t)\|},\qquad
\Vec{n}(t) = \frac{\Vec{t}'(t)}{\|\Vec{t}'(t)\|},\qquad
\Vec{b}(t) = \Vec{t}(t) \times \Vec{n}(t).
$$
The term "generic" above means $\Vec{t}'$ is non-vanishing, so that $\Vec{n}$ is defined. The linked Wikipedia page above (or any differential geometry book discussing space curves) contains formulas for these vector fields in terms of a parametrization $\Vec{x}$.
For $r > 0$ sufficiently small (constant, or depending on $t$ if you like), the cylinder with core $\Vec{x}$ and radius $r$ may be parametrized by
$$
X(t, \theta) = \Vec{x}(t) + r(\cos\theta\, \Vec{n}(t) + \sin\theta\, \Vec{b}(t)).
$$
A helix on this cylinder is obtained by letting $\theta$ be a suitable monotone function of $t$, such that $\theta = kt$ for some constant $k$.

Notes:

*

*The magnitude of $\Vec{t}'$ is the curvature, and measures the rate of turning. The component of $\Vec{n}'$ in the direction of $\Vec{b}$ is the torsion, and measures the rate of "twisting" of $\Vec{n}$ about the core. (Caution: The terms "curvature" and "torsion" have multiple meanings in differential geometry; the meanings here are entirely unrelated to the terms' use in Riemannian geometry, for example.)

*We need $r$ sufficiently small (smaller than the reciprocal of the curvature is sufficient) so that the distance from a point on the cylinder to a point of the core is $r$, i.e., to avoid singularities and self-intersections.

*Taking $\theta = kt$ may or may not suit your needs for a "constant pitch helix", since the torsion contributes to "rotation of the frame $\{\Vec{n}, \Vec{b}\}$ about the core". If your core curves are planar, the torsion is zero, and this caution may be ignored.

