18 template <
typename Real>
20 Circle2<Real>& circle);
23 template <
typename Real>
24 bool InContainer(Vector2<Real>
const& point, Circle2<Real>
const& circle);
27 template <
typename Real>
29 Circle2<Real>
const& circle1, Circle2<Real>& merge);
32 template <
typename Real>
37 for (
int i = 1; i < numPoints; ++i)
39 circle.
center += points[i];
41 circle.
center /= (Real)numPoints;
43 for (
int i = 0; i < numPoints; ++i)
46 Real radiusSqr =
Dot(diff, diff);
47 if (radiusSqr > circle.
radius)
57 template <
typename Real>
64 template <
typename Real>
69 Real lenSqr =
Dot(cenDiff, cenDiff);
71 Real rDiffSqr = rDiff*rDiff;
73 if (rDiffSqr >= lenSqr)
75 merge = (rDiff >= (Real)0 ? circle1 : circle0);
79 Real
length = sqrt(lenSqr);
82 Real coeff = (length + rDiff) / (((Real)2)*
length);
bool GetContainer(int numPoints, Vector3< Real > const *points, Capsule3< Real > &capsule)
bool MergeContainers(Capsule3< Real > const &capsule0, Capsule3< Real > const &capsule1, Capsule3< Real > &merge)
bool InContainer(Vector3< Real > const &point, Capsule3< Real > const &capsule)
GLfixed GLfixed GLint GLint GLfixed points
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLuint GLsizei GLsizei * length
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)