Function to drawing Arc in Java
Hello Everybody!!
I have already posted this on the "Jave Programming" forum but this place might be more helpful. I am working on a diagram editor and what I want to do is to allow the user to connect pairs of objects using arcs. ( see this picture http://www.csee.umbc.edu/~squire/images/451-f2.jpg ).
The default drawArc
method in the Graphic class basically requires six parameters: x, y, width, height, startAngle, arcAngle. (EXPLANATION: x - the x coordinate of the upper-left corner of the arc to be drawn, y - the y coordinate of the upper-left corner of the arc to be drawn, width - the width of the arc to be drawn , height - the height of the arc to be drawn , startAngle - the beginning angle, arcAngle - the angular extent of the arc, relative to the start angle ).
Say I want to draw an arc from one point (x1 ,y1) to another point (x2,y2) , how would I determine width, height, startAngle, arcAngle ?
Any help would be greatly appreciated.

