public override bool IsWithin(IContainable shape) { var leftTip = new Location(Location.X - Radius, Location.Y); var rightTip = new Location(Location.X + Radius, Location.Y); var topTip = new Location(Location.X, Location.Y + Radius); var bottomTip = new Location(Location.X, Location.Y - Radius); bool isWithin = ( shape.DoesContainThePoint(leftTip) && shape.DoesContainThePoint(rightTip) && shape.DoesContainThePoint(topTip) && shape.DoesContainThePoint(bottomTip) ); return(isWithin); }
public override bool IsWithin(IContainable shape) { var topLeft = GetTopLeftPoint(); var topRight = GetTopRightPoint(); var bottomLeft = GetBottomLeftPoint(); var bottomRight = GetBottomRightPoint(); bool isWithin = ( shape.DoesContainThePoint(topLeft) && shape.DoesContainThePoint(topRight) && shape.DoesContainThePoint(bottomLeft) && shape.DoesContainThePoint(bottomRight) ); return(isWithin); }
public override bool IsWithin(IContainable shape) { bool isWithin = shape.DoesContainThePoint(Location) && shape.DoesContainThePoint(EndLocation); return(isWithin); }