My Team Work‎ > ‎

### pipi - Graph

posted Apr 25, 2010, 5:38 AM by karam kassem
 Pascal GraphicsSource Code : `Program Papi;``uses``    Graph;``var``    u, u0, du, R       : real;``    x1, y1, x2, y2     : real;``    ix1, iy1, ix2, iy2 : integer;``    i                  : integer;``procedure GUInitGraph;``var``    GrDriver, GrMode, Detect    : integer;``begin``    GrDiver := Detect;``    InitGraph(GrDriver, GrMode, '');``    if GraphResult <> GrOk then``    begin``        writeln('Graphics Error');``        GraphErrorMsg(GraphResult);``        halt;``    end;``end;``function f(u : real) : real;``var``    sinu16    : real;``begin``    sinu16 := sin(-u / 16);``    f := exp(cos(2*u)) - 2*cos(4*u) + 0.3*cos(16*u) +1.5*sinu16*sinu16*sinu16;``end;``begin``    GUInitGraph;``    du    := 0.034;``    u0    := 0;``    R     := f(u0);``    x1    := R*cos(u0);``    y1    := R*sin(u0);``    for i:=2 to 2500 do``    begin``        u     := u0 + i*du;``        R     := f(u);``        x2    := R*cos(u);``        y2    := R*sin(u);``        ix1   := round(x1*40);``        ix2   := round(x2*40);``        iy1   := round(y1*40);``        iy2   := round(y2*40);``        line(320+ix1, 240-iy1, 320+ix2, 240-iy2);``        x1     := x2;``        y1    := y2;``    end;``    ``    CloseGraph;``end.`Other Functions
ċ
Papi.pas
(1k)
karam kassem,
Apr 25, 2010, 5:48 AM