sábado, 24 de octubre de 2009

PRACTICA 5.4



{
class Program
{
static void Main(string[] args)
{
double t, rad, x, y;
t = 0;
rad = Math.PI * 22.8 / 180;
Console.WriteLine("\ntiempo \tvalor de x \t\tvalor de y");
while(t<10)
{
x = 500 * t * Math.Cos(rad);
y = 500 * t * Math.Sin(rad);
Console.WriteLine("{0} \t{1} \t{2} ", t, x, y);
t = t + 0.5;
}
Console.ReadLine();



PRACTICA EN WINDOWS

namespace practica_5._8_windows
{
public partial class Form1 : Form
{
double T, RAD, X, Y;
public Form1()
{
T = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double T, RAD, X, Y;
T = 0;
RAD = Math.PI * 22.8 / 180;
listBox1.Items.Add("TIEMPO \tVALOR DE X \t\tVALOR DE Y");
do
{
X = 500 * T * Math.Cos(RAD);
Y = 500 * T * Math.Sin(RAD);
listBox1.Items.Add(T.ToString() + "\t" + X.ToString() + "\t\t" + Y.ToString());
T=T+ 1.0/2.0;
}
while(T<=10); } private void button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button3_Click(object sender, EventArgs e) { Close(); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e)





No hay comentarios:

Publicar un comentario