{"id":18472799,"url":"https://github.com/gregros/dropin-geometry","last_synced_at":"2026-05-03T05:32:15.981Z","repository":{"id":44976161,"uuid":"162618696","full_name":"GregRos/dropin-geometry","owner":"GregRos","description":"Vector and complex math for graphics. Unfinished.","archived":false,"fork":false,"pushed_at":"2022-12-04T09:27:49.000Z","size":140,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T05:55:03.784Z","etag":null,"topics":["functional-programming","graphics","incomplete","javascript","math","obsolete","package","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/GregRos.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}},"created_at":"2018-12-20T18:48:36.000Z","updated_at":"2025-05-06T13:10:25.000Z","dependencies_parsed_at":"2023-01-23T13:15:17.551Z","dependency_job_id":null,"html_url":"https://github.com/GregRos/dropin-geometry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GregRos/dropin-geometry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregRos%2Fdropin-geometry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregRos%2Fdropin-geometry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregRos%2Fdropin-geometry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregRos%2Fdropin-geometry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GregRos","download_url":"https://codeload.github.com/GregRos/dropin-geometry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregRos%2Fdropin-geometry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["functional-programming","graphics","incomplete","javascript","math","obsolete","package","typescript"],"created_at":"2024-11-06T10:22:26.957Z","updated_at":"2026-05-03T05:32:15.939Z","avatar_url":"https://github.com/GregRos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dropin-geometry\n\nThe idea of `dropin-geometry` is to provide 2d geometry functions for drawing libraries that lack some of those functions. This is achieved by having 2d objects that are easily convertible to other object formats used by graphics libraries and that support different math operations. It's largely an experiment.\n\nIn practice though, there are lots of existing geometry libraries. It's probably better to add functionality to those other libraries.\n\n## Compatibility with other formats\n\nAllow the library to operate on objects in different common formats used by different graphics libraries. \n\nFunctions that accept an object parameter (e.g. a `Vector`, `Matrix`, `Line`, etc) should allow objects in a number of different representations. This would come at a small cost in performance.\n\nObjects of these types should have easily accessible \"export\" getters or methods for conversions to other formats.\n\n## Unify points, vectors, and complex numbers\n\nUnify the APIs for these three kinds of objects to allow for performing ℂ operations on objects normally seen as vectors, as these operations can be quite handy and are very meaningful geometrically. For example, I prefer of thinking about 2D rotations as multiplication by complex numbers on the unit circle instead of as matrices, as long as \n\n## Convenient angle conversion API\n\nThe idea is to allow code like this:\n\n``` typescript\n// turn: Turn =\u003e Rad\n// Actually converts *from* turn\nlet result1 = Math.sin(turn(0.5)); // the same as Math.sin(tau * 0.5)\n\nlet result2 = Math.sin(deg(60)); // The same as Math.sin(π / 3);\n\nlet vec = vector([0, 1]);\n\n\n// todeg: Rad =\u003e Deg\n// Actually converts *to* deg\nlet indegrees = todeg(vec.angle());\n```\n\nThe idea is that all functions will expect to receive angles in `rad`, but concisely named functions are available to convert other measurements to `rad`.\n\nThere are also concisely named functions to convert back.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregros%2Fdropin-geometry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregros%2Fdropin-geometry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregros%2Fdropin-geometry/lists"}