8 if (r12 == 0)
return M_PI;
9 if (r12 >= 2)
return 0;
10 return 2 * acos(r12/2) - 0.5*r12*
sqrt(
std::max(0.0 , 4 - r12*r12));
15 if (r12 >= 2 || r23 >= 2 || r13 >= 2)
return 0;
16 const double r12_2 = r12*r12;
17 const double r13_2 = r13*r13;
18 const double temp = (r12_2 + r13_2 - r23*r23);
19 const double T2 =
std::max(0.0 , 4*r12_2*r13_2 - temp*temp);
26 if (r12 >= 2 || r23 >= 2 || r13 >= 2)
return 0;
27 const double r12_2 = r12*r12;
28 const double r13_2 = r13*r13;
29 const double temp = (r12_2 + r13_2 - r23*r23);
30 const double T2 =
std::max(0.0 , 4*r12_2*r13_2 - temp*temp);
31 const double common = 0.5*( a12 + a13 + a23 -
M_PI +
sqrt(T2)/2 );
double intersection(double r12)