fibonacci_spiral, an Octave code which displays points on a Fibonacci spiral, suggesting the arrangement of seeds in a sunflower, for instance.

The spirals exhibited in nature can be modeled by a simple spiral of points generated, in polar coordinates, by starting at R = 0, A = 0, and then repeated incrementing R by dR = 1, and A by an angle dA of about 137.5 degrees, or, more precisely, by 2 * PI * ( PHI - 1 ) / PHI radians, where PHI is the Golden Ratio, equal to (1+sqrt(5))/2.

The spiral along which the points occur sequentially is not, in fact, what the viewer first notices. Instead, an image of the spiral will seem to exhibit two families of spirals emerging at a sharp angle from the center. One family rotates clockwise, the other counter-clockwise.

The program fibonacci_spiral simply displays the blue dots representing the points; in this image, the Fibonacci spirals are evident. The program fibonacci_spiral_connected includes a red spiral line that connects the dots in the sequence in which they are generated. Plots of this kind are not very legible after 100 or so points.


The computer code and data files described and made available on this web page are distributed under the MIT license


fibonacci_spiral is available in a MATLAB version and an Octave version and a Python version.

Related Data and Programs:


caustic, an Octave code which generates an image of a caustic, by drawing n equally spaced points in a circle, and then connecting specific pairs of points using a spacing parameter m.

epicycloid, an Octave code which computes, plots and tabulates an epicycloid curve.

fern, an Octave code which uses MATLAB graphics to display the Barnsley fractal fern.

hilbert_curve, an Octave code which computes the sequence of discrete Hilbert curves whose limit is a space-filling curve.

mandelbrot, an Octave code which generates an ASCII PPM image of the Mandelbrot set;


  1. Ian Stewart,
    Nature's Numbers: The Unreal Reality of Mathematics,
    Oxford, 2004,
    ISBN: 0198613369,
    LC: QA93.S737.

Source Code:

Last modified on 19 January 2019.