nalgebra/src/traits/cross.rs
Sébastien Crozet 7052aa88ee Add two traits: CrossMatrix and Row.
CrossMatrix is a trait for vectors having a cross product representable as a matrix.
Row is a trait for Matrixces and Vectors, to access (by index) their rows.
2013-08-25 23:01:44 +02:00

17 lines
491 B
Rust

/**
* Trait of elements having a cross product.
*/
pub trait Cross<V> {
/// Computes the cross product between two elements (usually vectors).
fn cross(&self, other: &Self) -> V;
}
/**
* Trait of elements having a cross product operation which can be expressed as a matrix.
*/
pub trait CrossMatrix<M> {
/// The matrix associated to any cross product with this vector. I.e. `v.cross(anything)` =
/// `v.cross_matrix().rmul(anything)`.
fn cross_matrix(&self) -> M;
}