When I call the fabs function for the double argument z (at that moment equal to -10.47749), I suddenly get an output value of type int equal to 4991. What is the problem and how to correctly take the module from the number?
double segment_area(double d, double friend_r, double foe_r) { double z = (foe_r * foe_r) - (friend_r * friend_r); double alpha = 2.0 * asin(friend_r - ((((d - (fabs(z) / d)) / 2.0) * ((d - (fabs(z) / d)) / 2.0))) / friend_r); printf("%lf\n", alpha); return 0; } Debag version of the function, which, given the distance of the centers of the circles and their radii, considers the radian measure of the central angle formed by the intersection points of these circles