{"id":16894706,"url":"https://github.com/lggomez/alpha-quad-sim","last_synced_at":"2026-04-13T22:34:40.337Z","repository":{"id":82699954,"uuid":"87656801","full_name":"lggomez/alpha-quad-sim","owner":"lggomez","description":"Small climate simulator as a 2-d 3-body restricted system in Go","archived":false,"fork":false,"pushed_at":"2017-04-12T18:20:59.000Z","size":8627,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T10:42:18.591Z","etag":null,"topics":["database","triangle"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lggomez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-04-08T18:53:45.000Z","updated_at":"2017-04-08T18:57:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c14e9e0a-9350-4379-9a03-de3e483dcec1","html_url":"https://github.com/lggomez/alpha-quad-sim","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/lggomez%2Falpha-quad-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lggomez%2Falpha-quad-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lggomez%2Falpha-quad-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lggomez%2Falpha-quad-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lggomez","download_url":"https://codeload.github.com/lggomez/alpha-quad-sim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244591485,"owners_count":20477710,"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":["database","triangle"],"created_at":"2024-10-13T17:19:39.965Z","updated_at":"2026-04-13T22:34:35.298Z","avatar_url":"https://github.com/lggomez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alpha-quad-sim\n\u003e Small climate simulator of a particular 2-d 3-body restricted system made in Go (and hosted in Google App Engine)\n\nIt makes the following assumptions:\n* The initial state is dry, since planets are aligned with the sun\n* Collinearity of the 3 points in an orbital plane occurs then the area is equal to 0\n* If the 3 planets are collinear and the Sun and the Sun can form a new triangle with 2 points with no area, then the Sun is also collinear with them\n* It takes the continuation of several continued days with the same climate as a period. With each climate transition it increments the period number of that climate\n\nIf the area is *tending* to 0 then the climate is on it's peak rain point. We explain it with the following heuristic:\n1. The largest possible side is 3000, given by the line between the most distant opposite planets V and B\n2. The largest inscribed triangle inside a circle is the equilateral triangle, and considering we can’t construct one with these orbits, the largest one for this case will be an isosceles triangle\n3. Following points i and ii and solving via Pythagoras theorem, we can deduct that the largest perimeter tends (but it's not equal) to 6000. This is because the point at which the triangle becomes isosceles is when the area tends to 0 and the sides converge into a line\n\n\n## Development\n\nPrerequisites: Go 1.6 and the Google App Engine SDK are required. Also, this solution is made to be deployed into a Google App Engine project along with a Google Cloud MySQL instance. Both the solution and the database instance should belong to the same project\n\nOther considerations are the following:\n* The job that initializes the database with newly calculated values can be triggered with the job in **cron.yaml**. The job only populates the database and doesn't delete previous values\n* The database connection can be configured in **app.yaml**\n\n## Database\nThe MySQL database connection can be configured via the environment variables in **app.yaml**\n\nThe database name is *climateregistry* and the only table used is *climates*. It's structure is the folloing:\n```\n+-------------+-------------+------+-----+---------+----------------+\n| Field       | Type        | Null | Key | Default | Extra          |\n+-------------+-------------+------+-----+---------+----------------+\n| climate     | varchar(20) | YES  |     | NULL    |                |\n| climate_day | int(11)     | YES  |     | NULL    |                |\n| id          | int(11)     | NO   | PRI | NULL    | auto_increment |\n+-------------+-------------+------+-----+---------+----------------+\n```\n## Deployment/Testing\nThe repository has to be in the **$GOPATH/src** directory\n\nBuild:\n```\ngo build\n```\nUnit tests can be run with the following command:\n```\ngo test\n```\nDeploy it to a Go App Engine project:\n```\ngcloud app deploy\n```\n\nThe app can be run locally, allowing to test the api locally via localhost:3000/8080. It will also print stats for the default duration of 10 years:\n```\n./alpha-quad-sim offline\n```\n\n## API\n\nThe live version can be found at https://superb-webbing-163902.appspot.com and the current api usages are the following:\n\n* https://superb-webbing-163902.appspot.com/clima/566\n* https://superb-webbing-163902.appspot.com/clima?dia=566\n* https://superb-webbing-163902.appspot.com/clima/?dia=566\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flggomez%2Falpha-quad-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flggomez%2Falpha-quad-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flggomez%2Falpha-quad-sim/lists"}