I should give a nice big link of thanks to Paul Bourke and his excellent website, which has been helping novice programmers like me find answers to their geometry questions for many years.
Paul Bourke was one of the first people to publish clear, concise, down-to-earth solutions to common math questions from a computer programming standpoint. While in college, I took a class taught by Golan Levin, who introduced us to the website.
When other sites will be using matrices and trigonometry to approach a simple problem, Paul Bourke’s solutions rely almost solely on basic arithmetic. This is a good thing.
Whenever you see a variable prefixed with a “pb” in my code, that’s my acknowledgment that the solution was derived from the ones posted on his site.