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; } } }
public override bool Equals(object obj) { FractalVector2 target = (FractalVector2)obj; return(target.x == this.x && target.y == this.y); }
public FractalVector2(FractalVector2 v) { this.x = v.x; this.y = v.y; }
public FractalComplexNumber(FractalVector2 v) { this.Real = v.x; this.Imaginary = v.y; }