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:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Math, ComCtrls;
type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Image1: TImage; Image2: TImage; Image3: TImage; Image4: TImage; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; ScrollBar1: TScrollBar; ScrollBar2: TScrollBar; ScrollBar3: TScrollBar; ScrollBar4: TScrollBar; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; HeaderControl1: THeaderControl; procedure FormCreate(Sender: TObject);
procedure ScrollBar1Change(Sender: TObject); procedure ScrollBar2Change(Sender: TObject); procedure ScrollBar3Change(Sender: TObject); procedure ScrollBar4Change(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
const r=20; xmiddle=41; ymiddle=41;
var imgwidth, imgheight: integer; s: string; e, d, abstand, wellenl: integer; lastx, lasty: integer; angle1, angle2, angle3, angle4: integer; f1, f2, f3, f4: extended; wellen: double;
procedure Vektor1; begin f1 := sqrt(sqr(e)+sqr(1.5*d+abstand)); angle1 :=round( (f1-((wellenl)*floor(f1/(wellenl))))/wellenl*360 ); s := IntToStr(angle1); form1.Label5.Caption:=s; angle1 :=round( angle1/360*2*pi); lastx := 41 + round( r * cos(angle1)); lasty := 41 + round( r * sin(angle1)); form1.Image1.Canvas.MoveTo(lastx,lasty); form1.Image1.Canvas.LineTo(xmiddle,ymiddle);
end;
procedure Vektor2; begin f2 := sqrt(sqr(e)+sqr(0.5*d+abstand)); angle2 :=round( (f2-((wellenl)*floor(f2/(wellenl))))/wellenl*360 ); s := IntToStr(angle2); form1.Label6.Caption:=s; end;
procedure Vektor3; begin f3 := sqrt(sqr(e)+sqr(-0.5*d+abstand)); angle3 :=round( (f3-((wellenl)*floor(f3/(wellenl))))/wellenl*360 ); s := IntToStr(angle3); form1.Label7.Caption:=s; end;
procedure Vektor4; begin f4 := sqrt(sqr(e)+sqr(-1.5*d+abstand)); angle4 :=round( (f4-((wellenl)*floor(f4/(wellenl))))/wellenl*360 ); s := IntToStr(angle4); form1.Label8.Caption:=s; end;
procedure TForm1.FormCreate(Sender: TObject); begin imgwidth:= image1.Width; imgheight:= image1.Height; Form1.image1.Canvas.Brush.Color:=clWhite; Form1.image1.Canvas.Rectangle(0,0,imgWidth,imgHeight); Form1.image2.Canvas.Brush.Color:=clWhite; Form1.image2.Canvas.Rectangle(0,0,imgWidth,imgHeight); Form1.image3.Canvas.Brush.Color:=clWhite; Form1.image3.Canvas.Rectangle(0,0,imgWidth,imgHeight); Form1.image4.Canvas.Brush.Color:=clWhite; Form1.image4.Canvas.Rectangle(0,0,imgWidth,imgHeight); e := form1.ScrollBar1.Position; d := form1.ScrollBar2.Position; wellenl := form1.ScrollBar3.Position; wellen := wellenl /1000; abstand := form1.ScrollBar4.Position; Vektor1; Vektor2; Vektor3; Vektor4; end;
procedure TForm1.ScrollBar1Change(Sender: TObject); begin e := form1.ScrollBar1.Position; s := IntToStr(e); form1.Label9.Caption:= s; Vektor1; Vektor2; Vektor3; Vektor4; end;
procedure TForm1.ScrollBar2Change(Sender: TObject); begin d := form1.ScrollBar2.Position; s := IntToStr(d); form1.Label10.Caption:= s; Vektor1; Vektor2; Vektor3; Vektor4;
end;
procedure TForm1.ScrollBar3Change(Sender: TObject); begin wellenl := form1.ScrollBar3.Position; s := IntToStr(wellenl); form1.Label11.Caption:= s; wellen := wellenl /1000; Vektor1; Vektor2; Vektor3; Vektor4; end;
procedure TForm1.ScrollBar4Change(Sender: TObject); begin abstand := form1.ScrollBar4.Position; s := IntToStr(abstand); form1.Label12.Caption:= s; Vektor1; Vektor2; Vektor3; Vektor4; end;
end. |