ChatGPT - Closest point formula