https://github.com/computer-graphics-tools/simd-tools
SIMDTools provides utility functions and extensions for working with SIMD matrices and vectors in Swift.
https://github.com/computer-graphics-tools/simd-tools
computer-graphics linear-algebra swift
Last synced: about 1 year ago
JSON representation
SIMDTools provides utility functions and extensions for working with SIMD matrices and vectors in Swift.
- Host: GitHub
- URL: https://github.com/computer-graphics-tools/simd-tools
- Owner: computer-graphics-tools
- License: mit
- Created: 2024-06-08T15:36:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T17:32:43.000Z (over 1 year ago)
- Last Synced: 2025-04-19T16:10:52.356Z (about 1 year ago)
- Topics: computer-graphics, linear-algebra, swift
- Language: Swift
- Homepage: https://swiftpackageindex.com/computer-graphics-tools/simd-tools
- Size: 4.22 MB
- Stars: 16
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SIMDTools
[](https://swift.org/platforms/)
[](https://swift.org)
`SIMDTools` provides utility functions and extensions for working with SIMD matrices and vectors in Swift.
## Overview
The `simd-tools` package includes:
- `Angle` struct for representing angles.
- Extensions for `float3x3` and `float4x4` to perform various matrix transformations.
- `SIMD2`, `SIMD3` and `SIMD4` components permutations.
- Utility functions such as `clamp`, `saturate`, and `interpolate`.
Please see [the package's documentation](https://swiftpackageindex.com/computer-graphics-tools/simd-tools/documentation/simdtools)
for more detailed usage instructions.
## Adding the SIMDTools as a Dependency
To use the SIMDTools package, first add it as a dependency:
```swift
let package = Package(
// name, platforms, products, etc.
dependencies: [
// other dependencies
.package(url: "https://github.com/computer-graphics-tools/simd-tools", from: "0.0.1"),
],
targets: [
// targets
]
)
```
Swift 5.9 is required in order to use the package.
## Tutorials
- [Use SIMDTools in SwiftUI](https://swiftpackageindex.com/computer-graphics-tools/simd-tools/tutorials/usesimdtoolsinswiftui)
Learn how to use SIMD matrices to calculate affine transform for rotating SwiftUI views. Get started with SIMDTools by building the demo app RotateImage.
## Usage
- [Working With Angles](Sources/SIMDTools/SIMDTools.docc/WorkingWithAngles.md)
- [Working With 3x3 Matrices](Sources/SIMDTools/SIMDTools.docc/WorkingWith3x3Matrices.md)
- [Working With 4x4 Matrices](Sources/SIMDTools/SIMDTools.docc/WorkingWith4x4Matrices.md)
- [Helper Functions](Sources/SIMDTools/SIMDTools.docc/HelperFunctions.md)
## License
SIMDTools is licensed under [MIT license](LICENSE).