2018-02-11 20:23:07 +01:00
|
|
|
#include "TestImplicitSphere.hpp"
|
|
|
|
|
|
|
|
double TestImplicitSphere::operator()(double x, double y, double z) const {
|
|
|
|
auto sq = [](double x) { return x*x; };
|
|
|
|
return - (sq(center.x - x)
|
|
|
|
+ sq(center.y - y)
|
|
|
|
+ sq(center.z - z))
|
|
|
|
+ sq(radius);
|
|
|
|
}
|
2018-02-13 18:42:15 +01:00
|
|
|
|
|
|
|
Point TestImplicitSphere::location_hint() const {
|
|
|
|
return Point(center.x + radius, center.y, center.z);
|
|
|
|
}
|