Choose Distance Object Implemented but getting wrong resutls becuase of double precision