Using Graphics2D, you can use the rotate (theta, x, y) function to accurately draw one end of your arc:
g2.rotate(-1*thetaStartRadians,xc,yc); g2.drawArc(x1,y1,width,height,0, thetaLengthDegrees-1); g2.rotate(thetaStartRadians,xc,yc);
Then you just need to accurately draw the last bit on the other side:
g2.rotate(-1*thetaLengthRadians,xc,yc); g2.drawArc(x1,y1,width,height,0,-2)); g2.rotate(thetaLengthRadians,xc,yc);
And you will have one arc drawn for exact theta values. This is probably not the most efficient way to do this, in a machine-made way, due to the partial overlap of the redraw; but this is the easiest way to do this that I can think of.
source share