unit muehleU;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
const
pi=3.1415;
type
TForm1 =
class(TForm)
Button1: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Muehle(anzahl,hoehe,x,y:integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Muehle (4,150,50,50);
end;
procedure TForm1.Muehle (anzahl,hoehe,x,y:integer);
var flange,nr,bm,x2,y2, FluegelEndPunktX, FluegelEndPunktY:integer;
begin
with Image1.Canvas
do
begin
moveTo (x,y);
rectangle (x,y,x+round(hoehe/5),hoehe);
moveTo (x+(round(hoehe/5)
DIV 2),y+10);
x2:= x+(round(hoehe/5)
DIV 2);
y2:= y+10;
flange:= hoehe
DIV 2 ;
bm:= round((2*pi) / anzahl);
for nr:= 1
to anzahl
do
begin
FluegelEndPunktX:=(hoehe
DIV 10)+round(Cos(bm*nr));
FluegelEndPunktY:=60+round(Sin(bm*nr));
//lineTo (round(flange*cos(bm*nr)+(hoehe DIV 10)),round(-flange*sin(bm*nr)+60));
lineTo (FluegelEndPunktX,FluegelEndPunktY);
moveTo (x2,y2);
end;
end;
end;
end.