Programa class
using using using using System; [Link]; [Link]; [Link];
namespace WindowsFormsApplication3 { class triangulo { double a, b, c, A, B, C; public void idatos(double pa, double pb, double pC) { a = pa; b = pb; C = pC; } public double calc_c() { c = [Link]((a * a + [Link](b, 2) - 2 * a * b * [Link](C * 0.017453)), 0.5); return c; } public double calc_A() { A = (180 / 3.14159) * ([Link](a * [Link](C * 0.017453) / c)); return A; } public double calc_B() { B = 180 - A - C; return B; } //2 public void idato(double pa, double pB, double pC) { a = pa; B = pB; C = pC; } public double calc_A2() { A = (180 - C - B); return A; } public double calc_c2() { c = ((a * [Link](C * 0.017453)) / [Link](A * 0.017453)); return c; } public double calc_b() { b = ((c * [Link](B * 0.017453)) / [Link](C * 0.017453)); return b; } }
class Ccilindr { double h, r, a, v; public void idatos(double pH, double pR) { h = pH; r = pR; } public double calc_a() { a = (2 * 3.141593 * r) * (h + r); return a; } public double calc_v() { v = 3.141593 * r * r * h; return v; } } class paralelepipedo { double h, a, v, V, m; public void idatos(double pH, double pR) { h = pH; v = pR; } public double calc_a() { a = (v / h); return a; } public double calc_V() { V = ((2 * a * m) + (2 * a * h) + (2 * m * h)); return V; } } class Ccono1 { double h, r, a, v, g; public void idatos(double pH, double pR) { h = pH; r = pR; } public double calc_a() { a = (3.141593 * r) * (g + r);
return a; } public double calc_v() { v = (3.141593 * r * r * h) / 3; return v; }
} }
####################3funcion seno
using using using using using using using System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace WindowsApplication27 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //variables double x0, y0, x1, y1; double xscale0, yscale0, xscale1, yscale1; double i; int xp0, yp0, xp1, yp1; //plumas Pen plumA Pen plumB Pen plumC Pen plumD Pen plumE
= = = = =
new new new new new
Pen([Link], 1); Pen([Link], 1); Pen([Link], 1); Pen([Link], 1); Pen([Link], 1);
//ejes de coordenadas Graphics eje = CreateGraphics(); [Link](plumB, 100, 150, 500, 150); [Link](plumC, 120, 10, 120, 300); //curva seno(x) Graphics segmento = CreateGraphics(); for (i = 0; i < 180; i++) { //primer punto
x0 = 2 * i; x0 = 0.017453 * x0; //a radianes y0 = [Link](x0); xscale0 = 120.0 + 50.0 * x0; yscale0 = 150.0 - 100.0 * y0; xp0 = (Int32)xscale0; //operador de moldeado yp0 = (Int32)yscale0; //segundo punto x1 = 2 * (i + 1); x1 = 0.017453 * x1; y1 = [Link](x1); xscale1 = 120.0 + 50.0 * x1; yscale1 = 150.0 - 100.0 * y1; xp1 = (Int32)xscale1; yp1 = (Int32)yscale1; //segmento para trazar la curva [Link](plumA, xp0, yp0, xp1, yp1); } } } Animation using using using using using using using System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace WindowsApplication27 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //variables double x0, y0, x1, y1; double xscale0, yscale0, xscale1, yscale1; double i; int xp0, yp0, xp1, yp1; //plumas Pen plumA Pen plumB Pen plumC Pen plumD Pen plumE
= = = = =
new new new new new
Pen([Link], 1); Pen([Link], 1); Pen([Link], 1); Pen([Link], 1); Pen([Link], 1);
//ejes de coordenadas Graphics eje = CreateGraphics(); [Link](plumB, 100, 150, 500, 150); [Link](plumC, 120, 10, 120, 300);
//curva seno(x) Graphics segmento = CreateGraphics(); for (i = 0; i < 180; i++) { //primer punto x0 = 2 * i; x0 = 0.017453 * x0; //a radianes y0 = [Link](x0); xscale0 = 120.0 + 50.0 * x0; yscale0 = 150.0 - 100.0 * y0; xp0 = (Int32)xscale0; //operador de moldeado yp0 = (Int32)yscale0; //segundo punto x1 = 2 * (i + 1); x1 = 0.017453 * x1; y1 = [Link](x1); xscale1 = 120.0 + 50.0 * x1; yscale1 = 150.0 - 100.0 * y1; xp1 = (Int32)xscale1; yp1 = (Int32)yscale1; //segmento para trazar la curva [Link](plumA, xp0, yp0, xp1, yp1); } } } }