forked from M-Labs/nalgebra
Fix the example on the README.
This commit is contained in:
parent
f026585b63
commit
3e41e18c32
22
README.md
22
README.md
@ -1,4 +1,7 @@
|
|||||||
# nalgebra [![Build Status](https://travis-ci.org/sebcrozet/nalgebra.png?branch=master)](https://travis-ci.org/sebcrozet/nalgebra)
|
# nalgebra
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/sebcrozet/nalgebra.png?branch=master)](https://travis-ci.org/sebcrozet/nalgebra)
|
||||||
|
|
||||||
**nalgebra** is a linear algebra library written for Rust targeting:
|
**nalgebra** is a linear algebra library written for Rust targeting:
|
||||||
|
|
||||||
* general-purpose linear algebra (still misses a lot of features…).
|
* general-purpose linear algebra (still misses a lot of features…).
|
||||||
@ -12,24 +15,13 @@ All the functionalities of **nalgebra** are grouped in one place: the `na` modul
|
|||||||
This module re-exports everything and includes free functions for all traits methods doing
|
This module re-exports everything and includes free functions for all traits methods doing
|
||||||
out-of-place modifications.
|
out-of-place modifications.
|
||||||
|
|
||||||
* You can import the whole prelude, including free functions, using:
|
* You can import the whole prelude using:
|
||||||
|
|
||||||
```.rust
|
```.rust
|
||||||
use nalgebra::na::*;
|
use nalgebra::na::*;
|
||||||
```
|
```
|
||||||
|
|
||||||
* If you dont want to import everything but only every trait:
|
The preferred way to use **nalgebra** is to import types and traits explicitly, and call
|
||||||
|
|
||||||
```.rust
|
|
||||||
use nalgebra::traits::*;
|
|
||||||
```
|
|
||||||
|
|
||||||
* If you dont want to import everything but only every structure:
|
|
||||||
|
|
||||||
```.rust
|
|
||||||
use nalgebra::structs::*;
|
|
||||||
```
|
|
||||||
The preffered way to use **nalgebra** is to import types and traits explicitly, and call
|
|
||||||
free-functions using the `na::` prefix:
|
free-functions using the `na::` prefix:
|
||||||
|
|
||||||
```.rust
|
```.rust
|
||||||
@ -43,7 +35,7 @@ fn main() {
|
|||||||
|
|
||||||
b.append_rotation(&a);
|
b.append_rotation(&a);
|
||||||
|
|
||||||
assert!(na::rotation(&b).approx_eq(&a));
|
assert!(na::approx_eq(&na::rotation(&b), &a));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
17
src/lib.rs
17
src/lib.rs
@ -16,24 +16,13 @@ All the functionalities of **nalgebra** are grouped in one place: the `na` modul
|
|||||||
This module re-exports everything and includes free functions for all traits methods doing
|
This module re-exports everything and includes free functions for all traits methods doing
|
||||||
out-of-place modifications.
|
out-of-place modifications.
|
||||||
|
|
||||||
* You can import the whole prelude, including free functions, using:
|
* You can import the whole prelude using:
|
||||||
|
|
||||||
```.rust
|
```.rust
|
||||||
use nalgebra::na::*;
|
use nalgebra::na::*;
|
||||||
```
|
```
|
||||||
|
|
||||||
* If you dont want to import everything but only every trait:
|
The preferred way to use **nalgebra** is to import types and traits explicitly, and call
|
||||||
|
|
||||||
```.rust
|
|
||||||
use nalgebra::traits::*;
|
|
||||||
```
|
|
||||||
|
|
||||||
* If you dont want to import everything but only every structure:
|
|
||||||
|
|
||||||
```.rust
|
|
||||||
use nalgebra::structs::*;
|
|
||||||
```
|
|
||||||
The preffered way to use **nalgebra** is to import types and traits explicitly, and call
|
|
||||||
free-functions using the `na::` prefix:
|
free-functions using the `na::` prefix:
|
||||||
|
|
||||||
```.rust
|
```.rust
|
||||||
@ -47,7 +36,7 @@ fn main() {
|
|||||||
|
|
||||||
b.append_rotation(&a);
|
b.append_rotation(&a);
|
||||||
|
|
||||||
assert!(na::rotation(&b).approx_eq(&a));
|
assert!(na::approx_eq(&na::rotation(&b), &a));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user