Time_Dig[0]=hour/10+48;
Time_Dig[1]=hour%10+48;
Time_Dig[2]=’:';
Time_Dig[3]=min/10+48;
Time_Dig[4]=min%10+48;
Time_Dig[5]=’:';
Time_Dig[6]=sec/10+48;
setcolor (WHITE);
line (pt[0][0], pt[0][1], pt[1][0], pt[1][1]);
line (pt[1][0], pt[1][1], pt[2][0], pt[2][1]);
line (pt[2][0], pt[2][1], pt[0][0], pt[0][1]);
getch();
C Program to implement 3-D rotation with respect to x-axis, y-axis and z-axis (wire frame model of a cube). Use appropriate data structures to manipulate the wire frame model.
double xt = pow (1-t, 3) * x[0] + 3 * t * pow (1-t, 2) * x[1] +
3 * pow (t, 2) * (1-t) * x[2] + pow (t, 3) * x[3];
double yt = pow (1-t, 3) * y[0] + 3 * t * pow (1-t, 2) * y[1] +
3 * pow (t, 2) * (1-t) * y[2] + pow (t, 3) * y[3];
C Program to implement the Cohen-Sutherland line-clipping algorithm. Make provision to specify the input line, window for clipping and view port for displaying the clipped image. (Use built-in line and rectangle functions).
C Program to draw a rectangle and perform the following operations.
a. Rotation about the origin followed by translation.
b. Rotation about an arbitrary point.
c. Apply X shear and Y shear on the rectangle.
Program to display a line graph using midpoint line algorithm. The input to the program is a set of data corresponding to the X and Y-axes. Data parts are to be displayed as asterisk (*) according to the input specification.
Program to implement the Midpoint Line algorithm to generate a line of given slope and thickness. Implement the polyline (many lines) command using this algorithm as a routine that display a set of straight lines between N input points. For n=1 the routine displays a single point.
line(80+i,300,90+i,270);
line(90+i,270,120+i,270);
line(120+i,270,160+i,240);
line(160+i,240,230+i,240);
line(230+i,240,275+i,270);
theta=M_PI*angle/180;
x[i]=xc+r*cos(theta);
y[i]=yc+r*sin(theta);
angle+=20;
line(xc,yc,x[i],y[i]);
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Resources #Terms of Use
Copyright©2012 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com