Source Code (Use browser search to find items of interest.)

Class Index

kfract'Mandel (./kdegraphics/kfract/mandel.h:33)

class Mandel : public Fract 
  {
  public:
    Mandel();
    void init( double center_x, double center_y, 
                       double dx, double dy,
                       int x_max, int y_max, 
                       int iter_max, double bail_out );
    int calcPoint( int x, int y );
    double defaultCenterX();
    double defaultCenterY();
    double defaultWidth();
    double defaultBailout();
  protected:
  private:
  };



kfract'Mandel::Mandel() (./kdegraphics/kfract/mandel.C:37)

Mandel::Mandel()
  {
  }



kfract'Mandel::init() (./kdegraphics/kfract/mandel.C:42)

void Mandel::init( double center_x, double center_y, 
                  double dx, double dy,
                  int x_max, int y_max,
                  int iter_max, double bail_out )
  {
  Fract::init( center_x, center_y, dx, dy,
               x_max, y_max, iter_max, bail_out );
  }



kfract'Mandel::calcPoint() (./kdegraphics/kfract/mandel.C:52)

int Mandel::calcPoint( int x, int y )
  {
  double r = x_values[x], i = y_values[y]; 
  double r_out = r, i_out = i; 
  double tmp, r2 = r * r, i2 = i * i;
  register int iter = 0;

  while ( ( r2 + i2 < bail ) && ( iter < max_iter ) )
    {
    tmp = 2.0 * r_out * i_out + i;
// This is sort of sneaky because we actually compare the values of the
// last iteration to bailout. But the results are very close to those of
// the correct way and it's significantly faster.
    r_out = ( r2 = r_out * r_out ) - ( i2 = i_out * i_out ) + r;
    i_out = tmp;
    iter++;
    }
  return iter;
  }




kfract'Mandel::defaultCenterX() (./kdegraphics/kfract/mandel.C:74)

double Mandel::defaultCenterX()
  {
  return DEFAULT_MANDEL_X;
  }



kfract'Mandel::defaultCenterY() (./kdegraphics/kfract/mandel.C:80)

double Mandel::defaultCenterY()
  {
  return DEFAULT_MANDEL_Y;
  }



kfract'Mandel::defaultWidth() (./kdegraphics/kfract/mandel.C:86)

double Mandel::defaultWidth()
  {
  return DEFAULT_MANDEL_WIDTH; 
  }



kfract'Mandel::defaultBailout() (./kdegraphics/kfract/mandel.C:92)

double Mandel::defaultBailout()
  {
  return DEFAULT_MANDEL_BAILOUT;
  }