X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhypersphere.h;h=ce424e141cb32bbd9e5b8ed1b59cf9aee05ed617;hb=aee0d4c9f7d4dc6ac77b6ff3429973f16d86144b;hp=f95ebe4182094667533e2cec0914210cb7b79337;hpb=9260eee3126731c1e6b54ce3407be757d0d71716;p=libs%2Fmath.git diff --git a/source/geometry/hypersphere.h b/source/geometry/hypersphere.h index f95ebe4..ce424e1 100644 --- a/source/geometry/hypersphere.h +++ b/source/geometry/hypersphere.h @@ -10,6 +10,10 @@ namespace Msp { namespace Geometry { +/** +A shape consisting of the points within a specific distance from the origin. +Two- and three-dimensional cases are Circle and Sphere, respectively. +*/ template class HyperSphere: public Shape { @@ -86,12 +90,13 @@ inline unsigned HyperSphere::get_intersections(const Ray &ray, Surfa for(int i=-1; i<=1; i+=2) { T x = mid+offset*i; - if(x>0 && n