# Is this valid parametric equation to create control points for a helix in 3D space?

Is this a valid way to compute new points that are on a helix and if not what is it wrong?

The Cartesian coordinates of each new helix control point could be described by the following parametrization:

$x (u)= a n_x u + p_x + b((1- \cos{(u\theta)})/ \theta)$
$y (u)= an_y u + p_y + b(\sin{(u\theta)}/ \theta)$
$z (u)= a n_z u + p_z + u$

where $a$ is the length of the helix, $u$ is in $[0,a)$, $(p_x, p_y, p_z)$ is a given center of a triangle in 3D space, $(n_x, n_y, n_z)$ is the normal of the given center in the triangle, $b$ is the radius of the helix and $\theta$ controls the frequency of the helix's curls.

-
why do you make x(u) equal 2 different things? – Carry on Smiling Jul 18 '12 at 23:25
@ChuckFernández: I think that was a simple typo; fixed now. – David Cary Jul 19 '12 at 1:05

Your equations do not generate a helix. A helix has the property that it has constant curvature and constant torsion when described by a Frenet-Serret frame. If we write your curve as $$p(u) = \begin{bmatrix} x(u) \\ y(u) \\ z(u) \end{bmatrix}$$ then the tangent vector is defined by $$T(u) = \dfrac{p'(u)}{\left\lVert p'(u) \right\rVert}$$

We can change coordinates into the arc-length of the curve, $$s(u) = \int_0^{u} \lVert p'(u) \rVert du$$

The curvature is the rate of change of the tangent vector with respect to arc length, i.e. $$\kappa(s) = \left \lVert \dfrac{dT}{ds} \right \rVert$$

By the chain rule we can see that $$\dfrac{dT}{ds} = \dfrac{dT}{du}\dfrac{du}{ds} = \dfrac{dT}{du}\left[ \dfrac{ds}{du} \right]^{-1}$$ so that $$\left \lVert \dfrac{dT}{ds} \right \rVert = \left \lVert \dfrac{dT}{du} \right \rVert \left| \left[ \dfrac{ds}{du} \right]^{-1} \right|$$

For your equation, $\left \lVert \dfrac{dT}{du} \right \rVert$ does have constant magnitude, but $\left| \dfrac{ds}{du} \right| = \lVert p'(u) \rVert$ does not, so the curve does not have constant curvature.

Since it's not entirely clear to me what you're trying to accomplish with this parametric curve, I'm not really sure how to fix your equations to make them a helix. If you're trying to get a helix that coils off the face of the triangle, which it seems like you might be, then why not generate the helix first using a standard representation like \begin{aligned} x(t) &= r\sin(t) \\ y(t) &= r\cos(t) \\ z(t) &= pt \end{aligned} and then transform the resulting helix into a new coordinate system using a transform of the form $$p_2 = Rp + c$$ that places it where you want it? $c$ will just be the center of your triangle, and $R$ is a rotation matrix that reorients the axis of the helix to point along the normal, so $R$ could be something like the following. Let $\gamma = \cos^{-1}( \lVert e_3 \cdot n \rVert )$ where $e_3$ is the third standard basis vector. $\gamma$ is the angle between the $z$-axes before and after the transformation. Then let $\omega = \dfrac{e_3 \times n}{\lVert e_3 \times n \rVert}$, where it is assumed that $e_3 \times n \neq 0$. If it does, then the procedure should be modified by letting $\omega = e_1$. Then, define $$\hat{\omega} = \begin{bmatrix} 0 & -\omega_z & \omega_y \\ \omega_z & 0 & -\omega_x \\ -\omega_y & \omega_x & 0 \end{bmatrix}$$ $$R = I + (\sin \theta) \hat{\omega} + (1-\cos\theta)\hat{\omega}^2$$ Here I've chosen $R$ to be the rotation matrix that performs the minimal rotation necessary to align the axis of the helix with the normal of the triangle.

Doing it this way also makes it easy to pick the spacing for your points in $t$, since they are separated by a distance (in arc-length) of $\Delta s = \sqrt{ r^2 + p^2 } \Delta t$, and by an angle of simply $\Delta t$ radians.

-

Why don't you just make it $x(u)= a+m(\cos(u)),$ $y(u)=b+n(\sin(u))$ and $z(u)=k*u$?

-
Not clear about your method of generation,does the center of triangle stay on a helix? Do the triangle vertices describe a coiled coil? – Narasimham Aug 7 '15 at 16:29