private static void PonTamano(TMatriz Mat) { Console.Clear (); Console.WriteLine("Digite Numero de Filas .. "); Mat.Filas = uint.Parse (Console.ReadLine ()); Console.WriteLine("Digite Numero de Columnas .. "); Mat.Columnas = uint.Parse (Console.ReadLine ()); }
public Matriz(double tx, double ty) { double[,] m = new double[, ] { { 1, 0, 0 }, { 0, 1, 0 }, { tx, ty, 1 } }; matriz = m; tmatriz = TMatriz.Traslacion; }
private static string NombreOperacion(TMatriz Mat) { string Nom = ""; if (Mat is TMatriz3) { Nom = "Promedio"; } else if (Mat is TMatriz2) { Nom = "Promedio impares de filas pares"; } else if (Mat is TMatriz1) { Nom = "Suma"; } return Nom; }
public Matriz(double angulo) { angulo = angulo * Math.PI / 180.0; double[,] m = new double[, ] { { (Math.Cos(angulo)), (Math.Sin(angulo)), 0 }, { (-Math.Sin(angulo)), (Math.Cos(angulo)), 0 }, { 0, 0, 1 } }; matriz = m; tmatriz = TMatriz.Rotacion; }
private static void Mostrar(TMatriz Mat) { int i, j; Console.Clear (); for(i=0;i<Mat.Columnas;i++){ for (j=0; j<Mat.Filas; j++) { Console.Write ("{0} ", Mat.Matriz[i,j]); } Console.WriteLine(" "); } Console.WriteLine ("Presione Cualquier Tecla ..."); Console.ReadKey (); }
public Matriz(double escalaX, double escalaY, bool crece) { if (crece) { double[,] m = new double[, ] { { escalaX, 0, 0 }, { 0, escalaY, 0 }, { 0, 0, 1 } }; matriz = m; tmatriz = TMatriz.Escalamiento; } else { double[,] m = new double[, ] { { 1 / escalaX, 0, 0 }, { 0, 1 / escalaY, 0 }, { 0, 0, 1 } }; matriz = m; tmatriz = TMatriz.Escalamiento; } }
private static void VerOperacion(TMatriz Mat) { Console.Clear (); Console.WriteLine ("{0}={1}",NombreOperacion(Mat),Mat.Operacion()); }
public Matriz(double[,] matriz, TMatriz tmatriz) { this.matriz = matriz; this.tmatriz = tmatriz; }