Old school D3 from simpler times

From the Nautilus magazine article The Impossible Mathematics of the Real World:

Then there’s the missing-square puzzle. In this one (above), a right triangle is cut up into four pieces. When the pieces are rearranged, a gap appears. Where’d it come from? It’s a near miss. Neither “triangle” is really a triangle. The hypotenuse is not a straight line, but has a little bend where the slope changes from 0.4 in the blue triangle to 0.375 in the red triangle. The defect is almost imperceptible, which is why the illusion is so striking.

Also see the Wikipedia page: Missing square puzzle.

https://d3js.org/d3.v4.min.js