FoldList

The usage message of FoldList is shown below, and of course it's closely related to Fold. For a long time I wondered where something like this would have useful applications.

Jürgen Tischer used FoldList to solve a common problem in the MathGroup. The solution is given below which takes a list of angles and adds to, or subtracts from, each element a multiple of 360° to minimize the jump from the previous element. This trick forms the heart of the SmoothPhase package that I have posted on MathSource.

Another elegant application of FoldList is given in the section on Clever little programs.

Created by Mathematica (May 16, 2004)