Here's an in-depth explanation with an interactive demo that I made many moons ago:
https://web.archive.org/web/20130728183938/williamcotton.com...