{"id":17668376,"url":"https://github.com/fireblade-engine/math","last_synced_at":"2026-02-10T20:10:32.938Z","repository":{"id":38523108,"uuid":"292213397","full_name":"fireblade-engine/math","owner":"fireblade-engine","description":"A dependency free, lightweight, fast math library for 2D and 3D vectors, quaternions and matrices in Swift with (optional) SIMD support.","archived":false,"fork":false,"pushed_at":"2026-02-10T16:33:15.000Z","size":560,"stargazers_count":44,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-10T17:02:07.832Z","etag":null,"topics":["2d","3d","3d-vectors","cross-platform","game-development","gamedev","math","matrices","matrix","numerics","quaternion","quaternions","simd","simd-support","spm","swift","swift-package-manager","vector","vector-graphics","vectors"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/fireblade-engine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","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},"funding":{"github":["ctreffs"],"custom":["https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ"]}},"created_at":"2020-09-02T07:39:26.000Z","updated_at":"2026-02-10T16:32:47.000Z","dependencies_parsed_at":"2024-01-23T20:39:49.322Z","dependency_job_id":"f9b6664f-f692-4c06-9b71-c77d62d50f7c","html_url":"https://github.com/fireblade-engine/math","commit_stats":{"total_commits":241,"total_committers":4,"mean_commits":60.25,"dds":0.02904564315352698,"last_synced_commit":"be88b5b59caedef8a52286fca729cc9836b29012"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/fireblade-engine/math","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblade-engine%2Fmath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblade-engine%2Fmath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblade-engine%2Fmath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblade-engine%2Fmath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fireblade-engine","download_url":"https://codeload.github.com/fireblade-engine/math/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblade-engine%2Fmath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29314704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T17:48:59.043Z","status":"ssl_error","status_checked_at":"2026-02-10T17:45:37.240Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["2d","3d","3d-vectors","cross-platform","game-development","gamedev","math","matrices","matrix","numerics","quaternion","quaternions","simd","simd-support","spm","swift","swift-package-manager","vector","vector-graphics","vectors"],"created_at":"2024-10-23T23:08:00.482Z","updated_at":"2026-02-10T20:10:32.931Z","avatar_url":"https://github.com/fireblade-engine.png","language":"Swift","funding_links":["https://github.com/sponsors/ctreffs","https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ"],"categories":[],"sub_categories":[],"readme":"# FirebladeMath\n\n[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n[![macOS](https://github.com/fireblade-engine/math/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/fireblade-engine/math/actions/workflows/ci-macos.yml)\n[![Linux](https://github.com/fireblade-engine/math/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/fireblade-engine/math/actions/workflows/ci-linux.yml)\n[![Windows](https://github.com/fireblade-engine/math/actions/workflows/ci-windows.yml/badge.svg)](https://github.com/fireblade-engine/math/actions/workflows/ci-windows.yml)\n[![swift-version-compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffireblade-engine%2Fmath%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fireblade-engine/math) \n[![platform-compatilibilty](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffireblade-engine%2Fmath%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/fireblade-engine/math) \n\nA dependency-free, lightweight, fast math library for 2D and 3D vectors, quaternions, and matrices in Swift with (optional) SIMD support. It is developed and maintained as part of the [Fireblade Game Engine project](https://github.com/fireblade-engine).\n\n## ✨ Features\n\n- **Vectors:** `Vec2`, `Vec3`, `Vec4` for `Float`, `Double`, `Int`, and `UInt`.\n- **Matrices:** `Mat2x2`, `Mat3x3`, `Mat4x4` for `Float` and `Double`.\n- **Quaternions:** `Quat4f` and `Quat4d`.\n- **Geometric Types:** `Point`, `Size`, `Rect`.\n- **Math Functions:** A comprehensive set of functions including `sin`, `cos`, `tan`, `asin`, `acos`, `atan2`, `dot`, `cross`, `normalize`, `reflect`, `refract`, and many more.\n- **SIMD Support:** Leveraging hardware acceleration where available, with a fallback implementation when SIMD is not supported.\n- **Swift 6 Ready:** Fully compatible with Swift 6 and `Sendable` conformance.\n\n## 🚀 Getting Started\n\n### 📋 Prerequisites\n\n* Swift 6.1 or higher\n* Swift Package Manager (SPM)\n\n### 💻 Installation\n\nAdd Fireblade Math as a dependency to your `Package.swift` file:\n\n```swift\n// swift-tools-version: 6.1\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourPackageName\",\n    dependencies: [\n        .package(url: \"https://github.com/fireblade-engine/math.git\", from: \"1.0.0\")\n    ],\n    targets: [\n        .target(\n            name: \"YourTargetName\",\n            dependencies: [\"FirebladeMath\"])\n    ]\n)\n```\n\n### 🛠 SIMD Traits\n\nStarting with version 1.0.0, FirebladeMath uses Swift traits to manage SIMD support. By default, SIMD is enabled on Apple platforms. You can manually control it in your package configuration if needed.\n\n## 📖 Usage Examples\n\n### Vectors\n\n```swift\nimport FirebladeMath\n\nlet v1 = Vec3f(1, 2, 3)\nlet v2 = Vec3f(4, 5, 6)\n\nlet dotProduct = dot(v1, v2)\nlet crossProduct = cross(v1, v2)\nlet unitVector = normalize(v1)\n```\n\n### Matrices\n\n```swift\nimport FirebladeMath\n\n// Create a transformation matrix\nvar modelMatrix = Mat4x4f.identity\nmodelMatrix.translate(by: [10, 20, 30])\nmodelMatrix.rotate(by: .pi / 2, axis: [0, 1, 0])\n\n// Project a point\nlet projection = Mat4x4f.perspectiveRH(fovy: .pi / 4, aspect: 16/9, zNear: 0.1, zFar: 100)\n```\n\n### Quaternions\n\n```swift\nimport FirebladeMath\n\nlet q = Quat4f(angle: .pi / 4, axis: [0, 1, 0])\nlet rotatedVector = q * Vec3f(1, 0, 0)\n```\n\n## 💁 How to contribute\n\nIf you want to contribute please see the [CONTRIBUTION GUIDE](CONTRIBUTING.md) first. \n\n1. `git clone git@github.com:fireblade-engine/math.git`\n2. `cd math`\n3. `make setupEnvironment`\n\nBefore committing code please ensure to run:\n\n- `make precommit`\n\nThis project is currently maintained by [@ctreffs](https://github.com/ctreffs).   \nSee also the list of [contributors](https://github.com/fireblade-engine/math/contributors) who participated in this project.\n\n## 🔏 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## ♻ Alternatives\n\n- [alejandro-isaza/Upsurge](https://github.com/alejandro-isaza/Upsurge)\n- [capnslipp/SCNMathExtensions](https://github.com/capnslipp/SCNMathExtensions)\n- [davidskrundz/math](https://github.com/davidskrundz/math)\n- [dn-m/Math](https://github.com/dn-m/Math)\n- [Jounce/Surge](https://github.com/Jounce/Surge)\n- [jph00/basemath](https://github.com/jph00/basemath)\n- [mattt/euler](https://github.com/mattt/euler)\n- [nicklockwood/VectorMath](https://github.com/nicklockwood/VectorMath)\n- [SwiftGFX/SwiftMath](https://github.com/SwiftGFX/SwiftMath)\n- [SwiftGL/Math](https://github.com/SwiftGL/Math)\n- [taketo1024/swiftymath](https://github.com/taketo1024/swiftymath)\n- [timsearle/euclid](https://github.com/timsearle/euclid)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireblade-engine%2Fmath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffireblade-engine%2Fmath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireblade-engine%2Fmath/lists"}