Programa para calcular un engrane
Enviado por José Castillo • 26 de Mayo de 2017 • Apuntes • 703 Palabras (3 Páginas) • 143 Visitas
PROGRAMACION PARA CALCULAR LAS DIMENCIONES DE UN ENGRAN
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Resultado_Click(object sender, EventArgs e)
{
double np, pd, ng, an, dp, dg, p, ad, b, c, dop, dog, drp, drg, ht, hx, cen, t, ang, dbp, dbg;
np = System.Convert.ToDouble(Np.Text);
pd = System.Convert.ToDouble(Pd.Text);
ng = System.Convert.ToDouble(Ng.Text);
an = System.Convert.ToDouble(A.Text);
dp = np / pd;
Dp.Text = System.Convert.ToString(dp);
dg = ng / pd;
Dg.Text = System.Convert.ToString(dg);
p = 3.1416 / pd;
P.Text = System.Convert.ToString(p);
ad = 1 / pd;
Add.Text = System.Convert.ToString(ad);
b = 1.25 / pd;
B.Text = System.Convert.ToString(b);
c = 0.25 / pd;
C.Text = System.Convert.ToString(c);
dop = (np + 2)/pd;
Dop.Text = System.Convert.ToString(dop);
dog = (ng + 2)/ pd;
Dog.Text = System.Convert.ToString(dog);
drp = dp - (2* b);
Drp.Text = System.Convert.ToString(drp);
drg = dg - (2* b);
Drg.Text = System.Convert.ToString(drg);
ht = ad + b;
Ht.Text = System.Convert.ToString(ht);
hx = 2 * ad;
Hx.Text = System.Convert.ToString(hx);
cen = (ng + np) /(2 * pd);
Cen.Text = System.Convert.ToString(cen);
t = 3.1416 /(2 * pd);
T.Text = System.Convert.ToString(t);
ang = Math.Cos(an);
dbp = dp *ang ;
Dbp.Text = System.Convert.ToString(dbp);
dbg = dg * ang;
Dbg.Text = System.Convert.ToString(dbg);
}
}
}
[pic 1]
...