private void reset() { this.frame = new Frame(this.size); this.createInitialPoints(); this.currentPoint = new Vec2(rand.Next((int)this.radius), rand.Next((int)this.radius)); }
private void nextPoint() { var targetPoint = this.initialPoints[rand.Next(this.initialPoints.Count())]; var dx = targetPoint.X - this.currentPoint.X; var dy = targetPoint.Y - this.currentPoint.Y; var x = dx * this.fractionalMove + this.currentPoint.X; var y = dy * this.fractionalMove + this.currentPoint.Y; var newPt = new Vec2(x, y); //Debug.Print(string.Format("current pt: {0}, target pt: {1}, resultant pt: {2}", // this.currentPoint, targetPoint, newPt)); this.currentPoint = newPt; addPoint(newPt); }
private void addPoint(Vec2 v) { this.frame.Set(v); }
private void createInitialPoints() { this.initialPoints = new List<Vec2>(); var dTheta = (Math.PI * 2) / this.numberOfVertices; double theta = 0; for (int i = 0; i < this.numberOfVertices; i++) { int x = (int)Math.Round(this.radius * Math.Cos(theta)); int y = (int)Math.Round(this.radius * Math.Sin(theta)); var v = new Vec2(x, y); this.initialPoints.Add(v); theta += dTheta; } }
internal void Set(Vec2 v) { this.frame[v.X + r][v.Y + r] = 255; }