--- title: "Superposition" id: 76637 type: "computer_media" slug: "superposition" url: "http://localhost/computer_media/superposition/" markdown_url: "http://localhost/computer_media/superposition.md" published_at: "2026-11-11T08:02:16+00:00" modified_at: "2026-11-11T08:02:16+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/superposition-1.png" excerpt: "Plot two sine waves and then their sum on the ZX81, to show how waves add up." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Allan Feldman" slug: "allan-feldman" taxonomy: "indiv" url: "http://localhost/indiv/allan-feldman/" genre: - name: "Science" slug: "science" taxonomy: "genre" url: "http://localhost/type/science/" media_type: "Program" programmers: - name: "Allan Feldman" slug: "allan-feldman" taxonomy: "indiv" url: "http://localhost/indiv/allan-feldman/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Superposition%20%281982%29%28Feldman%2C%20Allan%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/superposition-1.png" - url: "http://localhost/wp-content/uploads/2026/11/superposition-2.png" article_media: - id: 19373 title: "Superposition" type: "article" url: "http://localhost/article/superposition/" media_type_tags: "Science" license: false --- # Superposition Enter the amplitude and frequency of each of two waves. The program plots both waves, then PRESS ENTER FOR SUPERPOSITION plots their sum, scaling it down if it would run off the screen and telling you by how much. It needs 16K. As printed, only sums above the screen are scaled; a sum far below the axis gives a negative PLOT position and the program stops with report B. Published in Syntax December 1982 ([Superposition](https://timexsinclair.com/article/superposition/)). ## Source Code ``` 10 REM SUPERPOSITION 20 PRINT "SUPERPOSITION" 30 PRINT 35 PRINT "NOTE-AMPLITUDE MUST BE" 36 PRINT " LESS THAN OR EQUAL TO 2" 40 DIM A(2) 50 DIM T(2) 60 DIM Y(63,2) 70 FOR I=1 TO 2 80 PRINT "WHAT IS THE AMPLITUDE" 82 PRINT "OF WAVE";I;"?" 85 INPUT A(I) 90 PRINT "WHAT IS THE FREQUENCY" 92 PRINT "OF WAVE";I;"?" 95 INPUT T(I) 100 NEXT I 110 CLS 120 PRINT "SUPERPOSITION" 140 FOR I=1 TO 2 150 FOR X=1 TO 63 160 LET Y(X,I)=A(I)*SIN (T(I)*X*PI/32) 170 PLOT X,22+10*Y(X,I) 180 NEXT X 190 NEXT I 200 PRINT AT 21,0;"PRESS ENTER FOR SUPERPOSITION" 205 INPUT Z$ 210 CLS 212 LET C=1 215 FAST 220 FOR X=1 TO 63 230 LET YS=(Y(X,1)+Y(X,2))/C 235 IF YS>2 THEN GOTO 500 240 PLOT X,22+10*YS 250 NEXT X 255 IF C>1 THEN PRINT AT 21,0;"AMPLITUDE DIVIDED BY ";C 260 STOP 500 LET C=C+1 510 CLS 520 GOTO 220 ```