Back to class index
| Sphere::OptimalEnclosingSphereSyntaxSphere Sphere::OptimalEnclosingSphere(const float4 *pointArray, int numPoints); [58 lines of code]Computes the minimal bounding sphere for the given point array. This function implements Emo Welzl's optimal enclosing sphere algorithm. See "Smallest enclosing disks (balls and ellipsoids)", Lecture Notes in Computer Science 555 (1991) pp. 359-370. The running time is expected linear time, but compared to Ritter's algorithm (the FastEnclosingSphere() function), this algorithm is considerably slower. The implementation of this function is based on the book Geometric Tools for Computer Graphics, pp. 807-813, by Schneider and Eberly. Parametersconst float4 *pointArrayAn array of points to compute an enclosing sphere for. This pointer must not be null. intnumPointsThe number of elements in the input array pointArray. See AlsoSyntaxSphere Sphere::OptimalEnclosingSphere(const float4 &a, const float4 &b); [16 lines of code]Computes the minimal bounding sphere for two points. This function computes the smallest volume sphere that contains the given two points. For two points, the OptimalEnclosingSphere(a, b) is the same as calling FitThroughPoints(a, b). See AlsoSyntaxSphere Sphere::OptimalEnclosingSphere(const float4 &a, const float4 &b, const float4 &c); [64 lines of code]Computes the minimal bounding sphere for three points. For reference, see http://realtimecollisiondetection.net/blog/?p=20 . This function computes the smallest volume sphere that contains the given three points. The smallest enclosing sphere may not pass through all the three points that are specified. SyntaxSphere Sphere::OptimalEnclosingSphere(const float4 &a, const float4 &b, const float4 &c, const float4 &d); [68 lines of code]Computes the minimal bounding sphere for four points. For reference, see http://realtimecollisiondetection.net/blog/?p=20 . This function computes the smallest volume sphere that contains the given four points. The smallest enclosing sphere may not pass through all the four points that are specified. SyntaxSphere Sphere::OptimalEnclosingSphere(const float4 &a, const float4 &b, const float4 &c, const float4 &d, const float4 &e, int &redundantPoint); [32 lines of code]Computes the minimal bounding sphere for four points. This function computes the smallest volume sphere that contains the given five points. Parametersint &redundantPoint [out]Since a sphere is characterized by four points, one of the given points will necessarily be redundant and not part of the support set of the minimal enclosing sphere. This parameter will receive the index [0, 4] of the five input points denoting which point became redundant. (Note that there may be more than one point not lying on the support set of the sphere, but this function only returns one) Return ValueThe smallest volume sphere that encloses the given five points. |