calculate real distance