Make the function pointsInRange in figure class