X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgeometry%2Fhypersphere.h;h=de028fa580d627ed06d1cb811f43b104a450ed7a;hb=cc51208545c3941fcfdb078ad0c70c7fd607614e;hp=01aee0e57b22e2791763077aecb3e3193ea35843;hpb=643aa7b2317f88463f66da11e595ebe0f6c9621d;p=libs%2Fmath.git diff --git a/source/geometry/hypersphere.h b/source/geometry/hypersphere.h index 01aee0e..de028fa 100644 --- a/source/geometry/hypersphere.h +++ b/source/geometry/hypersphere.h @@ -2,6 +2,7 @@ #define MSP_GEOMETRY_HYPERSPHERE_H_ #include +#include #include #include "hyperbox.h" #include "ray.h" @@ -44,7 +45,10 @@ inline HyperSphere::HyperSphere(): template inline HyperSphere::HyperSphere(T r): radius(r) -{ } +{ + if(r<=T(0)) + throw std::invalid_argument("HyperSphere::HyperShpere"); +} template inline HyperSphere *HyperSphere::clone() const