nalgebra/nalgebra-glm/src/ext_scalar_common.rs

19 lines
408 B
Rust
Raw Normal View History

2018-09-21 01:54:12 +08:00
use na;
2018-09-21 01:54:12 +08:00
use traits::Number;
2018-09-21 01:54:12 +08:00
pub fn max3<N: Number>(a: N, b: N, c: N) -> N {
na::sup(&na::sup(&a, &b), &c)
}
2018-09-21 01:54:12 +08:00
pub fn max4<N: Number>(a: N, b: N, c: N, d: N) -> N {
na::sup(&na::sup(&a, &b), &na::sup(&c, &d))
}
2018-09-21 01:54:12 +08:00
pub fn min3<N: Number>(a: N, b: N, c: N) -> N {
na::inf(&na::inf(&a, &b), &c)
}
2018-09-21 01:54:12 +08:00
pub fn min4<N: Number>(a: N, b: N, c: N, d: N) -> N {
na::inf(&na::inf(&a, &b), &na::inf(&c, &d))
}