improve distance method's perfomance
optimize calculate_new_point_in_random_direction