I'm looking for some general guidelines/equations I can use to analyze circuits which use comparators. In particular, I'm interested in hysteresis.
For example, take the following open collector/drain comparator circuit with hysteresis:

How did they derive the equations for calculating hysteresis? I tried doing some analysis assuming op-amp like behavior (assumed that input terminals source/sink negligible current, did not assume that the input terminals have equal voltages, clamped output voltage to [Vee, Vcc]), but I wasn't able to get the desired output results.