{"id":48838386,"url":"https://github.com/gdifiore/libgolf","last_synced_at":"2026-04-15T01:00:19.668Z","repository":{"id":239827299,"uuid":"788187916","full_name":"gdifiore/libgolf","owner":"gdifiore","description":"libgolf - golf ball trajectory calculation","archived":false,"fork":false,"pushed_at":"2026-04-12T23:06:41.000Z","size":497,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-13T01:08:11.348Z","etag":null,"topics":["cmake","cpp","cpp-lib","cpp-library","cpp-math","cpp-math-library","golf","math","math-library","oop","physics","simulation","trajectory"],"latest_commit_sha":null,"homepage":"https://gdifiore.github.io/libgolf/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gdifiore.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-18T00:07:20.000Z","updated_at":"2026-03-29T23:18:51.000Z","dependencies_parsed_at":"2026-03-17T20:00:46.089Z","dependency_job_id":null,"html_url":"https://github.com/gdifiore/libgolf","commit_stats":null,"previous_names":["gdifiore/libshotscope"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/gdifiore/libgolf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdifiore%2Flibgolf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdifiore%2Flibgolf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdifiore%2Flibgolf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdifiore%2Flibgolf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gdifiore","download_url":"https://codeload.github.com/gdifiore/libgolf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdifiore%2Flibgolf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31821685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cmake","cpp","cpp-lib","cpp-library","cpp-math","cpp-math-library","golf","math","math-library","oop","physics","simulation","trajectory"],"created_at":"2026-04-15T01:00:19.149Z","updated_at":"2026-04-15T01:00:19.658Z","avatar_url":"https://github.com/gdifiore.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libgolf\n`libgolf` is a C++ library that simulates golf ball trajectories from initial conditions: velocity, spin, and atmospheric data. It computes full flight paths including aerial phase, bounce, and roll.\n\nThe in-air math here is based on [work done](http://baseball.physics.illinois.edu/trajectory-calculator-golf.html) by Prof. Alan M. Nathan at the  University of Illinois Urbana-Champaign.\n\n## Requirements\n\n- C++20 or later\n- CMake 3.14+\n\n## Build\n```bash\ngit clone https://github.com/gdifiore/libgolf.git\n\ncd libgolf\n\nchmod +x build.sh\n\n./build.sh\n```\n\n## Features\n\n- Full trajectory simulation with automatic phase transitions (aerial → bounce → roll)\n- Dynamic ground surfaces - fairways, roughs, greens, elevation changes\n- 3D terrain system with slopes and varying surface normals\n- Pluggable aerodynamic model — implement custom Cd/Cl/spin-decay behaviour\n- Efficient step-by-step numerical integration\n\n## Documentation\n\n- [Getting Started](/docs/how.md) - Basic usage and examples\n- [Terrain System](/docs/terrain.md) - Custom terrain with elevation, slopes, and varying surfaces\n- [Aerodynamic Models](/docs/aerodynamic_model.md) - Custom drag, lift, and spin-decay models\n\n### Quick Example\n\n```cpp\n#include \u003clibgolf.hpp\u003e\n\nconst LaunchData ball{\n    .ballSpeedMph = 160.0f,\n    .launchAngleDeg = 11.0f,\n    .directionDeg = 0.0f,\n    .backspinRpm = 3000.0f,\n    .sidespinRpm = 0.0f,\n};\nconst AtmosphericData atmos{\n    .temp = 70.0f,\n    .elevation = 0.0f,\n    .vWind = 0.0f,\n    .phiWind = 0.0f,\n    .hWind = 0.0f,\n    .relHumidity = 50.0f,\n    .pressure = 29.92f,\n};\nGroundSurface ground; // Default fairway\n\nFlightSimulator sim(ball, atmos, ground);\nsim.run();\n\nLandingResult result = sim.getLandingResult();\nprintf(\"Distance: %.1f yards\\n\", result.distance);\n```\n\nFor terrain with slopes or position-dependent surfaces, see the [Terrain System](/docs/terrain.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdifiore%2Flibgolf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgdifiore%2Flibgolf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdifiore%2Flibgolf/lists"}