One of the most important signals you will deal with in your
One of the most important signals you will deal with in your engineering classes in called the damped exponential, and is given by: f(t) = e^cos(omega t) There omega controls the frequency (how fast the signal oscillates). Write program to create a plot of this function. Use your Svg function. Identify another interesting function that\'s important in engineering and plot it.
Solution
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
#include<dos.h>
#define PI 3.1416
int main()
{
int hj=DETECT,kmd,errcde;
int x,x1;
double y1;
int a;
char ch;
clrscr();
printf(\"Initiating graphics mode press any key to continue\");
initgraph(&hj,&kmd,\"C:\\\\TC\\\\BGI\\\\\");
errcde=graphresult();
if(errcde!=0)
{
printf(\"ERROR:%s\",grapherrormsg(errcde));
getch();
exit(1);
}
printf(\"enter the ampiltude:\");
scanf(\"%d\",&a);
for(x=0,x1=0;!(kbhit());x++,x1++)
{
y1=a*cos(x1*PI/180);
if(y1>0)
{
putpixel(x1,y1*150+200,WHITE);
}
if(y1<0)
{
putpixel(x1,y1*150+200,WHITE);
}
delay(10);
}
getch();
closegraph();
return 0;
}
