private void PopulateData()
        {
            FractalVector2 interpolatedPoint = mInitialPoint;

            for (int i = 0; i < Iterations; ++i)
            {
                int            selectedCircle  = mRandom.Next(mNumberOfMainCircles + 1);
                FractalVector2 delta           = interpolatedPoint - mMainCircles [selectedCircle].Center;
                float          deltaMagnitude  = delta.Magnitude;
                FractalVector2 deltaNormalized = delta.Normalize();
                float          deltaRadius     = mMainCircles [selectedCircle].Radius * mMainCircles [selectedCircle].Radius / deltaMagnitude;
                interpolatedPoint = deltaNormalized * deltaRadius + mMainCircles [selectedCircle].Center;
                int coordX = (int)(mData.GetUpperBound(0) * (interpolatedPoint.x + mViewportExtents) / (mViewportExtents * 2f));
                int coordY = (int)(mData.GetUpperBound(1) * (interpolatedPoint.y + mViewportExtents) / (mViewportExtents * 2f));
                try
                {
                    mData[coordX, coordY] += mStepValue;
                    mData[coordX, coordY]  = (mData[coordX, coordY] > 1f) ? 1f : mData[coordX, coordY];
                }
                catch (Exception) {
                    continue;
                }
            }
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            FractalVector2 target = (FractalVector2)obj;

            return(target.x == this.x && target.y == this.y);
        }
Пример #3
0
 public FractalVector2(FractalVector2 v)
 {
     this.x = v.x;
     this.y = v.y;
 }
Пример #4
0
 public FractalComplexNumber(FractalVector2 v)
 {
     this.Real      = v.x;
     this.Imaginary = v.y;
 }