Doc: fix some typos.

This commit is contained in:
Sébastien Crozet 2014-01-19 15:48:07 +01:00
parent cbebbe8961
commit 79008262cb
5 changed files with 17 additions and 17 deletions

View File

@ -271,7 +271,7 @@ pub fn append_rotation<V, M: Rotation<V>>(m: &M, v: &V) -> M {
/// pub main() { /// pub main() {
/// let t = Rot3::new(Vec3::new(0.0, 0.0, 0.0)); /// let t = Rot3::new(Vec3::new(0.0, 0.0, 0.0));
/// let v = Vec3::new(1.0, 1.0, 1.0); /// let v = Vec3::new(1.0, 1.0, 1.0);
/// let rt = na::preend_rotation(&t, &v); /// let rt = na::prepend_rotation(&t, &v);
/// ///
/// assert!(na::rotation(&rt) == Vec3::new(1.0, 1.0, 1.0)) /// assert!(na::rotation(&rt) == Vec3::new(1.0, 1.0, 1.0))
/// } /// }
@ -331,7 +331,7 @@ pub fn inv_rotate<V, M: Rotate<V>>(m: &M, v: &V) -> V {
* RotationWithTranslation<LV, AV> * RotationWithTranslation<LV, AV>
*/ */
/// Rotates a copy of `m` by `amount` using `center` ase the pivot point. /// Rotates a copy of `m` by `amount` using `center` as the pivot point.
#[inline(always)] #[inline(always)]
pub fn append_rotation_wrt_point<LV: Neg<LV>, pub fn append_rotation_wrt_point<LV: Neg<LV>,
AV, AV,
@ -473,7 +473,7 @@ pub fn cross_matrix<V: CrossMatrix<M>, M>(v: &V) -> M {
* ToHomogeneous<U> * ToHomogeneous<U>
*/ */
/// Converts a matrix or vector to homogoneous coordinates. /// Converts a matrix or vector to homogeneous coordinates.
#[inline(always)] #[inline(always)]
pub fn to_homogeneous<M: ToHomogeneous<Res>, Res>(m: &M) -> Res { pub fn to_homogeneous<M: ToHomogeneous<Res>, Res>(m: &M) -> Res {
ToHomogeneous::to_homogeneous(m) ToHomogeneous::to_homogeneous(m)
@ -483,7 +483,7 @@ pub fn to_homogeneous<M: ToHomogeneous<Res>, Res>(m: &M) -> Res {
* FromHomogeneous<U> * FromHomogeneous<U>
*/ */
/// Converts a matrix or vector from homogoneous coordinates. /// Converts a matrix or vector from homogeneous coordinates.
/// ///
/// w-normalization is appied. /// w-normalization is appied.
#[inline(always)] #[inline(always)]

View File

@ -1,6 +1,6 @@
use lower_triangular::LowerTriangularMat; use lower_triangular::LowerTriangularMat;
pub trait Crout<N> { pub trait Crout<N> {
/// Crout LDL* factorization for a symetric definite indefinite matrix. /// Crout LDL* factorization for a symmetric definite indefinite matrix.
fn crout(self, &mut DiagonalMat<N>) -> LowerTriangularMat<N>; fn crout(self, &mut DiagonalMat<N>) -> LowerTriangularMat<N>;
} }

View File

@ -189,8 +189,8 @@ impl<N: One + Zero + Clone> DMat<N> {
/// Builds an identity matrix. /// Builds an identity matrix.
/// ///
/// # Arguments /// # Arguments
/// * `dim` - The dimension of the matrix. A `dim`-dimensional matrix contains `dim * dim` /// * `dim` - The dimension of the matrix. A `dim`-dimensional matrix contains `dim * dim`
/// components. /// components.
#[inline] #[inline]
pub fn new_identity(dim: uint) -> DMat<N> { pub fn new_identity(dim: uint) -> DMat<N> {
let mut res = DMat::new_zeros(dim, dim); let mut res = DMat::new_zeros(dim, dim);
@ -232,8 +232,8 @@ impl<N: Clone> DMat<N> {
/// Reads the value of a component of the matrix. /// Reads the value of a component of the matrix.
/// ///
/// # Arguments /// # Arguments
/// * `row` - 0-based index of the line to be read /// * `row` - 0-based index of the line to be read
/// * `col` - 0-based index of the column to be read /// * `col` - 0-based index of the column to be read
#[inline] #[inline]
pub fn at(&self, row: uint, col: uint) -> N { pub fn at(&self, row: uint, col: uint) -> N {
assert!(row < self.nrows); assert!(row < self.nrows);

View File

@ -36,7 +36,7 @@ impl<N: Zero + Clone> DVec<N> {
/// Builds a vector filled with zeros. /// Builds a vector filled with zeros.
/// ///
/// # Arguments /// # Arguments
/// * `dim` - The dimension of the vector. /// * `dim` - The dimension of the vector.
#[inline] #[inline]
pub fn new_zeros(dim: uint) -> DVec<N> { pub fn new_zeros(dim: uint) -> DVec<N> {
DVec::from_elem(dim, Zero::zero()) DVec::from_elem(dim, Zero::zero())
@ -60,7 +60,7 @@ impl<N: One + Clone> DVec<N> {
/// Builds a vector filled with ones. /// Builds a vector filled with ones.
/// ///
/// # Arguments /// # Arguments
/// * `dim` - The dimension of the vector. /// * `dim` - The dimension of the vector.
#[inline] #[inline]
pub fn new_ones(dim: uint) -> DVec<N> { pub fn new_ones(dim: uint) -> DVec<N> {
DVec::from_elem(dim, One::one()) DVec::from_elem(dim, One::one())
@ -92,7 +92,7 @@ impl<N> DVec<N> {
*self.at.unsafe_mut_ref(i) = val *self.at.unsafe_mut_ref(i) = val
} }
/// Gets a reference to of this vector datas. /// Gets a reference to of this vector data.
#[inline] #[inline]
pub fn as_vec<'r>(&'r self) -> &'r [N] { pub fn as_vec<'r>(&'r self) -> &'r [N] {
let data: &'r [N] = self.at; let data: &'r [N] = self.at;
@ -100,7 +100,7 @@ impl<N> DVec<N> {
data data
} }
/// Gets a mutable reference to of this vector datas. /// Gets a mutable reference to of this vector data.
#[inline] #[inline]
pub fn as_mut_vec<'r>(&'r mut self) -> &'r mut [N] { pub fn as_mut_vec<'r>(&'r mut self) -> &'r mut [N] {
let data: &'r mut [N] = self.at; let data: &'r mut [N] = self.at;
@ -108,7 +108,7 @@ impl<N> DVec<N> {
data data
} }
/// Extracts this vector datas. /// Extracts this vector data.
#[inline] #[inline]
pub fn to_vec(self) -> ~[N] { pub fn to_vec(self) -> ~[N] {
self.at self.at
@ -179,7 +179,7 @@ impl<N> FromIterator<N> for DVec<N> {
impl<N: Clone + Num + Real + ApproxEq<N> + DVecMulRhs<N, DVec<N>>> DVec<N> { impl<N: Clone + Num + Real + ApproxEq<N> + DVecMulRhs<N, DVec<N>>> DVec<N> {
/// Computes the canonical basis for the given dimension. A canonical basis is a set of /// Computes the canonical basis for the given dimension. A canonical basis is a set of
/// vectors, mutually orthogonal, with all its component equal to 0.0 exept one which is equal /// vectors, mutually orthogonal, with all its component equal to 0.0 except one which is equal
/// to 1.0. /// to 1.0.
pub fn canonical_basis_with_dim(dim: uint) -> ~[DVec<N>] { pub fn canonical_basis_with_dim(dim: uint) -> ~[DVec<N>] {
let mut res : ~[DVec<N>] = ~[]; let mut res : ~[DVec<N>] = ~[];

View File

@ -153,7 +153,7 @@ pub trait RotationMatrix<LV, AV, M: Mat<LV, LV> + Rotation<AV>> : Rotation<AV> {
pub trait AbsoluteRotate<V> { pub trait AbsoluteRotate<V> {
/// This is the same as: /// This is the same as:
/// ///
/// ~~~{.rust} /// ~~~
/// self.rotation_matrix().absolute().rmul(v) /// self.rotation_matrix().absolute().rmul(v)
/// ~~~ /// ~~~
fn absolute_rotate(&self, v: &V) -> V; fn absolute_rotate(&self, v: &V) -> V;
@ -208,7 +208,7 @@ pub trait Dot<N> {
* computing intermediate vectors. * computing intermediate vectors.
* The following equation must be verified: * The following equation must be verified:
* *
* ~~~{.rust} * ~~~
* a.sub_dot(b, c) == (a - b).dot(c) * a.sub_dot(b, c) == (a - b).dot(c)
* ~~~ * ~~~
* *