testing distance formula