         bracketed = true;
       } else {
         float step0 = step;
-        float maxstep = 1.0;
-        // minstep isn't time critical. Small makes
-        // for nice cones.
-        float minstep = 0.0001;
         step = a1*step/(a0-a1);
+        //step = perp(k0,a0,k1,a1);
         if (step < 0.0) step = -step;
         if (step > maxstep) step = maxstep;
         // Don't grow step by more than 10%


const float phi = 1.618033;
const float phi2 = phi*phi;

// Quaternion multiplication as a matrix.
mat4 qmat(float p0, float p1, float p2, float p3) {


void solve(float x0, float y0, float z0,
           float a, float b, float c) {
  float maxstep = 1.0;
  // minstep isn't time critical. Small makes
  // for nice cones.
  float minstep = 0.001;

  float k0 = 0.0, k1;
  float a0 = Fun(x0,y0,z0,1.0), a1;
  bool bracketed = false;
