0

我想使用起点和中心点找到弧的终点。然后我想使用端点(作为新弧的中心)绘制一个新的弧。但我不知道如何找到终点。

p2 是旧弧的中心。

谢谢。

int x = p2.x-radius;
int y = p2.y-radius;
int width = 2*radius;
int height = 2*radius;
int startAngle=(int)Math.toDegrees(Math.atan2(p1.y-p2.y, p1.x-p2.x));
startAngle=(startAngle>0)?(360-startAngle):(startAngle*(-1));

int endAngle=(int)Math.toDegrees(Math.atan2(p3.y-p2.y, p3.x-p2.x));
endAngle=endAngle>0?360-endAngle:endAngle*(-1);
int sweepAngle=Math.abs(startAngle-endAngle);
g.drawArc(x, y, width, height,startAngle,sweepAngle);

那么,我如何绘制新的弧线?

4

0 回答 0