Browse Source

Merge branch 'master' of localhost:AwesomeAttractor

master
Joshua Moerman (@Kassalade) 14 years ago
parent
commit
f9f8d595a1
  1. 7
      kernels/UnravelHeart3D.hpp

7
kernels/UnravelHeart3D.hpp

@ -20,9 +20,12 @@ public:
vectorNew[1] = parameters[2]*(vectorOld[0] + parameters[3]);
vectorNew[2] = parameters[4]*(vectorOld[1] + parameters[5]);
const double dist = vectorNew[0]*vectorNew[0] + vectorNew[1]*vectorNew[1] + 2.0*vectorNew[2]*vectorNew[2];
const double x = vectorNew[0] / parameters[6];
const double y = vectorNew[1] / parameters[6];
const double z = vectorNew[2] / parameters[6];
const double dist = x*x + y*y + 2.0*z*z;
if(parameters[7] * dist - parameters[7] > vectorNew[0]*vectorNew[0]*vectorNew[1]*vectorNew[1]*vectorNew[1]) {
if(parameters[7] * dist - parameters[7] > x*x*y*y*y) {
const double sqrtDist = std::sqrt(dist);
const double p = 1.0 - parameters[6] * (static_cast<int>(sqrtDist / parameters[6]) + 1.0) / sqrtDist;
vectorNew[0] *= p;