10.5 Space Curves
All curves we have analyzed so far are called plane curves, as they are entirely contained in a plane. A curve that is not contained in a plane is called space curve.
The modeling of a space curve is no different from the one of a plane curve, except that it employs three parametric equations instead of two.
As an example, let us consider a helix. This space curve is widely used in architecture, for instance in staircases. The parametric definition of this curve, in cylindrical coordinates, is the following:
\[(\rho,\phi,z) = (1,t,t)\]
This definition shows that as the angle \(\phi\) increases, the height \(z\) also increases. However, this definition can be parametrized even further, as follows:
\[\left\{ \begin{aligned} \rho(t)& =r\\ \phi(t)& =\alpha t\\ z(t)& =\beta t \end{aligned}\right.\]
The parameter \(r\) is the helix radius, \(\alpha\) is the number of turns (i.e., multiples of \(2\phi\)), and \(\beta\) is the speed with which the helix advances along its axis (in this case, the \(Z\) axis). The height of one complete helix turn (i.e., in the period of \(2\pi\)) is called the pitch of a helix. The corresponding Julia function is:
helix(p, r, a, b, n) = map_division(t -> p+vcyl(r, a*t, b*t), 0, 2*pi, n)
The following expressions produce the helices illustrated in this figure.
spline(helix(x(0), 2, 4, 1, 200))
spline(helix(x(5), 1, 8, 1, 400))
spline(helix(x(9), 2, 2, 1, 100))
Three helices. From left to right, the parameters are: \(r=\{2,1,2\}\), \(\alpha=\{4,8,2\}\), and \(\beta=\{1,1,1\}\).
One of the advantages of using a parametric representation is the ease of making changes. For example, if we turn the coordinates \(\rho\), \(\phi\), and \(z\) into linear functions of \(t\), we obtain a conic helix:
\[\left\{ \begin{aligned} \rho(t)& =r_0+r_1 t\\ \phi(t)& =\alpha_0+\alpha_1 t\\ z(t)& =\beta_0+\beta_1 t \end{aligned}\right.\]
The parameter \(r_0\) is the radius of the initial opening of the conic helix, and \(r_1\) is the opening speed of the conic helix. The parameters \(\alpha_0\) and \(\beta_0\) are the initial values of the angle \(\phi\) and height \(z\), respectively. The corresponding Julia definition is as follows:
conic_helix(p, r0, r1, a0, a1, b0, b1, n) =
map_division(t -> p+vcyl(r0+r1*t, a0+a1*t, b0+b1*t), 0, 2*pi, n)
Note that the helix is a particular case of the conic helix, where \(r_0=r\), \(r_1=0\), \(\alpha_0=0\), \(\alpha_1=\alpha\), \(\beta_0=0\), and \(\beta_1=\beta\).
We can now use the conic helix to model one of the most famous curves of the 20th century: the double helix, ilustrated in this figure. This model, discovered by Francis Crick and James Watson in 1953, represents the DNA’s molecular structure. To draw it, we only have to evaluate the following two expressions:
spline(conic_helix(u0(), 1, 0, 0, 3, 0, 1, 100))
spline(conic_helix(u0(), 1, 0, pi, 3, 0, 1, 100))
A double helix.