I am working in c# with directX, i need to find the intersection point between two arcs I searched the net but didn't find anything. I have StartPoint,EndPoint,StartAngle,EndAngle,Centre,Radius for both Arcs, now i need Algorithum or formula for finding intersection points between the two Arcs.
A:
Draw a complete circle for both the arcs using (the maths circle equation) the same starting & ending points of both the Arcs then check whether theres any point common between the 2 circles if YES then check whether that common point lies between the starting points & ending points of both the arcs if YES then Arcs intersect.
(x − h)2 + (y − k)2 = r2
where h and k are the x- and y-coordinates of the center of the circle and r is the radius.
KhanZeeshan
2010-10-06 05:33:06
Keep in mind the "2" in the above equation is POWER of the variable.
KhanZeeshan
2010-10-06 05:34:30
Took the liberty of making the formula readable.
Joey
2010-10-06 05:44:26
thanks.I'm new to Stack-Overflow so i didn't know how to do that.
KhanZeeshan
2010-10-06 05:57:04
+1
A:
I have no idea about the embedded functionality in this case. Just algorithm description.
- Check the intersection of circles. Simply compare distance between center points and sum of the radii. Arcs can intersect only in the case of circle intersection.
- Determine intersection points of two circles (maybe only one if you consider touch case). Here is some math description of this.
- For each of the intersection points calculate angle values (simple use of inverse trigonometric formulas). Then check that this values are lay in the interval [StartAngle;EndAngle] for two circles.
UPD: Also, you have to consider coincident circles and return arc intersection (maybe infinite number of points)
MAKKAM
2010-10-06 05:33:15