I am writing a converter for 2D geometry data. One of the elements I have to convert is an arc. In the source system the arc is described with two axis aligned rectangles. The first rectangle is a boundingbox for the circle of which the arc is part of. The second rectangle is a boundingbox for the arc itself. The constraint is, that the arc's boundingbox must intersect two edges of the circle's boundingbox. I know the coordinates of the top left and bottom right points of each rectangle.
The target system describes an arc as follows: A rectangle is a bounding box around the circle of which the arc is part of. So far it is the same as above. Then I have two points designating the start and end points of the arc. Both points must be exactly on the circle's "edge".
The question is: do you see an easy way to calculate the start and end-point of the arc? I have already seen this question but it seems really complicated. Perhaps there is an easier way to do this...
My thoughts so far:
It seems I must calculate the intersections of the edges of the arc's boundingbox with the circle. Two cases are possible (due to the restrictions mentioned above): only one edge intersects with the circle or two edges intersect with the circle. Additionally all other edges will always be outside of the circle.
Update: the start and end points cut the circle in two parts. Which of the two parts is draw as the arc, is determined by the order of the start and end points. The arc is always drawn counter clockwise from start to end point.