# torus

Published articles for torus.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Visualizing an Assassin Puzzle

DevFeed: [Visualizing an Assassin Puzzle](<https://devfeed.tech/articles/visualizing-an-assassin-puzzle-40422.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2018/07/24/visualizing-an-assassin-puzzle/>)

Published: 2018-07-24T08:00:09Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Computing](<https://devfeed.tech/topics/computing.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [d3](<https://devfeed.tech/topics/d3.md>), [Demo](<https://devfeed.tech/topics/demo.md>), [Library](<https://devfeed.tech/topics/library.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [computing](<https://devfeed.tech/tags/computing.md>), [d3](<https://devfeed.tech/tags/d3.md>), [demo](<https://devfeed.tech/tags/demo.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [library](<https://devfeed.tech/tags/library.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [programming](<https://devfeed.tech/tags/programming.md>), [software](<https://devfeed.tech/tags/software.md>), [torus](<https://devfeed.tech/tags/torus.md>), [visualization](<https://devfeed.tech/tags/visualization.md>)

### AI overview

This tutorial presents a visualization of an assassin puzzle in which shots bounce around a square like billiards and guards must block possible paths to a target. It explains the d3-based visualization and the geometric functions used to trace bouncing rays and calculate guard positions.

### Source excerpt

Over at Math3ma, Tai-Danae Bradley shared the following puzzle, which she also featured in a fantastic (spoiler-free) YouTube video. If you're seeing this for the first time, watch the video first. Consider a square in the xy-plane, and let A (an "assassin") and T (a "target") be two arbitrary-but-fixed points within the square. Suppose that the square behaves like a billiard table, so that any ray (a.k.a "shot") from the assassin will bounce off the sides of the square, with the angle of incidence equaling the angle of reflection.