The second hand of clock vibrates
How to fix it? I tried all possible solutions https://code.sololearn.com/WeNMisS0YyH9/?ref=app
I made some amendments around line 58. The main issue here is the conditions you use to decide whether to draw or not draw the dots. The original approach is to not draw the line if it goes out of bounds of the threshold. This works, but since we are comparing floating point values, the resulting 'edge' is inconsistent, giving the illusion that the line 'vibrates'. The alternate approach is to coerce gx into the limits of the threshold, allowing for a consistent edge. https://code.sololearn.com/WnN51O571ht3/?ref=app
Sarthak 🇳🇵 I tried to understand how you made the boundaries, then saw the comparisons you used. It was just a lucky guess and some trial-and-error in the end, which turned out to be the root cause. I also tried flooring the variables to get rid of the float comparisons, but that resulted in pixelated curves. :D
Cool, how did you figure it out? I'd have spent few hours debugging it.