I'm currently working on determining the intersection between an arc and a circle.
I have successfully identified intersections when I treat the arc as a complete circle using the code snippet provided. However, I am facing difficulty in finding a solution to determine the intersection between an actual arc and a circle (or two arcs). The circle data includes center coordinates and radius, while the arc data consists of center coordinates, start point, end point, angle from center to points, start angle, and end angle.
//Calculate distance between two circles
var d = this.center.distanceTo(cursor.center);
// Check for Intersections
if (d > (this.radius + cursor.radius)) {
//Circles do not intersect
return false;
} else if (d < this.radius - cursor.radius) {
// No Solution. One circle is contained within the other
return false;
} else {
// Circles intersect
return true;
}
My goal is to determine the result of the intersection between the arc and circle. Additionally, it would be helpful to identify the coordinates of these intersections, although it is not necessary at this point.
I have reviewed source, but struggle to interpret it into a code formula.