2013-05-21 23:25:01 +08:00
|
|
|
/**
|
|
|
|
* Trait of elements having a cross product.
|
|
|
|
*/
|
2013-08-26 05:01:44 +08:00
|
|
|
pub trait Cross<V> {
|
2013-08-05 15:44:56 +08:00
|
|
|
/// Computes the cross product between two elements (usually vectors).
|
2013-08-26 05:01:44 +08:00
|
|
|
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;
|
2013-05-15 05:08:29 +08:00
|
|
|
}
|