{"id":16403520,"url":"https://github.com/kevinfrei/rollercoaster","last_synced_at":"2025-04-04T14:26:32.237Z","repository":{"id":16485956,"uuid":"80033297","full_name":"kevinfrei/rollercoaster","owner":"kevinfrei","description":"A 2D rollercoaster simulator for use in high school math classes","archived":false,"fork":false,"pushed_at":"2023-02-09T07:20:19.000Z","size":4601,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T05:34:40.027Z","etag":null,"topics":["asciimath","physics","physics-simulation","school-education","simulator"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinfrei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-25T16:33:34.000Z","updated_at":"2022-10-14T09:37:10.000Z","dependencies_parsed_at":"2023-02-18T18:31:06.729Z","dependency_job_id":null,"html_url":"https://github.com/kevinfrei/rollercoaster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinfrei%2Frollercoaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinfrei%2Frollercoaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinfrei%2Frollercoaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinfrei%2Frollercoaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinfrei","download_url":"https://codeload.github.com/kevinfrei/rollercoaster/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247192574,"owners_count":20899126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asciimath","physics","physics-simulation","school-education","simulator"],"created_at":"2024-10-11T05:49:37.634Z","updated_at":"2025-04-04T14:26:32.207Z","avatar_url":"https://github.com/kevinfrei.png","language":"JavaScript","readme":"# Currently busted!\nI updated some components but haven't worked through the breaking changes yet.\n`master` is broken, currently. I probably should tag a working release. \nBut I haven't bothered. Sorry.\n\n# Rollercoaster\n\nThis is a 2D \"rollercoaster\" simulator for use in high school math classes.\nIt's written in ES6 Flow, a typed version of ES6 Javascript from Facebook,\nbecause I like having compilers find bugs in my code for me, and I work at\nFacebook currently.\n\nThe idea is that you enter a list of functions with a range, and,\nif it's continuous, this will simulate a car being dropped, starting\nat X=0, down the track. If the car leaves the track, bad things\nhappen.\n\nTry it out yourself [here](https://kevinfrei.github.io/rollercoaster/).\n\n## Getting Started\n\nTo run the system, install the\n[Yarn package manager](https://yarnpkg.com/docs/install),\nthen go to the root directory and type `yarn` then, once all the dependencies\nare downloaded, type `yarn start` and the app will launch in a web browser.\nI assume it will also work with npm instead of yarn, but again, I work at\nFacebook, and yarn seems both faster \u0026 more reliable.\n\nI'm using React for rendering. I'm not a trained web dev by any measure (I do\nC++ compilers), so you'll have to forgive pretty much everything about the\nsystem. It's mostly been a bunch of kind of fun little math problems, attached\nto a visualization problem.\n\n## Packaging the code\n\n`yarn build` will minify, babelify (translate from ES6 Flow to ES5 Javascript),\nand package everything into the `build` subdirectory. You can then copy that to\nyour 'puter, and just open it. Since it's all just HTML \u0026 Javascript, the idea\nis that even in the most locked down computer, it can be run without needing\nadmin privileges.\n\n## The code itself\n\nIt all lives under `src`. From there, `App.js` is the main entry point.\n`FuncList.js` contains the UI for the functions.\n`FuncGraph.js` contains the UI for the graph.\n`UserFunction.js` contains the data for the functions.\n`PhysicSim.js` contains the majority of the interesting math.\n`coasterRedux.js` are where the UI state management stuff lives.\n\n### TODO:\n\n* Math work:\n  * Handle non-derivable tangents. Smooth them, probably. mathjs seems to be\n    able to produce the derivative. Given that capability, I could stop\n    estimating the derivative, and just use mathjs to do it...\n  * MathJS and AsciiMath aren't _quite_ compatible. The fix is to probably parse\n    the AsciiMath and compile it myself. This seems like a lot of work. An\n    alternative would be to translate the common mathjs expressions into their\n    corresponding asciimath representation. This is probably less work. Both are\n    going to take a fair bit of time...\n  * Fix the physics sim to not provide more acceleration when hitting the track.\n    As it stands, there are scenarios where the estimate results in more\n    distance, which causes weird fake acceleration. It looks like heading\n    backward causes this. TODO: I cropped this using some simple kinetic vs.\n    potential energy calculation. There's clearly a problem here, but that seems\n    to do a decent job. Another upside is that it basically adds friction\n    (friction winds up just being the error in the estimation code)\n* UI Work:\n  * Add a \"follow the cart\" zoom mode\n  * Make a better, semi-modal function editor:\n    * with help\n    * continuity assistance\n    * derivability guidance, perhaps\n  * Prevent the graph from attempting to draw if the functions aren't at least\n    calculable.\n  * The MathJax rendered stops responding occasionally. Debug this...\n  * The UI needs *serious* work...\n* Other work:\n  * Improve the tests. A lot.\n  * Do I want to try to make it work on IE? Edge, Chrome, FireFox, and Safari\n    all seem to work just fine...\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinfrei%2Frollercoaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinfrei%2Frollercoaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinfrei%2Frollercoaster/lists"}