1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use super::*;
#[inline]
pub fn determinant<M: CanDeterminant>(m: M) -> f32 {
m.determinant()
}
pub trait CanDeterminant {
fn determinant(self) -> f32;
}
impl CanDeterminant for Mat2 {
#[inline]
fn determinant(self) -> f32 {
Mat2::determinant(self)
}
}
impl CanDeterminant for Mat3 {
#[inline]
fn determinant(self) -> f32 {
Mat3::determinant(self)
}
}
impl CanDeterminant for Mat4 {
#[inline]
fn determinant(self) -> f32 {
Mat4::determinant(self)
}
}