A graphical representation of the problem I found on youtube made in processing with java. https://www.youtube.com/watch?v=M64HUIJFTZM&t=2s