public void UpdateCenter(Point2D center, Vector up) { this.Center = center; this.Up = up; MinRadius = double.MaxValue; foreach (var coord in Points) { coord.CalculateCenter(this.Center, this.Up); if (coord.Radius < MinRadius) MinRadius = coord.Radius; } InitHistogram(); }
public void UpdateCenter(Point2D center) { UpdateCenter(center, this.Up); }
public void AddPoint(Point2D position) { var coord = new PolarCoord(position); AddPoint(coord); }
public void UpdatePosition(Point2D center, Vector up) { int x = (int)(center.X + Math.Cos(this.Angle * Math.PI / 180.0) * this.Radius); int y = (int)(center.Y + Math.Sin(this.Angle * Math.PI / 180.0) * this.Radius); this.Position = new Point2D(x, y); }
public void CalculateCenter(Point2D center, Vector up) { Vector v = new Vector(Position.X - center.X, Position.Y - center.Y); this.Radius = v.Length; int angle = (int)MathUtility.Get2DAngle(up, v); this.Angle = (int)MathUtility.NormalizeAngle(angle); }
public PolarCoord(Point2D position) : this() { this.Position = position; }