UPDATE on 16/04/2019: I've made another picture by modifying the cycloid curve, you can see it
here
.
UPDATE on 19/08/2020: I've implemented a
similar program
in my own programming language, also runnable in a browser (though only in modern ones).