2018-09-21 01:54:12 +08:00
|
|
|
use na::U3;
|
|
|
|
|
|
|
|
use traits::Number;
|
|
|
|
use aliases::Vec;
|
|
|
|
|
2018-09-22 19:18:59 +08:00
|
|
|
/// Returns `true` if `{a, b, c}` forms a left-handed trihedron.
|
2018-09-21 01:54:12 +08:00
|
|
|
pub fn left_handed<N: Number>(a: &Vec<N, U3>, b: &Vec<N, U3>, c: &Vec<N, U3>) -> bool {
|
|
|
|
a.cross(b).dot(c) < N::zero()
|
|
|
|
}
|
|
|
|
|
2018-09-22 19:18:59 +08:00
|
|
|
/// Returns `true` if `{a, b, c}` forms a right-handed trihedron.
|
2018-09-21 01:54:12 +08:00
|
|
|
pub fn right_handed<N: Number>(a: &Vec<N, U3>, b: &Vec<N, U3>, c: &Vec<N, U3>) -> bool {
|
|
|
|
a.cross(b).dot(c) > N::zero()
|
|
|
|
}
|