{"id":19248566,"url":"https://github.com/NVIDIA-RTX/MathLib","last_synced_at":"2025-04-21T11:34:27.324Z","repository":{"id":65795062,"uuid":"410965673","full_name":"NVIDIAGameWorks/MathLib","owner":"NVIDIAGameWorks","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-25T07:58:09.000Z","size":843,"stargazers_count":45,"open_issues_count":0,"forks_count":8,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-03-25T08:59:49.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/NVIDIAGameWorks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2021-09-27T16:44:08.000Z","updated_at":"2024-04-15T09:51:20.813Z","dependencies_parsed_at":"2023-12-18T07:30:36.544Z","dependency_job_id":"99f47142-55ee-43e9-9d3f-43312523f8ae","html_url":"https://github.com/NVIDIAGameWorks/MathLib","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/NVIDIAGameWorks%2FMathLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIAGameWorks%2FMathLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIAGameWorks%2FMathLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIAGameWorks%2FMathLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIAGameWorks","download_url":"https://codeload.github.com/NVIDIAGameWorks/MathLib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223863921,"owners_count":17216234,"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":[],"created_at":"2024-11-09T18:08:54.565Z","updated_at":"2025-04-21T11:34:21.979Z","avatar_url":"https://github.com/NVIDIAGameWorks.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MathLib (ML)\n\n*ML* is a cross-platform header-only *SSE/AVX/NEON*-accelerated math library, designed for computer graphics. It serves two goals:\n- accelerate performance using *SSE/AVX/NEON* intrinsics\n- be HLSL compatible and deliver functionality to both CPU and shader code without code duplication\n\nFeatures:\n- compile-time optimization level specialization: SSE3 (and below), +SSE4, +AVX1, +AVX2 (or NEON on ARM via [*sse2neon*](https://github.com/DLTcollab/sse2neon))\n- `int2`, `int3` and `int4` types\n- `uint2`, `uint3` and `uint4` types\n- `float2`, `float3`, `float4` and `float4x4` types\n- `double2`, `double3`, `double4` and `double4x4` types\n- `bool2`, `bool3` and `bool4` types\n- overloaded operators\n- vector swizzling\n- common functions: `all`, `any`, `sign`, `abs`, `floor`, `round`, `ceil`, `fmod`, `frac`, `min`, `max`, `clamp`, `saturate`, `lerp`, `step`, `smoothstep` and `linearstep`\n- transcendental functions: `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `sqrt`, `rsqrt`, `rcp`, `pow`, `log`, `log2`, `exp` and `exp2`\n- data conversion and packing functionality - FP32, FP16, SNORM and UNORM (with any number of bits per component)\n- vectors and matrices\n- linear algebra miscellaneous functionality\n- projective math miscellaneous functionality\n- frustum \u0026 AABB primitives\n- random numbers generation\n- sorting\n\nImportant:\n- `sizeof(int3/uint3/float3) == sizeof(float4)` on CPU\n- `sizeof(double3) == sizeof(double4)` on CPU\n- `using namespace std` can lead to name collisions\n- inclusion of `cmath` and/or `cstdlib` (even implicitly) after `ml.h` leads to name collisions\n\nAlso includes `ml.hlsli` file which is a standalone HLSL math library usable in C++ code.\n\n## License\n\n*ML* is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNVIDIA-RTX%2FMathLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNVIDIA-RTX%2FMathLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNVIDIA-RTX%2FMathLib/lists"}