Well, I'd imagine the way to do it is to check if the first (x) coordinate is greater than or equal to 10 and less than or equal to 10 plus the width, AND that the height is greater than or equal to 10 and less than or equal to 10 plus the height. In your case, you have the less than or equal to part down, but you forgot to make the case when the point is, say, (1,1) or (17,2). You need another if statement to make sure both coordinates are greater than or equal to 10.