fixed the compiler error in distance function and added casting for hypotenuse return type
updated the epsilon value
added more test cases