analemma, a C code which evaluates the equation of time, by Brian Tung.

The program can compute and plot an analemma curve for various orbital parameters. The analemma is the curve traced by the position of the sun, measured at clock noon, over a year.

The program creates data and command files which must be processed by the GNUPLOT program:

        gnuplot < analemma_commands.txt
which will create PNG images of the analemma, the declination, and the equation of time.


analemma options
where the allowable options include

The program with no options uses the following default values:


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


analemma is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:


calendar_rd, a C++ program which computes the representation of a given date in a number of calendrical systems, by Edward Reingold, Nachum Dershowitz.

calpak, a C++ library which makes various calendar calculations;

dates, a dataset directory which contains lists of dates in various calendar systems.

gnuplot_test, examples which illustrate the use of the gnuplot graphics program.

weekday, a C code which determines the day of the week corresponding to a given date, such as 14 October 1066, Julian calendar, ... which was a Saturday.


Original C version by Brian Tung. This C version by John Burkardt.


  1. Brian Tung,
    Figure Eight in the Sky, a new perspective on an old fascination,
    Astronomical Games, August 2002,

Source Code:

Last revised on 06 October 2021.