Closed danburzo closed 5 years ago
Confirmed. https://beta.observablehq.com/d/efdc14bd2b7292c4
Most likely related to this test:
Just noticed you already linked to an Observable notebook to reproduce this issue. Well played, sir.
I wouldn't dare show up without an Observable notebook to reproduce this issue! :)
Would you say that it's benign that the pie()
generator produces π as the angle for most identical value pairs, but "almost π" for [6, 6]
? (I still have to read more carefully through the code to have any useful points to make).
It’s not exactly π because the padAngle is non-zero.
Looking through the code for the pie()
generator, it seems that in the case of N identical values, the padAngle gets eliminated and the angle span for each slice is (2 * π / N), which for N = 2 gives us π — in most cases, except that for [6, 6]
and particular padAngle values it results in not-quite-π.
(Not sure if it's relevant but it seems counter-intuitive for the padAngle to evaporate in these specific cases? Edit: I realized later that padAngle is included within each slice's angle span)
While toying with the parameters for
pie
andarc
, I have found a glitch for this configuration:Which outputs this shape:
Not sure if it warrants further investigation, but I wanted to let you know.
Seems to be a kind of floating point error, since it happens only on specific combinations of values and radii.
Other combinations can cause different glitches:
Outputs the shape below: