Hacker News new | ask | show | jobs
by kortex 1249 days ago
You would not do it by pixels, it's pure math. I'd have to sit down and work through the actual math, but between convolution and affine transformations, I'm pretty sure there should be a way to compute the intersection with a formula for each piece type.

Knight is the easiest, that's just checking (lol) the distance to see if 5-r/2 <= d < 5+r/2.