int intersect(struct circle_t const circles[], struct point_t intersections[]);
where
point_t
and circle_t
arestruct point_t {
double x;
double y;
};
struct circle_t {
point_t center;
double r;
};
intersect
takes 2 circles as parameter, returns the number of points of intersection, and the details of the points will be put in parameter intersection
. Since 2 circles may have up to 2 points of intersection, we may call that function in following way: