• Jueves 28 de Marzo de 2024, 21:32

Autor Tema:  radar  (Leído 755 veces)

eruelas

  • Miembro activo
  • **
  • Mensajes: 69
  • Nacionalidad: mx
    • Ver Perfil
radar
« en: Sábado 13 de Diciembre de 2008, 05:34 »
0
Bueno ps ahora ando diseñando diske un radar solo me falta saber komo mover el indicador(la linea k gira) se k es kon un for pero lo he intentado y la verdad no se komo hacerle si alguien me puede guiar se lo agradeceria
Código: Text
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main(void)
  7. {
  8.     clrscr();
  9.    /* request auto detection */
  10.    int gdriver = DETECT, gmode, errorcode;
  11.    int midx, midy;
  12.    int radius = 200;
  13.    int ymax,xmax;
  14.  
  15.    /* initialize graphics and local variables */
  16.    initgraph(&gdriver, &gmode, "c:\TC\BGI");
  17.  
  18.    /* read result of initialization */
  19.    errorcode = graphresult();
  20.    if (errorcode != grOk)  /* an error occurred */
  21.    {
  22.       printf("Graphics error: %sn", grapherrormsg(errorcode));
  23.       printf("Press any key to halt:");
  24.       getch();
  25.       exit(1); /* terminate with an error code */
  26.    }
  27.    xmax=getmaxx();
  28.    ymax=getmaxy();
  29.    midx = getmaxx() / 2;
  30.    midy = getmaxy() / 2;
  31.    setcolor(getmaxcolor());
  32.  
  33. line(120, midy, 519, midy);
  34. for(int x=midx;midx<100;midx++)
  35. {
  36.  line(x,239,176,100);
  37.    }
  38.    line(midx, 40, midx,438);
  39.    /* draw the circle */
  40.    circle(midx, midy, radius);
  41.    circle(midx, midy, radius=50);
  42.    circle(midx, midy, radius=70);
  43.    circle(midx, midy, radius=90);
  44.    circle(midx, midy, radius=110);
  45.    circle(midx, midy, radius=130);
  46.    circle(midx, midy, radius=150);
  47.    circle(midx, midy, radius=170);
  48.    circle(midx, midy, radius=30);
  49.    circle(midx*1.3,midy*1.5,radius=8);
  50.    circle(midx, midy/5.6, radius=30);
  51.    circle(midx, midy*1.84, radius=30);
  52.    circle(midx=getmaxx()/5.3, midy, radius);
  53.    circle(midx=getmaxx()/1.23, midy, radius=30);
  54.    /* clean up */
  55.    getch();
  56.    closegraph();
  57.    return 0;
  58. }
  59.