File: standing-waves.gel

package info (click to toggle)
genius 1.0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 25,308 kB
  • sloc: ansic: 75,620; xml: 71,565; sh: 4,445; makefile: 1,927; lex: 523; yacc: 298; perl: 54
file content (26 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Category: Differential Equations
# Name: Standing waves

the_answer = AskButtons("Number of dimensions?", "2D", "3D");

PlotWindowPresent(); # Make sure the window is raised

if the_answer == 1 then (
    LinePlotDrawLegends = false;

    for t=1 to 100 by 0.1 do (
        LinePlot(`(x)=cos(t)*sin(x),[-5,5,-2,2]);
        wait (0.05)
    )
) else if the_answer == 2 then (
    SurfacePlotDrawLegends = false;

    # use standard variable names (in case they got reset)
    SurfacePlotVariableNames = ["x","y","z"];

    for t=1 to 100 by 0.1 do (
        SurfacePlot(`(x,y)=cos(t)*sin(x-y),[-5,5,-2,2,-1,1])
    )
)