浏览代码

LibGfx: Add method to Matrix that determines if the matrix is invertible

Luke Wilde 2 年之前
父节点
当前提交
dec09333a3
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Userland/Libraries/LibGfx/Matrix.h

+ 5 - 0
Userland/Libraries/LibGfx/Matrix.h

@@ -223,6 +223,11 @@ public:
         return result;
         return result;
     }
     }
 
 
+    constexpr bool is_invertible() const
+    {
+        return determinant() != 0.0;
+    }
+
 private:
 private:
     T m_elements[N][N];
     T m_elements[N][N];
 };
 };