Microsoft Small Basic

Program Listing: WNH422
'program obliczający krzywą Gaussa w dziedzinie arcusa tangensa na kole
GraphicsWindow.BackgroundColor = "White"
xskala = 150
yskala = 150
xtrans = 50
ytrans = 200
e=2.7182818
fat = 50 'tłustosc wykresu
r = 1.2 'promien koła
FOR xp = -30 TO 30 STEP .001 'dziedzina x(początkowe) arcusa tangensa
atan = math.ArcTan(xp)
g = math.power(e,-xp * xp * fat) / 4 'funkcja Gaussa
x = (r + g) * math.COS(atan) 'wykres f. Gaussa nawiniety na kole o promieniu r
y = (r + g) * math.SIN(atan)
'koło wykresu
xk = r * math.COS(atan)
yk = r * math.SIN(atan)
'rysowanie na ekranie
xe = x * xskala + xtrans
ye = y * yskala + ytrans
GraphicsWindow.SetPixel(xe, ye, "blue") 'rysunek kola bazowego
xe = xk * xskala + xtrans
ye = yk * yskala + ytrans
GraphicsWindow.SetPixel(xe, ye, "red") 'wykres funkcji
EndFor