public void CalculaAreaCirculoDiametro() { CCirculo circulo = new CCirculo(); Dictionary <string, double> valores = new Dictionary <string, double>(); valores.Add("diametro", 10d); Assert.AreEqual(246.741264d, circulo.CalcularArea(valores), 0.1d); }
public void CalculaAreaCirculo() { CCirculo circulo = new CCirculo(); Dictionary <string, double> valores = new Dictionary <string, double>(); valores.Add("radio", 30d); Assert.AreEqual(8882.685504d, circulo.CalcularArea(valores), 0.1d); }
public void CalculaPerimetroCirculoDiametro() { CCirculo circulo = new CCirculo(); Dictionary <string, double> valores = new Dictionary <string, double>(); valores.Add("diametro", 15d); double perimetro = circulo.CalcularPerimetro(valores); Assert.AreEqual(47.124d, perimetro); }
public void CalculaPerimetroCirculoRadio() { CCirculo circulo = new CCirculo(); Dictionary <string, double> valores = new Dictionary <string, double>(); valores.Add("radio", 10d); double perimetro = circulo.CalcularPerimetro(valores); Assert.AreEqual(62.832d, perimetro); }
private void Crear_Seccion(string Tipo_Seccion, float b, float h, float tw, float tf, float r) { ISeccion N_Seccion = null; string Nombre_Seccion = ""; GDE gde = GDE.DMO; List <float[]> Vertices_Temp = new List <float[]>(); List <float[]> Vertices = new List <float[]>(); double Xc, Yc; double Numerador, Denominador; MAT_CONCRETE material = new MAT_CONCRETE() { Name = "H" + tbFc.Text, FC = Convert.ToSingle(tbFc.Text) }; if (Radio_Dmo.Checked) { gde = GDE.DMO; } if (Radio_Des.Checked) { gde = GDE.DES; } if (Tipo_Seccion == TipodeSeccion.Rectangular.ToString()) { Nombre_Seccion = $"C{b}X{h}{material.Name}"; N_Seccion = new CRectangulo(Nombre_Seccion, b / 100, h / 100, material, TipodeSeccion.Rectangular, null); N_Seccion.Calc_vol_inex(r / 100, 4220, gde); N_Seccion.Refuerzo_Base(r); } if (Tipo_Seccion == TipodeSeccion.Circle.ToString()) { Nombre_Seccion = $"C{b}{material.Name}"; N_Seccion = new CCirculo(Nombre_Seccion, b / 200, new double[] { 0, 0 }, material, TipodeSeccion.Circle, null); N_Seccion.Calc_vol_inex(r / 100, 4220, gde); N_Seccion.Refuerzo_Base(r); } if (Tipo_Seccion == TipodeSeccion.Tee.ToString() | Tipo_Seccion == TipodeSeccion.L.ToString()) { Nombre_Seccion = $"C{b}X{h}X{tw}X{tf}{Tipo_Seccion}{material.Name}"; if (Tipo_Seccion == TipodeSeccion.Tee.ToString()) { Vertices_Temp.Add(new float[] { 0, h / 200 }); Vertices_Temp.Add(new float[] { 0, (h - tw) / 200 }); Vertices_Temp.Add(new float[] { (b - tf) / 400, (h - tw) / 200 }); Vertices_Temp.Add(new float[] { (b - tf) / 400, 0 }); Vertices_Temp.Add(new float[] { (b + tf) / 400, 0 }); Vertices_Temp.Add(new float[] { (b + tf) / 400, (h - tw) / 200 }); Vertices_Temp.Add(new float[] { b / 200, (h - tw) / 200 }); Vertices_Temp.Add(new float[] { b / 200, h / 200 }); Numerador = ((b / 2) * b * tw) + ((b / 2) * (tf * (h - tw))); Denominador = (b * tw) + (tf * (h - tw)); Xc = b / 200; double y1 = (h - tw) * (h - tw) * tf / 2; double y2 = (h - (tw / 2)) * b * tw; Numerador = y1 + y2; Denominador = (b * tw) + (tf * (h - tw)); Yc = h / 200; for (int i = 0; i < Vertices_Temp.Count; i++) { var Aux = B_Operaciones_Matricialesl.Operaciones.Traslacion(Vertices_Temp[i][0] - Xc, Vertices_Temp[i][1] - Yc, Vertices_Temp[i][0], Vertices_Temp[i][1]); Vertices.Add(new float[] { (float)Aux[0], (float)Aux[1] }); } N_Seccion = new CSD(Nombre_Seccion, b / 100, h / 100, tw / 100, tf / 100, material, TipodeSeccion.Tee, Vertices); } if (Tipo_Seccion == TipodeSeccion.L.ToString()) { Vertices_Temp.Add(new float[] { 0, 0 }); Vertices_Temp.Add(new float[] { b / 200, 0 }); Vertices_Temp.Add(new float[] { b / 200, tw / 200 }); Vertices_Temp.Add(new float[] { tf / 200, tw / 200 }); Vertices_Temp.Add(new float[] { tf / 200, h / 200 }); Vertices_Temp.Add(new float[] { 0, h / 200 }); Numerador = ((b / 2) * b * tw) + ((tf / 2) * (tf * (h - tw))); Denominador = (b * tw) + (tf * (h - tw)); Xc = b / 200; Numerador = ((tw / 2) * b * tw) + ((h + tf / 2) * (tf * (h - tw))); Denominador = (b * tw) + (tf * (h - tw)); Yc = h / 200; for (int i = 0; i < Vertices_Temp.Count; i++) { var Aux = B_Operaciones_Matricialesl.Operaciones.Traslacion(Vertices_Temp[i][0] - Xc, Vertices_Temp[i][1] - Yc, Vertices_Temp[i][0], Vertices_Temp[i][1]); Vertices.Add(new float[] { (float)Aux[0], (float)Aux[1] }); } N_Seccion = new CSD(Nombre_Seccion, b / 100, h / 100, tw / 100, tf / 100, material, TipodeSeccion.L, Vertices); } N_Seccion.Calc_vol_inex(r / 100, 4220, gde); N_Seccion.Refuerzo_Base(r); } if (N_Seccion != null) { if (Radio_Dmo.Checked) { if (Form1.secciones_predef.Secciones_DMO.Exists(x => x.Equals(N_Seccion)) == false) { Form1.secciones_predef.Secciones_DMO.Add(N_Seccion); } } if (Radio_Des.Checked) { if (Form1.secciones_predef.Secciones_DES.Exists(x => x.Equals(N_Seccion)) == false) { Form1.secciones_predef.Secciones_DES.Add(N_Seccion); } } } }