Linear algebra library for Rust.
Go to file
Sébastien Crozet 2356723e90 Add some impls for 4d rotations.
It is not possible to create a 4d rotation yet.
2013-10-03 23:58:36 +02:00
src Add some impls for 4d rotations. 2013-10-03 23:58:36 +02:00
.gitignore Add the doc folder to the .gitignore. 2013-09-22 11:09:32 +02:00
LICENSE Initial commit. 2013-05-14 11:34:28 +00:00
Makefile Update the doc rule. 2013-10-02 18:20:53 +02:00
README.md Add the frog to the project list. 2013-10-02 12:53:38 +02:00

nalgebra

nalgebra is a n-dimensional linear algebra library written with the rust programming language.

Features

nalgebra is meant to be a general-purpose linear algebra library (but is very far from that…), and keeps an optimized set of tools for computational graphics and physics. Those features include:

  • Vectors with static sizes: Vec0, Vec1, Vec2, ..., Vec6.
  • Square matrices with static sizes: Mat1, Mat2, ..., Mat6 .
  • Dynamically sized vector: DVec.
  • Dynamically sized (square or rectangular) matrix: DMat.
  • Geometry-specific matrix wrapper to ensure at compile-time some properties: Rotmat, Transform.
  • Most well-known geometric functions.
  • A few methods for data analysis: Cov (covariance), Mean (mean).
  • Operator overloading using the double trait dispatch trick. This allows using operators for both matrix/matrix multiplication and matrix/vector multiplication for example.
  • Almost one trait per functionality. This is very useful for generic programming.

Since there is almost one trait per functionality, one might end up importing a lot of traits. To lighten your use prelude, all trait are re-exported by the nalgebra::vec and nalgebra::mat modules. Thus, to bring every functionalities of nalgebra in scope, you can do:

use nalgebra::vec::*;
use nalgebra::mat::*;

Compilation

You will need the last rust compiler from the master branch. If you encounter problems, make sure you have the last version before creating an issue.

git clone git://github.com/sebcrozet/nalgebra.git
cd nalgebra
make

There is also a light, but existing, documentation for most functionalities. Use make doc to generate it on the doc folder.

nalgebra in use

Feel free to add your project to this list if you happen to use nalgebra!

  • nphysics: a real-time physics engine.
  • ncollide: a collision detection library.
  • kiss3d: a minimalistic graphics engine.
  • frog: a machine learning library.

Design note

nalgebra is mostly written with non-idiomatic rust code. This is mostly because of limitations of the trait system not allowing (easy) multiple overloading. Those overloading problems ares worked around by this hack (section What if I want overloading).