mpri-graphics-project/tests/TestImplicitSphere.cpp
Théophile Bastian 52ca47cde6 Marching: add test implicit surface and main
The test surface is the sphere TestImplicitSphere
2018-02-11 20:23:21 +01:00

10 lines
273 B
C++

#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);
}