Procházet zdrojové kódy

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

Luke Wilde před 2 roky
rodič
revize
dec09333a3
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      Userland/Libraries/LibGfx/Matrix.h

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

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