2D Examples
Fourier Sum N=512
The same 1/n coefficient formulas, with N keeping all 512 generated terms on each axis.
Fourier sum N=512 builds coefficients from formulas instead of a handwritten list. sum([amplitude, frequency, phase], n, start, end) evaluates those three expressions at each integer n. Here the amplitude is 1/n, the frequency is n, the X phase is 0, and the Y phase is π/2. The sum runs through n = 512, and N = 512 keeps the strongest terms on each axis.
The formulas become ordinary numbers before the curve is drawn. Positive frequencies, negative frequencies, a frequency of 0, and a phase shift are allowed. When the generator produces more triples than N, the largest amplitudes stay and the quieter ones are left out. For 1/n the strongest terms are the lowest frequencies. The studio then draws the cosine sums on the existing 2D board.
Equation
fourier_draw(
x_coefficients=sum([1/n, n, 0], n, 1, 512),
y_coefficients=sum([1/n, n, pi/2], n, 1, 512),
N=512,
t_min=0,
t_max=1
)
Graph preview
How a Fourier drawing is summed
A Fourier drawing gives x and y as separate cosine sums. One term is a triple [amplitude, frequency, phase]. The point at parameter t is the sum of amplitude · cos(2π · frequency · t + phase) on each axis. Frequency 0 does not oscillate: cos(phase) is constant, so that term shifts the whole drawing.
N is the maximum number of terms kept on each axis, up to 512. It is not a promise that the input listed exactly N triples, and it is not the number of samples. A handwritten list keeps its first N terms. A sum([amplitude, frequency, phase], n, start, end) expands the formulas to numbers, then keeps the strongest N amplitudes, including negative frequencies. source_x and source_y are sampled densely and converted with an FFT; each complex bin becomes one cosine term, amplitude |c| and phase arg(c), so sine and cosine parts both survive. Only significant bins are kept, and at most N of the strongest. The result lists requested N separately from the actual retained X and Y counts, because a band-limited curve needs fewer terms than the cap. Show Epicycles adds rotating circles and a guide line on the same board. The polyline stays. Play traces that finished path.
Reading the input
fourier_draw(— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.x_coefficients=sum([1/n, n, 0], n, 1, 512),— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.y_coefficients=sum([1/n, n, pi/2], n, 1, 512),— This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.N=512,— This assignment names a value, a set, or a coordinate that a later line uses.t_min=0,— This line is part of the example input and is sent to DGS unchanged.t_max=1— This line is part of the example input and is sent to DGS unchanged.)— This line is part of the example input and is sent to DGS unchanged.
Try a change
- Change 1/n to 1/n^2 and generate again. Higher frequencies become much quieter.
- Lower N and leave the sum range as it is. Only the strongest terms stay.
Generate Graph samples the X and Y cosine sums and draws the polyline on the 2D board. The status panel separates requested N from the actual retained term counts and says whether the curve is direct/manual or FFT-generated. Show Epicycles can add rotating circles and a guide line. The X and Y scales match. Play traces the finished path.