Last active
August 29, 2015 13:55
-
-
Save Evshved/8710322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses graphAbc; | |
var x1,y1,k,g,per:integer; | |
x0,y0,x,y:real; | |
Begin | |
setwindowsize(800,600); | |
line(0,300,800,300); | |
line(400,0,400,600); | |
setpencolor(clred); | |
while g<>800 do | |
begin | |
g:=g+20; | |
if g=400 then continue; | |
line(g,290,g,310); | |
end; | |
g:=0; | |
while g<>600 do | |
begin | |
g:=g+20; | |
if g=300 then continue; | |
line(390,g,410,g); | |
end; | |
setpencolor(clgreen); | |
k:=20; | |
x0:=400; | |
y0:=300; | |
x:=-12; | |
y:=0.5*x*cos(2*x); | |
x1:=trunc(x0+(x*k)); | |
y1:=trunc(y0-(y*k)); | |
moveto(x1,y1); | |
while x<12 do | |
begin | |
x:=x+0.01; | |
y:=0.5*x*cos(2*x); | |
x1:=trunc(x0+(x*k)); | |
y1:=trunc(y0-(y*k)); | |
lineto(x1,y1); | |
end; | |
setpencolor(clbrown); | |
k:=20; | |
x0:=400; | |
y0:=300; | |
x:=-15; | |
y:=sin(x)/cos(x); | |
x1:=trunc(x0+(x*k)); | |
y1:=trunc(y0-(y*k)); | |
moveto(x1,y1); | |
while x<15 do | |
begin | |
x:=x+0.001; | |
y:=sin(x)/cos(x); | |
x1:=trunc(x0+(x*k)); | |
y1:=trunc(y0-(y*k)); | |
if per-y1>0 then lineto(x1,y1) else moveto(x1,y1); | |
per:=y1; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment