Einzelnen Beitrag anzeigen

Benutzerbild von Bummi
Bummi

Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
 
Delphi XE3 Enterprise
 
#19

AW: Halbkreis zwischen zwei Punkten zeichnen.

  Alt 15. Mär 2011, 10:19
Delphi-Quellcode:
var
  px1,py1,px2,py2, ipx1, ipy1, ipx2,ipy2:Integer;
  f:Double;
begin
  px1 := 100;
  py1 := 100;
  px2 := 500;
  py2 := 500;
  ipx1 := px1 ;
  ipy1 := py1 ;
  ipx2 := px2 ;
  ipy2 := py2 ;
  f := (1 - sin(DegToRad(45))) * (px2-px1) / SQRT(2);
  Canvas.Rectangle(px1,py1,px2,py2);
  Canvas.Arc(Round(px1 - f),Round(py1 - f),Round(px2 + f),Round(py2 + f), ipx2,ipy2, ipx1, ipy1);
end;
Thomas Wassermann H₂♂
Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
  Mit Zitat antworten Zitat