{"id":15887819,"url":"https://github.com/scalamath/geomlib","last_synced_at":"2025-04-02T16:43:11.524Z","repository":{"id":236458816,"uuid":"792653262","full_name":"ScalaMath/GeomLib","owner":"ScalaMath","description":"Open source scala library that provides data structures for simple geometric shapes","archived":false,"fork":false,"pushed_at":"2024-06-28T15:53:21.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-08T07:23:43.114Z","etag":null,"topics":["geometric-transformation","geometry","graphics","linear-algebra","math","mathematics","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScalaMath.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["HexagonNico"],"ko_fi":"HexagonNico","custom":["https://paypal.me/hexagonnico"]}},"created_at":"2024-04-27T07:16:46.000Z","updated_at":"2024-06-28T15:53:17.000Z","dependencies_parsed_at":"2024-04-27T08:25:11.140Z","dependency_job_id":"7ae272b2-19b8-4f52-b1cf-e49dca75e29a","html_url":"https://github.com/ScalaMath/GeomLib","commit_stats":null,"previous_names":["scalamath/geomlib"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScalaMath%2FGeomLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScalaMath%2FGeomLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScalaMath%2FGeomLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScalaMath%2FGeomLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScalaMath","download_url":"https://codeload.github.com/ScalaMath/GeomLib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246852958,"owners_count":20844496,"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":["geometric-transformation","geometry","graphics","linear-algebra","math","mathematics","scala"],"created_at":"2024-10-06T06:05:00.816Z","updated_at":"2025-04-02T16:43:11.503Z","avatar_url":"https://github.com/ScalaMath.png","language":"Scala","funding_links":["https://github.com/sponsors/HexagonNico","https://ko-fi.com/HexagonNico","https://paypal.me/hexagonnico"],"categories":[],"sub_categories":[],"readme":"\n# GeomLib\n\nA Scala library for geometry and primitive shapes.\n\n## Project goals\n\nGeomLib is an extension of [VecMatLib](https://github.com/ScalaMath/VecMatLib) for geometry.\n\nAll operations in GeomLib are designed to **not** modify the object on which the operation is invoked to respect the principles of purity and immutability of functional programming.\n\nAll classes are written in Scala, but are designed to be completely interoperable with Java.\nAll methods with symbolic names have an alias for better interoperability with java.\n\n## Geometry and shapes\n\nGeomLib offers a representation for primitive 2D and 3D shapes useful for collision detection algorithms and graphics rendering such as Rectangles, Circles, Spheres and Axis-Aligned Bounding Boxes.\n\nScala example:\n\n```scala\nval rect1 = Rect2(2.0f, 1.0f, 4.0f, 3.0f)\nval rect2 = Rect2(3.0f, 2.0f, 5.0f, 4.0f)\nif(rect1.intersects(rect2)) {\n  // ...\n}\n```\n\nJava example:\n\n```java\nRect2 rect1 = new Rect2(2.0f, 1.0f, 4.0f, 3.0f);\nRect2 rect2 = new Rect2(3.0f, 2.0f, 5.0f, 4.0f);\nif(rect1.intersects(rect2)) {\n    // ...\n}\n```\n\nGeomLib can also be used together with [VecMatLib](https://github.com/ScalaMath/VecMatLib) to represent geometric transformations.\n\n```scala\nval transform = Mat3x4f.translation(x, y, z) * Mat4f.rotation(x, y, z) * Mat4f.scaling(x, y, z)\nval plane = Plane(0.0f, 1.0f, 0.0f, 2.0f)\nval transformedPlane = transform * plane\n```\n\n```java\nvar transform = Mat3x4f.translation(x, y, z)\n        .multiply(Mat4f.rotation(x, y, z))\n        .multiply(Mat4f.scaling(x, y, z));\nvar plane = new Plane(0.0f, 1.0f, 0.0f, 2.0f);\nvar transformedPlane = plane.transform(transform);\n```\n\n## Multithreading\n\nDue to GeomLib not using any internal or temporal objects during any computations, neither modifying objects on which operations are called, it can be used safely in a multithreaded application.\n\n## Add GeomLib to your project\n\n### sbt\n\n```\nlibraryDependencies += \"io.github.scalamath\" % \"geomlib\" % \"1.0\"\n```\n\n### Maven\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.scalamath\u003c/groupId\u003e\n    \u003cartifactId\u003egeomlib\u003c/artifactId\u003e\n    \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```\nimplementation 'io.github.scalamath:geomlib:1.0'\n```\n\n## Questions and answers\n\n**Q**: Why does GeomLib not use scala 3?\n\n**A**: One of the design goals of GeomLib is to be usable both in Scala and Java. Support for Scala 3 in IDEs is still actively being developed, therefore a Scala 3 library may not be suitable to work with.\n\n## Contributing\n\nGeomLib was developed by a single person as an extension of [VecMatLib](https://github.com/ScalaMath/VecMatLib).\n\nYour contributions are always welcome!\nPlease submit a pull request or open an issue if you want to contribute with bug fixes, code improvements, documentation, and better unit test coverage.\n\n## Support\n\nSupport the project with a donation:\n\n* [PayPal](https://paypal.me/hexagonnico)\n* [Ko-fi](https://ko-fi.com/HexagonNico)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalamath%2Fgeomlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalamath%2Fgeomlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalamath%2Fgeomlib/lists"}