public Matrix2x2 Inverse() { var s = 1f / (X1 * Y2 - X2 * Y1); var m = new Matrix2x2(Y2, -Y1, -X2, X1); return(s * m); }
private Matrix2x2 GetBarryCentricInverseMatrix() { var AB = _b.ScreenPosition - _a.ScreenPosition; var AC = _c.ScreenPosition - _a.ScreenPosition; var A = new Matrix2x2(AB.X, AB.Y, AC.X, AC.Y); return(A.Inverse()); }
private void OnPropertyChanged() { _isBackfacingOnScreen = IsBackfacingOnScreen(); _barryCentricMatrixInverse = GetBarryCentricInverseMatrix(); }