implemented get horizontal distance (collision warning)