Closed pbor closed 4 years ago
Right now I have the following code, but calculating the inverse just to throw it away looks confusing
match t.inverse() { Some(_) => Ok(t), _ => Err(ValueErrorKind::Value("invalid transformation matrix".to_string())), }
I know I could use t.determinant() != 0.0, but that is less clear, also if we do it euclid itself we could have a generic implementation for each T: Zero
t.determinant() != 0.0
T: Zero
Sounds good to me. Would you like to submit a PR for this?
(nitpick) I would prefer is_invertible over invertible.
is_invertible
invertible
Right now I have the following code, but calculating the inverse just to throw it away looks confusing
I know I could use
t.determinant() != 0.0
, but that is less clear, also if we do it euclid itself we could have a generic implementation for eachT: Zero