procedure TForm1.Button1Click(Sender: TObject);
var
x, c:integer;
n: Integer;
i:integer;
A, B : TDateTime;
Result : Integer;
dni_fiz, dni_psy, dni_int : integer;
dni : integer;
bio_fiz, bio_psy, bio_int : real;
begin
A := Now;
B := EncodeDate(1990, 09, 15);
Result := DaysBetween(A, B);
label1.caption:=('Dni od urodzenia: ' + IntToStr(Result));
dni_fiz := result mod 21;
dni_psy := result mod 33;
dni_int := result mod 28;
bio_fiz := 100 * Sin(dni_fiz / 21 * 2 * Pi);
bio_psy := 100 * Sin(dni_psy / 33 * 2 * Pi);
bio_int := 100 * Sin(dni_int / 28 * 2 * Pi);
label2.Caption:=floattostr(bio_fiz);
label3.Caption:=floattostr(bio_psy);
label4.Caption:=floattostr(bio_int);
c:=Image1.Height div 2;
for x:=0 to Image1.Width do
Image1.Canvas.Pixels[x, c+Round(c*sin(x/10))]:=clBlack;
end;
procedure TForm1.FormPaint(Sender: TObject);
var
n: Integer;
A, B : TDateTime;
Result : Integer;
dni_fiz, dni_psy, dni_int : integer;
dni : integer;
bio_fiz, bio_psy, bio_int : real;
begin
A := Now;
B := EncodeDate(1990, 09, 15);
Result := DaysBetween(A, B);
label1.caption:=('Dni od urodzenia: ' + IntToStr(Result));
dni_fiz := result mod 21;
dni_psy := result mod 33;
dni_int := result mod 28;
bio_fiz := 100 * Sin(dni_fiz / 21 * 2 * Pi);
bio_psy := 100 * Sin(dni_psy / 33 * 2 * Pi);
bio_int := 100 * Sin(dni_int / 28 * 2 * Pi);
label2.Caption:=floattostr(bio_fiz);
label3.Caption:=floattostr(bio_psy);
label4.Caption:=floattostr(bio_int);
with Form1.Canvas do
begin
MoveTo(0,200);
for n:=0 to Form1.Width do
begin
LineTo(n,200-Round(Sin(n/20)*50)); //te 50 to amplituda :)
end;
end;
end;
end .
chcialbym zeby w tej fukcji
c:=Image1.Height div 2;
for x:=0 to Image1.Width do
Image1.Canvas.Pixels[x, c+Round(c*sin(x/10))]:=clBlack;
rysowalo biorytm, moze ktos ma pomysl jak to zrobic
pzdr