double t=0;
double a,b,rad;
rad=(3.1416*22.8)/180;
do
{
a = 500 * t * Math.Cos(rad);
b = 500 * t * Math.Sin(rad);
Print("tiempo " + t + " valor x " + a + " valor y " + b);
t = t + 1.0 / 2.0;
} while (t <= 10);
-----------------------------------------------------------------------
CONSOLA
static void Main(string[] args)
{
double t=0;
double a,b,rad;
//Console.WriteLine("tiempo " + t + " valor x " + a + " valor y " + b);
rad=(3.1416*22.8)/180;
do
{
a = 500 * t * Math.Cos(rad);
b = 500 * t * Math.Sin(rad);
Console.WriteLine("tiempo " + t + " valor x " + a + " valor y " + b);
t = t + 1.0 / 2.0;
} while (t <= 10);
Console.ReadKey();
}

WINDOWS:
private void button1_Click(object sender, EventArgs e)
{
double t = 0;
double a, b, rad;
//Console.WriteLine("tiempo " + t + " valor x " + a + " valor y " + b);
rad = (3.1416 * 22.8) / 180;
do
{
a = 500 * t * Math.Cos(rad);
b = 500 * t * Math.Sin(rad);
listBox1.Items.Add("tiempo " + t + " valor x " + a + " valor y " + b);
t = t + 1.0 / 2.0;
} while (t <= 10);
}

No hay comentarios:
Publicar un comentario