{"id":18498225,"url":"https://github.com/andykswong/munum","last_synced_at":"2025-04-09T00:31:07.280Z","repository":{"id":57305461,"uuid":"388248210","full_name":"andykswong/munum","owner":"andykswong","description":"Micro 3D Math Library for Rust, JavaScript and WebAssembly","archived":false,"fork":false,"pushed_at":"2024-06-19T23:05:19.000Z","size":1770,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T19:37:29.287Z","etag":null,"topics":["javascript","math","matrix","numeric","rust","typescript","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://andykswong.github.io/munum/","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/andykswong.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":"2021-07-21T21:18:35.000Z","updated_at":"2025-01-06T09:07:29.000Z","dependencies_parsed_at":"2024-03-14T06:23:59.963Z","dependency_job_id":"871f7b8c-4060-4b14-8b78-cb1a68f3dcde","html_url":"https://github.com/andykswong/munum","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"719122d988a47399c9cd145939393b418d3807a1"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andykswong%2Fmunum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andykswong%2Fmunum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andykswong%2Fmunum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andykswong%2Fmunum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andykswong","download_url":"https://codeload.github.com/andykswong/munum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949802,"owners_count":21023391,"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":["javascript","math","matrix","numeric","rust","typescript","wasm","webassembly"],"created_at":"2024-11-06T13:38:12.173Z","updated_at":"2025-04-09T00:31:02.269Z","avatar_url":"https://github.com/andykswong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🅼🆄🅽🆄🅼\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003eμNum - Micro 3D Math Library\u003c/h2\u003e\n\u003cbr /\u003e\n\n[![license: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n[![Docs.rs](https://docs.rs/munum/badge.svg)](https://docs.rs/munum)\n[![Crates.io](https://img.shields.io/crates/v/munum.svg)](https://crates.io/crates/munum)\n[![npm](https://img.shields.io/npm/v/munum.svg)](https://www.npmjs.com/package/munum)\n[![codecov](https://codecov.io/gh/andykswong/munum/branch/main/graph/badge.svg?token=68JPTUD7GZ)](https://codecov.io/gh/andykswong/munum)\n[![build](https://github.com/andykswong/munum/actions/workflows/build.yaml/badge.svg)](https://github.com/andykswong/munum/actions/workflows/build.yaml)\n\n## Overview\n`munum` is a minimalistic numerical library for high-performance 3D math with Rust, WebAssembly and JavaScript bindings.\n\n## Documentation\n- Docs.rs: https://docs.rs/munum\n- TSDoc: http://andykswong.github.io/munum\n\n## Install\n[JavaScript] Install via npm: \n```shell\nnpm install --save munum\n```\n\n---\n\n\n[Rust] Install as Cargo dependency:\n```shell\ncargo add munum\n```\nFeatures:\n- `std` - enables `std` support. enabled by default.\n- `libm` - enables trigonometry related functions in `no_std` environment using `libm`.\n- `jsmath` - enables trigonometry related functions in `no_std` WebAssembly environment using JS Math binding.\n- `serde` - enables `serde` serialize/deserialize implementations\n- `wasm` - produces WebAssembly module and WebAssembly component (WIP)\n\n## Usage (JavaScript WebAssembly binding)\nSample usage to build a perspective camera view-projection matrix below: \n\n[(Try it yourself here)](https://codepen.io/andykswong/pen/yLbPzGy?editors=0011)\n```javascript\nimport { lookAt, perspective, Mat4, Vec3 } from 'munum'; // Or load from CDN, e.g. 'https://unpkg.com/munum@latest'\n\nusing eye = new Vec3(1, 1, 1);\nusing target = new Vec3(0, 0, 0);\nusing up = new Vec3(0, 1, 0);\nconst view = lookAt(eye, target, up);\n\nconst aspectRatio = width / height;\nconst yfov = Math.PI / 4;\nconst znear = 1;\nconst zfar = 100;\n\nusing viewProj = perspective(aspectRatio, yfov, znear, zfar).mul(view);\n```\n\nNote the use of `using` (which automatically calls `.free()` when out of scope). When using JavaScript binding, `munum` resources are allocated on WebAssembly memory which need to be deallocated later. `munum` uses `FinalizationRegistry` for automatic memory management, so explicit memory management with `using` or `.free()` is not required through recommended.\n\n## Usage (Pure JavaScript)\nImport from `munum/js` for pure JavaScript implementation.\n\n## Usage (Rust)\nSample usage to build a perspective camera view-projection matrix:\n\n```rust\nuse core::f32::{consts::PI, INFINITY};\nuse munum::{transform, vec3};\n\nlet eye = vec3(0_f32, 2., 0.);\nlet target = vec3(0., 0.6, 0.);\nlet up = vec3(0., 0., -1.);\nlet view = transform::look_at(eye, target, up);\n\nlet proj = transform::perspective(2., PI/2., 1., INFINITY);\n\nlet view_proj = proj * view;\n```\n\n## License\nThis repository and the code inside it is licensed under the MIT License. Read [LICENSE](./LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandykswong%2Fmunum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandykswong%2Fmunum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandykswong%2Fmunum/lists"}