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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
program Graphique2;
uses
crt,Graph;
CONST
ox=380;
oy=825;
unitx=50;
unity=50;
d=4;
h=0.0001;
VAR
GraphPilote, GraphMode : INTEGER;
x, y, t, Pa, Pn,xx: real;
i, ii, rr: integer;
procedure Croix(x,y:real);
var
a, b:integer;
begin;
a:= round(ox+unitx*x);
b:= round(oy-unity*y);
moveto(a,b);
lineto(a+d,b+d);
moveto(a,b);
lineto(a-d,b-d);
moveto(a,b);
lineto(a-d,b+d);
moveto(a,b);
lineto(a+d,b-d);
end;
procedure Point(x,y:real);
VAR
a,b : integer;
begin;
a := round(ox+unitx*x);
b := round(oy-unity*y);
moveto(a,b);
lineto(a,b);
end;
procedure Axes;
VAR
px,py: real;
begin;
px := -20;
py := -20;
repeat
px := px+h;
py := py+h;
point(px,0);
point(0,py);
until px > 20.1;
end;
procedure Tics;
var
j: integer;
tx, ty: real;
begin;
for j:=-20 to 200 do
begin;
tx:=0;
ty:=0;
repeat
tx:=tx+h;
point(0.1*j,tx);
ty:=ty+h;
point(ty,0.1*j);
until tx>0.05;
end;
end;
procedure GrosTics;
var
j: integer;
tx, ty: real;
begin;
for j:=-2 to 20 do
begin;
tx:=0;
ty:=0;
repeat
tx:=tx+h;
point(j,tx);
ty:=ty+h;
point(ty,j);
until tx>0.1;
end;
end;
procedure bk(i : integer);
var
ry: integer;
begin
ry:=0;
setcolor(i);
repeat
moveto(0,ry);
lineto(1700,ry);
ry:=ry+1;
until ry=1000;
end;
function f(Pa : real) : real;
begin;
f := Pa +0.12*h*Pa;
end;
procedure graff(xmin,xmax : real);
VAR
xx, Pa, t, Pn,z : real;
begin;
xx := xmin;
t := 0;
Pa := 1;
z := 0.00833;
repeat
t := t+1;
Pn := Pa +0.12*z*Pa;
Pa := Pn;
xx := xx+z;
point(xx, Pa);
until xx > xmax;
end;
procedure graff2(xmin,xmax,z : real);
VAR
Pa, t, Pn, xx : real;
begin;
xx := xmin;
t := 0;
Pa := 1;
repeat
t := t+1;
Pn := Pa +0.12*z*Pa;
Pa := Pn;
xx := xx+z;
Croix(xx, Pa);
until xx > xmax;
end;
Begin
GraphPilote := Detect;
InitGraph(GraphPilote,GraphMode,'');
{write('Couleur de fond = ');
readln(i);
repeat;}
setcolor(1);
axes;
tics;
grostics;
setcolor(4);
graff(0,20);
repeat
write('Entrer une valeur = ');
readln(rr);
write('Couleur de la nouvelle courbe = ');
readln(ii);
setcolor(ii);
graff2(0,20,rr);
{setcolor(0);
Croix(-2,f(2));
Croix(2,f(-2));}
write('Continuer ? (oui = 1 non = 0) : ');
readln(i);
until i < 0.5;
readln;
closegraph;
end. |
Partager