grafica con C++

esci turboc.htm

/* seno3.c */

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <graphics.h>
#include <conio.h>

main()

{
int sc,tp,a,g;
float r,y,c;
sc=0;tp=3;
initgraph(&sc,&tp,"c:\\turboc");
setbkcolor(1);
g=0;
outtextxy(10,10,"sinusoide e cosinusoide punteggiate");
line(10,200,400,200);
line(10,10,10,400);
for (a=10;a<=400;a++)
{
r=g*3.14/90;
y=sin(r);
y=y*50;
c=cos(r);
c=c*70;
setcolor(2);
line(a,200+y,a,200+y);
setcolor(3);
line(a,200+c,a,200+c);
g=g+2;
}
getch();
}