diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0261e36..82fc953a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@ documented here.
This project adheres to [Semantic Versioning](https://semver.org/).
+## [0.23.2]
+In this release, we improved the documentation of some of the geometric types
+by applying changes similar to what we did in the version 0.23.1 for matrices.
+
## [0.23.1]
In this release we improved the documentation of the matrix and vector types by:
- Grouping `impl` bocks logically, adding a title comment to these impl blocks.
diff --git a/Cargo.toml b/Cargo.toml
index da4c4fd6..ae3b3378 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "nalgebra"
-version = "0.23.1"
+version = "0.23.2"
authors = [ "Sébastien Crozet " ]
description = "Linear algebra library with transformations and statically-sized or dynamically-sized matrices."
diff --git a/README.md b/README.md
index db031e00..a885855b 100644
--- a/README.md
+++ b/README.md
@@ -29,3 +29,11 @@
-----
+
+## Gold sponsors
+Rapier is supported by:
+
+
+
+
+
\ No newline at end of file
diff --git a/src/base/alias.rs b/src/base/alias.rs
index 7e64de0d..0f62a6e5 100644
--- a/src/base/alias.rs
+++ b/src/base/alias.rs
@@ -14,138 +14,242 @@ use crate::base::Matrix;
*
*/
/// A statically sized column-major matrix with `R` rows and `C` columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[deprecated(note = "This matrix name contains a typo. Use MatrixMN instead.")]
pub type MatrixNM = Matrix>;
/// A statically sized column-major matrix with `R` rows and `C` columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixMN = Matrix>;
/// A statically sized column-major square matrix with `D` rows and columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixN = Matrix>;
/// A dynamically sized column-major matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type DMatrix = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 1 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx1 = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 2 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx2 = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 3 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx3 = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 4 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx4 = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 5 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx5 = Matrix>;
/// A heap-allocated, column-major, matrix with a dynamic number of rows and 6 columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type MatrixXx6 = Matrix>;
/// A heap-allocated, row-major, matrix with 1 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix1xX = Matrix>;
/// A heap-allocated, row-major, matrix with 2 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix2xX = Matrix>;
/// A heap-allocated, row-major, matrix with 3 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix3xX = Matrix>;
/// A heap-allocated, row-major, matrix with 4 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix4xX = Matrix>;
/// A heap-allocated, row-major, matrix with 5 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix5xX = Matrix>;
/// A heap-allocated, row-major, matrix with 6 rows and a dynamic number of columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
#[cfg(any(feature = "std", feature = "alloc"))]
pub type Matrix6xX = Matrix>;
/// A stack-allocated, column-major, 1x1 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1 = Matrix>;
/// A stack-allocated, column-major, 2x2 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2 = Matrix>;
/// A stack-allocated, column-major, 3x3 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3 = Matrix>;
/// A stack-allocated, column-major, 4x4 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4 = Matrix>;
/// A stack-allocated, column-major, 5x5 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5 = Matrix>;
/// A stack-allocated, column-major, 6x6 square matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6 = Matrix>;
/// A stack-allocated, column-major, 1x2 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1x2 = Matrix>;
/// A stack-allocated, column-major, 1x3 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1x3 = Matrix>;
/// A stack-allocated, column-major, 1x4 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1x4 = Matrix>;
/// A stack-allocated, column-major, 1x5 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1x5 = Matrix>;
/// A stack-allocated, column-major, 1x6 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix1x6 = Matrix>;
/// A stack-allocated, column-major, 2x3 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2x3 = Matrix>;
/// A stack-allocated, column-major, 2x4 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2x4 = Matrix>;
/// A stack-allocated, column-major, 2x5 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2x5 = Matrix>;
/// A stack-allocated, column-major, 2x6 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2x6 = Matrix>;
/// A stack-allocated, column-major, 3x4 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3x4 = Matrix>;
/// A stack-allocated, column-major, 3x5 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3x5 = Matrix>;
/// A stack-allocated, column-major, 3x6 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3x6 = Matrix>;
/// A stack-allocated, column-major, 4x5 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4x5 = Matrix>;
/// A stack-allocated, column-major, 4x6 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4x6 = Matrix>;
/// A stack-allocated, column-major, 5x6 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5x6 = Matrix>;
/// A stack-allocated, column-major, 2x1 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix2x1 = Matrix>;
/// A stack-allocated, column-major, 3x1 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3x1 = Matrix>;
/// A stack-allocated, column-major, 4x1 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4x1 = Matrix>;
/// A stack-allocated, column-major, 5x1 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5x1 = Matrix>;
/// A stack-allocated, column-major, 6x1 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6x1 = Matrix>;
/// A stack-allocated, column-major, 3x2 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix3x2 = Matrix>;
/// A stack-allocated, column-major, 4x2 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4x2 = Matrix>;
/// A stack-allocated, column-major, 5x2 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5x2 = Matrix>;
/// A stack-allocated, column-major, 6x2 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6x2 = Matrix>;
/// A stack-allocated, column-major, 4x3 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix4x3 = Matrix>;
/// A stack-allocated, column-major, 5x3 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5x3 = Matrix>;
/// A stack-allocated, column-major, 6x3 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6x3 = Matrix>;
/// A stack-allocated, column-major, 5x4 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix5x4 = Matrix>;
/// A stack-allocated, column-major, 6x4 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6x4 = Matrix>;
/// A stack-allocated, column-major, 6x5 matrix.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type Matrix6x5 = Matrix>;
/*
diff --git a/src/base/alias_slice.rs b/src/base/alias_slice.rs
index 9efbf857..d919fef9 100644
--- a/src/base/alias_slice.rs
+++ b/src/base/alias_slice.rs
@@ -10,129 +10,207 @@ use crate::base::Matrix;
*
*/
/// A column-major matrix slice with `R` rows and `C` columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMN<'a, N, R, C, RStride = U1, CStride = R> =
Matrix>;
/// A column-major matrix slice with `D` rows and columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceN<'a, N, D, RStride = U1, CStride = D> =
Matrix>;
/// A column-major matrix slice dynamic numbers of rows and columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type DMatrixSlice<'a, N, RStride = U1, CStride = Dynamic> =
Matrix>;
/// A column-major 1x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 2x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 3x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 4x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 5x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 6x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 1x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1x2<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1x3<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1x4<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1x5<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice1x6<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 2x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2x1<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2x3<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2x4<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2x5<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice2x6<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 3x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3x1<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3x2<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3x4<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3x5<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice3x6<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 4x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4x1<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4x2<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4x3<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4x5<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice4x6<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 5x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5x1<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5x2<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5x3<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5x4<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice5x6<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 6x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6x1<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6x2<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6x3<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6x4<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSlice6x5<'a, N, RStride = U1, CStride = U6> =
Matrix>;
@@ -183,21 +261,33 @@ pub type DVectorSlice<'a, N, RStride = U1, CStride = Dynamic> =
Matrix>;
/// A 1D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice1<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A 2D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice2<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A 3D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice3<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A 4D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice4<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A 5D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice5<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A 6D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSlice6<'a, N, RStride = U1, CStride = U6> =
Matrix>;
@@ -209,129 +299,207 @@ pub type VectorSlice6<'a, N, RStride = U1, CStride = U6> =
*
*/
/// A column-major matrix slice with `R` rows and `C` columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMutMN<'a, N, R, C, RStride = U1, CStride = R> =
Matrix>;
/// A column-major matrix slice with `D` rows and columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMutN<'a, N, D, RStride = U1, CStride = D> =
Matrix>;
/// A column-major matrix slice dynamic numbers of rows and columns.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type DMatrixSliceMut<'a, N, RStride = U1, CStride = Dynamic> =
Matrix>;
/// A column-major 1x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 2x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 3x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 4x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 5x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 6x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 1x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1x2<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1x3<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1x4<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1x5<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 1x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut1x6<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A column-major 2x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2x1<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2x3<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2x4<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2x5<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 2x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut2x6<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A column-major 3x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3x1<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3x2<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3x4<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3x5<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 3x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut3x6<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A column-major 4x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4x1<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4x2<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4x3<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4x5<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 4x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut4x6<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A column-major 5x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5x1<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5x2<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5x3<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5x4<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 5x6 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut5x6<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A column-major 6x1 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6x1<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x2 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6x2<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x3 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6x3<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x4 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6x4<'a, N, RStride = U1, CStride = U6> =
Matrix>;
/// A column-major 6x5 matrix slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type MatrixSliceMut6x5<'a, N, RStride = U1, CStride = U6> =
Matrix>;
@@ -382,20 +550,32 @@ pub type DVectorSliceMut<'a, N, RStride = U1, CStride = Dynamic> =
Matrix>;
/// A 1D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut1<'a, N, RStride = U1, CStride = U1> =
Matrix>;
/// A 2D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut2<'a, N, RStride = U1, CStride = U2> =
Matrix>;
/// A 3D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut3<'a, N, RStride = U1, CStride = U3> =
Matrix>;
/// A 4D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut4<'a, N, RStride = U1, CStride = U4> =
Matrix>;
/// A 5D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut5<'a, N, RStride = U1, CStride = U5> =
Matrix>;
/// A 6D column vector slice.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
pub type VectorSliceMut6<'a, N, RStride = U1, CStride = U6> =
Matrix>;
diff --git a/src/base/array_storage.rs b/src/base/array_storage.rs
index b86e3a80..4fdd3e73 100644
--- a/src/base/array_storage.rs
+++ b/src/base/array_storage.rs
@@ -377,7 +377,7 @@ where
where
V: SeqAccess<'a>,
{
- let mut out: Self::Value = unsafe { mem::uninitialized() };
+ let mut out: Self::Value = unsafe { mem::MaybeUninit::uninit().assume_init() };
let mut curr = 0;
while let Some(value) = visitor.next_element()? {
diff --git a/src/base/conversion.rs b/src/base/conversion.rs
index 583632a8..77bf4005 100644
--- a/src/base/conversion.rs
+++ b/src/base/conversion.rs
@@ -257,9 +257,8 @@ macro_rules! impl_from_into_mint_1D(
#[inline]
fn into(self) -> mint::$VT {
unsafe {
- let mut res: mint::$VT = mem::uninitialized();
+ let mut res: mint::$VT = mem::MaybeUninit::uninit().assume_init();
ptr::copy_nonoverlapping(self.data.ptr(), &mut res.x, $SZ);
-
res
}
}
@@ -324,7 +323,7 @@ macro_rules! impl_from_into_mint_2D(
#[inline]
fn into(self) -> mint::$MV {
unsafe {
- let mut res: mint::$MV = mem::uninitialized();
+ let mut res: mint::$MV = mem::MaybeUninit::uninit().assume_init();
let mut ptr = self.data.ptr();
$(
ptr::copy_nonoverlapping(ptr, &mut res.$component.x, $SZRows);
diff --git a/src/base/interpolation.rs b/src/base/interpolation.rs
index afd3ccc7..1d74d203 100644
--- a/src/base/interpolation.rs
+++ b/src/base/interpolation.rs
@@ -56,6 +56,7 @@ impl> Unit> {
/// Computes the spherical linear interpolation between two unit vectors.
///
diff --git a/src/base/unit.rs b/src/base/unit.rs
index 5afa006b..20ca4603 100644
--- a/src/base/unit.rs
+++ b/src/base/unit.rs
@@ -15,7 +15,14 @@ use crate::{Dim, MatrixMN, RealField, Scalar, SimdComplexField, SimdRealField};
/// A wrapper that ensures the underlying algebraic entity has a unit norm.
///
-/// Use `.as_ref()` or `.into_inner()` to obtain the underlying value by-reference or by-move.
+/// **It is likely that the only piece of documentation that you need in this page are:**
+/// - **[The construction with normalization](#construction-with-normalization)**
+/// - **[Data extraction and construction without normalization](#data-extraction-and-construction-without-normalization)**
+/// - **[Interpolation between two unit vectors](#interpolation-between-two-unit-vectors)**
+///
+/// All the other impl blocks you will see in this page are about [`UnitComplex`](crate::UnitComplex)
+/// and [`UnitQuaternion`](crate::UnitQuaternion); both built on top of `Unit`. If you are interested
+/// in their documentation, read their dedicated pages directly.
#[repr(transparent)]
#[derive(Eq, PartialEq, Clone, Hash, Debug, Copy)]
pub struct Unit {
@@ -71,6 +78,7 @@ pub trait Normed {
fn unscale_mut(&mut self, n: Self::Norm);
}
+/// # Construction with normalization
impl Unit {
/// Normalize the given vector and return it wrapped on a `Unit` structure.
#[inline]
@@ -140,6 +148,7 @@ impl Unit {
}
}
+/// # Data extraction and construction without normalization
impl Unit {
/// Wraps the given value, assuming it is already normalized.
#[inline]
diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs
index edb27b5a..7e4b703d 100755
--- a/src/geometry/isometry.rs
+++ b/src/geometry/isometry.rs
@@ -14,14 +14,45 @@ use simba::scalar::{RealField, SubsetOf};
use simba::simd::SimdRealField;
use crate::base::allocator::Allocator;
-use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1, U2, U3};
+use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1};
use crate::base::storage::Owned;
use crate::base::{DefaultAllocator, MatrixN, Scalar, Unit, VectorN};
-use crate::geometry::{
- AbstractRotation, Point, Rotation2, Rotation3, Translation, UnitComplex, UnitQuaternion,
-};
+use crate::geometry::{AbstractRotation, Point, Translation};
-/// A direct isometry, i.e., a rotation followed by a translation, aka. a rigid-body motion, aka. an element of a Special Euclidean (SE) group.
+/// A direct isometry, i.e., a rotation followed by a translation (aka. a rigid-body motion).
+///
+/// This is also known as an element of a Special Euclidean (SE) group.
+/// The `Isometry` type can either represent a 2D or 3D isometry.
+/// A 2D isometry is composed of:
+/// - A translation part of type [`Translation2`](crate::Translation2)
+/// - A rotation part which can either be a [`UnitComplex`](crate::UnitComplex) or a [`Rotation2`](crate::Rotation2).
+/// A 3D isometry is composed of:
+/// - A translation part of type [`Translation3`](crate::Translation3)
+/// - A rotation part which can either be a [`UnitQuaternion`](crate::UnitQuaternion) or a [`Rotation3`](crate::Rotation3).
+///
+/// Note that instead of using the [`Isometry`](crate::Isometry) type in your code directly, you should use one
+/// of its aliases: [`Isometry2`](crate::Isometry2), [`Isometry3`](crate::Isometry3),
+/// [`IsometryMatrix2`](crate::IsometryMatrix2), [`IsometryMatrix3`](crate::IsometryMatrix3). Though
+/// keep in mind that all the documentation of all the methods of these aliases will also appears on
+/// this page.
+///
+/// # Construction
+/// * [From a 2D vector and/or an angle `new`, `translation`, `rotation`…](#construction-from-a-2d-vector-andor-a-rotation-angle)
+/// * [From a 3D vector and/or an axis-angle `new`, `translation`, `rotation`…](#construction-from-a-3d-vector-andor-an-axis-angle)
+/// * [From a 3D eye position and target point `look_at`, `look_at_lh`, `face_towards`…](#construction-from-a-3d-eye-position-and-target-point)
+/// * [From the translation and rotation parts `from_parts`…](#from-the-translation-and-rotation-parts)
+///
+/// # Transformation and composition
+/// Note that transforming vectors and points can be done by multiplication, e.g., `isometry * point`.
+/// Composing an isometry with another transformation can also be done by multiplication or division.
+///
+/// * [Transformation of a vector or a point `transform_vector`, `inverse_transform_point`…](#transformation-of-a-vector-or-a-point)
+/// * [Inversion and in-place composition `inverse`, `append_rotation_wrt_point_mut`…](#inversion-and-in-place-composition)
+/// * [Interpolation `lerp_slerp`…](#interpolation)
+///
+/// # Conversion to a matrix
+/// * [Conversion to a matrix `to_matrix`…](#conversion-to-a-matrix)
+///
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
@@ -103,7 +134,7 @@ where
}
}
}
-
+/// # From the translation and rotation parts
impl> Isometry
where
DefaultAllocator: Allocator,
@@ -131,6 +162,7 @@ where
}
}
+/// # Inversion and in-place composition
impl> Isometry
where
N::Element: SimdRealField,
@@ -178,6 +210,28 @@ where
self.translation.vector = self.rotation.transform_vector(&self.translation.vector);
}
+ /// Computes `self.inverse() * rhs` in a more efficient way.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # use std::f32;
+ /// # use nalgebra::{Isometry2, Point2, Vector2};
+ /// let mut iso1 = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
+ /// let mut iso2 = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_4);
+ ///
+ /// assert_eq!(iso1.inverse() * iso2, iso1.inv_mul(&iso2));
+ /// ```
+ #[inline]
+ pub fn inv_mul(&self, rhs: &Isometry) -> Self {
+ let inv_rot1 = self.rotation.inverse();
+ let tr_12 = rhs.translation.vector.clone() - self.translation.vector.clone();
+ Isometry::from_parts(
+ inv_rot1.transform_vector(&tr_12).into(),
+ inv_rot1 * rhs.rotation.clone(),
+ )
+ }
+
/// Appends to `self` the given translation in-place.
///
/// # Example
@@ -261,7 +315,14 @@ where
pub fn append_rotation_wrt_center_mut(&mut self, r: &R) {
self.rotation = r.clone() * self.rotation.clone();
}
+}
+/// # Transformation of a vector or a point
+impl> Isometry
+where
+ N::Element: SimdRealField,
+ DefaultAllocator: Allocator,
+{
/// Transform the given point by this isometry.
///
/// This is the same as the multiplication `self * pt`.
@@ -377,224 +438,19 @@ where
}
}
-impl Isometry> {
- /// Interpolates between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Panics if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined). Use `.try_lerp_slerp` instead to avoid the panic.
- ///
- /// # Examples:
- ///
- /// ```
- /// # use nalgebra::{Vector3, Translation3, Isometry3, UnitQuaternion};
- ///
- /// let t1 = Translation3::new(1.0, 2.0, 3.0);
- /// let t2 = Translation3::new(4.0, 8.0, 12.0);
- /// let q1 = UnitQuaternion::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
- /// let q2 = UnitQuaternion::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
- /// let iso1 = Isometry3::from_parts(t1, q1);
- /// let iso2 = Isometry3::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
- /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));
- /// ```
- #[inline]
- pub fn lerp_slerp(&self, other: &Self, t: N) -> Self
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.slerp(&other.rotation, t);
- Self::from_parts(tr.into(), rot)
- }
-
- /// Attempts to interpolate between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Retuns `None` if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined).
- ///
- /// # Examples:
- ///
- /// ```
- /// # use nalgebra::{Vector3, Translation3, Isometry3, UnitQuaternion};
- ///
- /// let t1 = Translation3::new(1.0, 2.0, 3.0);
- /// let t2 = Translation3::new(4.0, 8.0, 12.0);
- /// let q1 = UnitQuaternion::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
- /// let q2 = UnitQuaternion::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
- /// let iso1 = Isometry3::from_parts(t1, q1);
- /// let iso2 = Isometry3::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
- /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));
- /// ```
- #[inline]
- pub fn try_lerp_slerp(&self, other: &Self, t: N, epsilon: N) -> Option
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.try_slerp(&other.rotation, t, epsilon)?;
- Some(Self::from_parts(tr.into(), rot))
- }
-}
-
-impl Isometry> {
- /// Interpolates between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Panics if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined). Use `.try_lerp_slerp` instead to avoid the panic.
- ///
- /// # Examples:
- ///
- /// ```
- /// # use nalgebra::{Vector3, Translation3, Rotation3, IsometryMatrix3};
- ///
- /// let t1 = Translation3::new(1.0, 2.0, 3.0);
- /// let t2 = Translation3::new(4.0, 8.0, 12.0);
- /// let q1 = Rotation3::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
- /// let q2 = Rotation3::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
- /// let iso1 = IsometryMatrix3::from_parts(t1, q1);
- /// let iso2 = IsometryMatrix3::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
- /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));
- /// ```
- #[inline]
- pub fn lerp_slerp(&self, other: &Self, t: N) -> Self
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.slerp(&other.rotation, t);
- Self::from_parts(tr.into(), rot)
- }
-
- /// Attempts to interpolate between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Retuns `None` if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined).
- ///
- /// # Examples:
- ///
- /// ```
- /// # use nalgebra::{Vector3, Translation3, Rotation3, IsometryMatrix3};
- ///
- /// let t1 = Translation3::new(1.0, 2.0, 3.0);
- /// let t2 = Translation3::new(4.0, 8.0, 12.0);
- /// let q1 = Rotation3::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
- /// let q2 = Rotation3::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
- /// let iso1 = IsometryMatrix3::from_parts(t1, q1);
- /// let iso2 = IsometryMatrix3::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
- /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));
- /// ```
- #[inline]
- pub fn try_lerp_slerp(&self, other: &Self, t: N, epsilon: N) -> Option
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.try_slerp(&other.rotation, t, epsilon)?;
- Some(Self::from_parts(tr.into(), rot))
- }
-}
-
-impl Isometry> {
- /// Interpolates between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Panics if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined). Use `.try_lerp_slerp` instead to avoid the panic.
- ///
- /// # Examples:
- ///
- /// ```
- /// # #[macro_use] extern crate approx;
- /// # use nalgebra::{Vector2, Translation2, UnitComplex, Isometry2};
- ///
- /// let t1 = Translation2::new(1.0, 2.0);
- /// let t2 = Translation2::new(4.0, 8.0);
- /// let q1 = UnitComplex::new(std::f32::consts::FRAC_PI_4);
- /// let q2 = UnitComplex::new(-std::f32::consts::PI);
- /// let iso1 = Isometry2::from_parts(t1, q1);
- /// let iso2 = Isometry2::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector2::new(2.0, 4.0));
- /// assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2);
- /// ```
- #[inline]
- pub fn lerp_slerp(&self, other: &Self, t: N) -> Self
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.slerp(&other.rotation, t);
- Self::from_parts(tr.into(), rot)
- }
-}
-
-impl Isometry> {
- /// Interpolates between two isometries using a linear interpolation for the translation part,
- /// and a spherical interpolation for the rotation part.
- ///
- /// Panics if the angle between both rotations is 180 degrees (in which case the interpolation
- /// is not well-defined). Use `.try_lerp_slerp` instead to avoid the panic.
- ///
- /// # Examples:
- ///
- /// ```
- /// # #[macro_use] extern crate approx;
- /// # use nalgebra::{Vector2, Translation2, Rotation2, IsometryMatrix2};
- ///
- /// let t1 = Translation2::new(1.0, 2.0);
- /// let t2 = Translation2::new(4.0, 8.0);
- /// let q1 = Rotation2::new(std::f32::consts::FRAC_PI_4);
- /// let q2 = Rotation2::new(-std::f32::consts::PI);
- /// let iso1 = IsometryMatrix2::from_parts(t1, q1);
- /// let iso2 = IsometryMatrix2::from_parts(t2, q2);
- ///
- /// let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);
- ///
- /// assert_eq!(iso3.translation.vector, Vector2::new(2.0, 4.0));
- /// assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2);
- /// ```
- #[inline]
- pub fn lerp_slerp(&self, other: &Self, t: N) -> Self
- where
- N: RealField,
- {
- let tr = self.translation.vector.lerp(&other.translation.vector, t);
- let rot = self.rotation.slerp(&other.rotation, t);
- Self::from_parts(tr.into(), rot)
- }
-}
-
// NOTE: we don't require `R: Rotation<...>` here because this is not useful for the implementation
// and makes it hard to use it, e.g., for Transform × Isometry implementation.
// This is OK since all constructors of the isometry enforce the Rotation bound already (and
// explicit struct construction is prevented by the dummy ZST field).
+/// # Conversion to a matrix
impl Isometry
where
DefaultAllocator: Allocator,
{
/// Converts this isometry into its equivalent homogeneous transformation matrix.
///
+ /// This is the same as `self.to_matrix()`.
+ ///
/// # Example
///
/// ```
@@ -621,6 +477,33 @@ where
res
}
+
+ /// Converts this isometry into its equivalent homogeneous transformation matrix.
+ ///
+ /// This is the same as `self.to_homogeneous()`.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # #[macro_use] extern crate approx;
+ /// # use std::f32;
+ /// # use nalgebra::{Isometry2, Vector2, Matrix3};
+ /// let iso = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_6);
+ /// let expected = Matrix3::new(0.8660254, -0.5, 10.0,
+ /// 0.5, 0.8660254, 20.0,
+ /// 0.0, 0.0, 1.0);
+ ///
+ /// assert_relative_eq!(iso.to_matrix(), expected, epsilon = 1.0e-6);
+ /// ```
+ #[inline]
+ pub fn to_matrix(&self) -> MatrixN>
+ where
+ D: DimNameAdd,
+ R: SubsetOf>>,
+ DefaultAllocator: Allocator, DimNameSum>,
+ {
+ self.to_homogeneous()
+ }
}
impl Eq for Isometry
diff --git a/src/geometry/isometry_alias.rs b/src/geometry/isometry_alias.rs
index 69d33cb4..8eecd3ee 100644
--- a/src/geometry/isometry_alias.rs
+++ b/src/geometry/isometry_alias.rs
@@ -2,16 +2,33 @@ use crate::base::dimension::{U2, U3};
use crate::geometry::{Isometry, Rotation2, Rotation3, UnitComplex, UnitQuaternion};
-/// A 2-dimensional direct isometry using a unit complex number for its rotational part. Also known as a rigid-body motion, or as an element of SE(2).
+/// A 2-dimensional direct isometry using a unit complex number for its rotational part.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Isometry`](crate::Isometry) type too.**
+///
+/// Also known as a 2D rigid-body motion, or as an element of SE(2).
+
pub type Isometry2 = Isometry>;
-/// A 3-dimensional direct isometry using a unit quaternion for its rotational part. Also known as a rigid-body motion, or as an element of SE(3).
+/// A 3-dimensional direct isometry using a unit quaternion for its rotational part.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Isometry`](crate::Isometry) type too.**
+///
+/// Also known as a rigid-body motion, or as an element of SE(3).
pub type Isometry3 = Isometry>;
-/// A 2-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(2).
+/// A 2-dimensional direct isometry using a rotation matrix for its rotational part.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Isometry`](crate::Isometry) type too.**
+///
+/// Also known as a rigid-body motion, or as an element of SE(2).
pub type IsometryMatrix2 = Isometry>;
-/// A 3-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(3).
+/// A 3-dimensional direct isometry using a rotation matrix for its rotational part.
+///
+/// **Because this is an alias, not all its methods are listed here. See the [`Isometry`](crate::Isometry) type too.**
+///
+/// Also known as a rigid-body motion, or as an element of SE(3).
pub type IsometryMatrix3 = Isometry>;
// This tests that the types correctly implement `Copy`, without having to run tests
diff --git a/src/geometry/isometry_construction.rs b/src/geometry/isometry_construction.rs
index a9f9c978..0f487547 100644
--- a/src/geometry/isometry_construction.rs
+++ b/src/geometry/isometry_construction.rs
@@ -11,12 +11,13 @@ use simba::scalar::RealField;
use simba::simd::SimdRealField;
use crate::base::allocator::Allocator;
-use crate::base::dimension::{DimName, U2, U3};
+use crate::base::dimension::{DimName, U2};
use crate::base::{DefaultAllocator, Vector2, Vector3};
use crate::geometry::{
- AbstractRotation, Isometry, Point, Point3, Rotation, Rotation2, Rotation3, Translation,
- Translation2, Translation3, UnitComplex, UnitQuaternion,
+ AbstractRotation, Isometry, Isometry2, Isometry3, IsometryMatrix2, IsometryMatrix3, Point,
+ Point3, Rotation, Rotation3, Translation, Translation2, Translation3, UnitComplex,
+ UnitQuaternion,
};
impl> Isometry
@@ -112,8 +113,8 @@ where
*
*/
-// 2D rotation.
-impl Isometry>
+/// # Construction from a 2D vector and/or a rotation angle
+impl IsometryMatrix2