lina
: linear algebra library for 3D applicationslina
is yet another linear algebra library with a focus on 3D applications
like games, i.e. low-dimensional vectors and matrices. Currently nightly only (see below).
One special feature is the heavy use of const generics to make vectors, points
and matrices generic over their dimensions, while still allowing scalar access
via .x
, .y
, .z
and .w
. This has several advantages like a reduced API
surface and easier to understand docs.
Features:
Degrees
and Radians
SphericalPos
and NormedSphericalPos
atan2
, clamp
, lerp
, slerp
, ...Still missing (but planned):
Point
, Vector
and Matrix
types. If Rust
ever offers more alignment control, I will revisit SIMD.See the documentation for more information.
What about
cgmath
,
nalgebra
,
glam
,
ultraviolet
vek
, ...?
Those are all fine libraries, but I was not 100% happy with either of them.
So I wrote my own!
lina
is not better than these other libraries, just has a different API that better fits my taste.
Currently only one feature is used:
generic_const_exprs
: this allows methods like Vector<T, N>::extend(T) -> Vector<T, N + 1>
.
I could hide all of those methods behind a feature gate, but I don't need that.
If people are interested in that, I'm happy to accept a PR.lina
is still young, but I already use it in a project of mine.
For the foreseeable future, I will shape lina
exactly to my liking for use in said project.
But of course, I'm happy about feedback, suggestions and people finding use in lina
.
Pull requests are generally welcome, but please talk to me first as I might just decline PRs that don't fit my vision for lina
.
Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.