Calculate distance from point