matrix: add relatively_equal overload
This commit is contained in:
parent
2ef759877e
commit
3b5e94e0ea
13
matrix.hpp
13
matrix.hpp
@ -225,6 +225,19 @@ namespace util {
|
||||
template <typename T> matrix<4,4,T> rotation (T angle, vector<3,T> about);
|
||||
|
||||
|
||||
template <size_t Rows, size_t Cols, typename ValueT>
|
||||
bool
|
||||
relatively_equal (const util::matrix<Rows,Cols,ValueT> &a,
|
||||
const util::matrix<Rows,Cols,ValueT> &b,
|
||||
const float percentage)
|
||||
{
|
||||
for (size_t r = 0; r < Rows; ++r)
|
||||
if (!all (relatively_equal (a[r], b[r], percentage)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Convert an affine rotation matrix to euler angles.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user