Example #1
0
        public bool ContainsCircle(SimpleCircle circle)
        {
            if (circle.Radius > _radius)
            {
                return false;
            }

            var distance = GetDistanceBetweenCells(circle);
            return distance <= Math.Abs(_radius - circle.Radius);
        }
Example #2
0
 public bool IntersectCircle(SimpleCircle circle, float padding = 0f)
 {
     var distance = GetDistanceBetweenCells(circle);
     return distance <= circle.Radius + _radius + padding;
 }
Example #3
0
 public float GetDistanceBetweenCells(SimpleCircle circle)
 {
     var distanceX = Position.X - circle.Position.X;
     var distanceY = Position.Y - circle.Position.Y;
     return (float)Math.Sqrt(distanceX * distanceX + distanceY * distanceY);
 }