Skip to content

Instantly share code, notes, and snippets.

@aaronryank
Created May 27, 2017 15:18
Show Gist options
  • Save aaronryank/0eb179b8c68659b90d084555a031222d to your computer and use it in GitHub Desktop.
Save aaronryank/0eb179b8c68659b90d084555a031222d to your computer and use it in GitHub Desktop.
10 TEXT : HOME : PRINT "STD. DEV. = ";: INPUT s1
20 HGR : HCOLOR = 3
30 w = 279: h = 159
40 w0 = w - 100: w1 = w0/10
45 h1 = h - 100: h2 = h - 60
50 k = 0.5: m = 1 / (2 * 3.14159265 * s1 * s1)
60 FOR i = 0 TO 10 STEP k
70 x = 10 * i + 1: y = 10 * i + h1
75 HPLOT x,y
80 FOR j = 0 TO w0 STEP 1
85 j1 = 10 * j / w0
90 d1 = ABS(5 - i)
100 d2 = ABS(5 - j1)
110 r2 = (d1*d1+d2*d2)/(2*s1*s1)
120 g = EXP(-r2)/(2*3.14159*s1*s1)
130 a = INT((h2 * g)/ m)
140 x = 10 * i + w1 * j1 + 1
150 y = 10 * i + h1 - a
160 HPLOT TO x,y
170 IF (i = 0) GOTO 265
175 IF (j = w0) GOTO 190
180 j2 = INT(j/10) : IF ((j/10) <> j2) GOTO 290
190 d1 = ABS(5 - i + k)
200 d2 = ABS(5 - j1)
210 r2 = (d1*d1+d2*d2)/(2*s1*s1)
220 u = EXP(-r2)/(2*3.14159*s1*s1)
225 a1 = INT((h2 * u)/ m)
230 x1 = 10 * (i - k) + w1 * j1 + 1
240 y1 = 10 * (i - k) + h1 - a1
250 HPLOT to x1,y1
260 HPLOT x,y
265 IF (j = 0) GOTO 310
270 IF (i < 10) GOTO 290
275 IF (j = w0) GOTO 295
280 j2 = INT(j/10) : IF ((j/10) = j2) GOTO 295
290 HCOLOR = 0
295 HPLOT TO x,10 * i + h1
300 HCOLOR = 3
305 HPLOT x,y
310 NEXT j
320 NEXT i
330 HPLOT w+1,h : HPLOT TO 100+1,h : HPLOT TO 0+1,h1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment