04.12.12, 21:40
|
#9
|
Echter Freak
Registriert seit: Mar 2010
Ort: /home/spartan-b292
Beiträge: 2.856
Bedankt: 1.701
|
Laut diesem Thread :
http://stackoverflow.com/questions/4...246898#4246898
werden die Parameter so berechnet:
Zitat:
int r = (int)Math.sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
int x = x0-r;
int y = y0-r;
int width = 2*r;
int height = 2*r;
int startAngle = (int) (180/Math.PI*atan2(y1-y0, x1-x0));
int endAngle = (int) (180/Math.PI*atan2(y2-y0, x2-x0));
graphics.drawArc(x, y, width, height, startAngle, endAngle);
|
__________________
"They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety"
|
|
|