Learning Scientific Programming with Python (2nd edition)
P3.3.1: Plotting spirals
Question P3.3.1
A spiral may be considered to be the figure described by the motion of a point on an imaginary line as that line pivots around an origin at constant angular velocity. If the point is fixed on the line, then the figure described is a circle.
(a) If the point on the rotating line moves from the origin with constant speed, its position describes an Archimedean spiral. In polar co-ordinates the equation of this spiral is $r = a + b\theta$. Use pyplot
to plot the spiral defined by $a = 0, b = 2$ for $0 \le \theta \le 8\pi$.
(b) If the point moves along the rotating line with a velocity that increases in proportion to its distance from the origin, the result is a logarithmic spiral, which may be written as $r = a^\theta$. Plot the logarithmic spiral defined by $a = 0.8$ for $0 \le \theta \le 8\pi$.
The logarithmic spiral has the property of self-similarity: with each $2\pi$ whorl, the spiral grows but maintains its shape. The Swiss mathematician Jakob Bernoulli was so taken with this property that he coined the logarithmic spiral (Spira mirabilis): the "miraculous sprial" and wanted one engraved on his headstone with the phrase "Eadem mutata resurgo" ("Although changed, I shall arise the same"). Unfortunately, an Archimedian spiral was engraved by mistake. Logarithmic spirals occur frequently in nature, from the arrangements of the chambers of nautilus shells to the shapes of galaxies.