Example #1
0
        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();
        }
Example #2
0
 public void UpdateCenter(Point2D center)
 {
     UpdateCenter(center, this.Up);
 }
Example #3
0
 public void AddPoint(Point2D position)
 {
     var coord = new PolarCoord(position);
     AddPoint(coord);
 }
Example #4
0
 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);
 }
Example #5
0
        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);
        }
Example #6
0
 public PolarCoord(Point2D position)
     : this()
 {
     this.Position = position;
 }