If you're interested in some more details, take a look at this post I made (and am admittedly still polishing) that discusses the method in a low-dimensional space. I am trying to make it more accessible to the community since explaining it for higher-dimensional robot control / hybrid-contact dynamical systems is a whole other thing :)