Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ziglibs/zlm
Zig linear mathemathics
https://github.com/ziglibs/zlm
game-math linear-algebra opengl-math zig zig-package ziglang
Last synced: 1 day ago
JSON representation
Zig linear mathemathics
- Host: GitHub
- URL: https://github.com/ziglibs/zlm
- Owner: ziglibs
- License: mit
- Created: 2020-05-30T21:03:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T07:35:15.000Z (5 months ago)
- Last Synced: 2024-10-01T03:21:58.638Z (2 months ago)
- Topics: game-math, linear-algebra, opengl-math, zig, zig-package, ziglang
- Language: Zig
- Size: 89.8 KB
- Stars: 165
- Watchers: 4
- Forks: 26
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - ziglibs/zlm
- awesome-zig - zlm🗒️Zig linear mathemathics
README
# zlm
Zig linear mathemathics library.Current provides the following types:
- `Vec2`
- `Vec3`
- `Vec4`
- `Mat2`
- `Mat3`
- `Mat4`The library is currently built around the OpenGL coordinate system and is fully generic on the basic data type.
## Example
```zig
const math = @import("zlm");// Use this namespace to get access to a Vec3 with f16 fields instead of f32
const math_f16 = math.SpecializeOn(f16);/// Accelerate the given velocity `v` by `a` over `t`.
fn accelerate(v: math.Vec3, a: math.Vec3, t: f32) math.Vec3 {
return v.add(a.scale(t));
}
```