public bool ContainsCircle(SimpleCircle circle) { if (circle.Radius > _radius) { return false; } var distance = GetDistanceBetweenCells(circle); return distance <= Math.Abs(_radius - circle.Radius); }
public bool IntersectCircle(SimpleCircle circle, float padding = 0f) { var distance = GetDistanceBetweenCells(circle); return distance <= circle.Radius + _radius + padding; }
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); }