Sight rays http://agentcooper.github.io/sight-rays Playing around with some linear algebra. Things to read up to understand the code: Inverse trigonometric functions Line-line intersection Parameterized segment intersection Based on https://github.com/ncase/sight-and-light.