add boundary check for input coordinates in analyzepoint