ify">}
{= new Point (210, 210);
} (сheck == false)
{matrixI=new matrix (matrixOperations.Inverse (mtx) .GetLength (0), matrixOperations.Inverse (mtx) .GetLength (1)) ;. mtx=matrixOperations.Inverse (mtx) ;. Add (matrixI);
}. LoadIdentity () ;. Ortho (0, resolution.X, resolution.Y, 0, - 1, 1) ;. Viewport (0, 0, glControl1.Width, glControl1.Height) ; [0] .Draw ( A=, 30, 13, texFont, resolution); [1] .Draw ( A ^ (- 1)=, 45, matrixList [0] .size. Y + 27, texFont, resolution) ;; Mode.Transpose: (сheck == false)
{matrixT=new matrix (matrixOperations.Transpose (mtx) .GetLength (0), matrixOperations.Transpose (mtx) .GetLength (1)) ;. mtx=matrixOperations.Transpose (mtx) ;. Add (matrixT);
} n=matrixList [0] .columnCount; m1=matrixList [1] .rowCount; n1=matrixList [1] .columnCount; (m gt; 2 || n gt; 2)
{(n gt; n1)
{. X=n * 55;
}
{. X=n1 * 55;
}
}. Y=m * 25 + m1 * 25 + 60; .LoadIdentity () ;. Ortho (0, resolution.X, resolution.Y, 0, - 1, 1) ;. Viewport (0, 0, glControl1.Width, glControl1.Height); [0] .Draw ( A=, 30, 13, texFont, resolution); [1] .Draw ( AT=, 40 , matrixList [0] .size.Y + 27, texFont, resolution) ;; Mode.Determinant: (сheck == false)
{= matrixOperations.Determinent (mtx);
} (m gt; 3)
{. X=m * 60; .Y=m * 30 + 40;
}
{= new Point (200, 200);
}. LoadIdentity () ;. Ortho (0, resolution.X, resolution.Y, 0, - 1, 1) ;. Viewport (0, 0, glControl1.Width, glControl1.Height) ; [0] .Draw ( A=, 30, 13, texFont, resolution) ;. WriteStringAt ( detA= raquo ;, font, 18, resolution.Y - matrixList [0] .size.Y -25, 0, resolution) ;. WriteStringAt (Convert.ToString (det), font, 60, resolution.Y - matrixList [0] .size.Y - 25, 0, resolution) ;;
}
сheck=true;
} void drawAllMatrix (TextureFont texFont, double [,] mtx1, double [,] mtx2)//для рісованія матриць (множення, додавання, віднімання)
{(operationMode)
{Mode.Multiplication: ( A * B= raquo ;, texFont, mtx1, mtx2) ;; Mode.Addition: ( A + B= raquo ;, texFont, mtx1, mtx2 ) ;; Mode.Substraction: ( AB= raquo ;, texFont, mtx1, mtx2) ;;
}
} void drawOperation (string operation, TextureFont texFont, double [,] mtx1, double [,] mtx2)//для методу вище
{font=20;//розмір шрифту=new Point (200, 200); (сheck == false)
{(operationMode)
{Mode.Multiplication: matrixM=new matrix (matrixOperations.multiplication (mtx1, mtx2) .GetLength (0), matrixOperations.multiplication (mtx1, mtx2) .GetLength (1)) ;. mtx= matrixOperations.multiplication (mtx1, mtx2) ;. Add (matrixM) ;; Mode.Addition: matrixA=new matrix (matrixOperations.addition (mtx1, mtx2) .GetLength (0), matrixOperations.addition (mtx1, mtx2) .GetLength ( 1)) ;. mtx=matrixOperations.addition (mtx1, mtx2) ;. Add (matrixA) ;; Mode.Substraction: matrixS=new matrix (matrixOperations.subtraction (mtx1, mtx2) .GetLength (0), matrixOperations.subtraction ( mtx1, mtx2) .GetLength (1)) ;. mtx=matrixOperations.subtraction (mtx1, mtx2) ;. Add (matrixS) ;;
}
} m=matrixList [0] .rowCount; m1=matrixList [2] .rowCount; n1=matrixList [0] .columnCount; n2=matrixList [1] .columnCount; m3=matrixList [2 ] .rowCount; .X=n1 * 55 + n2 * 55 + 30; .Y=25 * (m1 + m3) + 60; .LoadIdentity () ;. Ortho (0, resolution.X, resolution.Y, 0,- 1, 1) ;. Viewport (0, 2, glControl1.Width, glControl1.Height); [0] .Draw ( A=, 30, 13, texFont, resolution); [1] .Draw ( B= raquo ;, matrixList [0] .size.X + 60,13, texFont, resolution); [2] .Draw (operation, 30, matrixList [0] .size.Y +25, texFont, resolution) ;
сheck=true;
}
}
Класи.
public abstract class Matrix
{int rowCount; int columnCount; Point size; Matrix ()
{= new Point (0, 0);
} public void Draw (int x, int y);
} class Cell: Matrix
{int width; int height; Cell (int w, int h)
{. width=w; .height=h;
} void DrawLine (Point A, Point B)
{. Vertex2 (AX, AY) ;. Vertex2 (BX, BY);
} override void Draw (int x0, int y0)
{p1=new Point (x0, y0); p2=new Point (x0 + width, y0); p3=new Point (...