Meta Interview Question

Calculate shorter distance based on 2 points based on mathematical formula.