Electrofriends

C graphics program for analog clock

by Ranjith | October 2nd, 2009.

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;

Read More..

C Program to fill any given polygon using scan-line area filling algorithm

by Ranjith | October 2nd, 2009.

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();

Read More..

C Program to implement 3-D rotation with respect to x-axis, y-axis and z-axis

by Ranjith | October 2nd, 2009.

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.

Read More..

C Program to implement Bezier curves for a given set of control points.

by Ranjith | October 2nd, 2009.

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];

Read More..

C Program to implement Hermite curves for a given set of control points.

by Ranjith | October 2nd, 2009.

point p1,p2;
printf(“Enter 2 hermite points:\n”);
scanf(“%d%d%d%d”,&p1.x,&p1.y,&p2.x,&p2.y);
printf(“Enter the tangents at p1,p4″);
scanf(“%d%d”,&r1,&r4);
cleardevice();

Read More..

C Program to implement the Cohen-Sutherland line-clipping algorithm.

by Ranjith | October 2nd, 2009.

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).

Read More..

C Program to create a house and perform the operations.

by Ranjith | October 2nd, 2009.

C Program to create a house like figure and perform the following operations.
a. Scaling about the origin followed by translation.
b. Scaling with reference to an arbitrary point.
c. Reflect about the line y = mx + c.

Read More..

C Program to draw a rectangle and perform the operations.

by Ranjith | October 2nd, 2009.

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.

Read More..

C Program to implement the midpoint circle drawing algorithm

by Ranjith | October 2nd, 2009.

C Program to implement the midpoint circle drawing algorithm to draw a circle. Modify the algorithm toimplement specified arc or sector.

Read More..

C Program to display a line graph using midpoint line algorithm.

by Ranjith | October 2nd, 2009.

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.

Read More..
Electrofriends Comments
  • Alex: dear,i want to know more about car parking system if you interesting please give some information in addition...
  • Ranjith: You can give a link to this article in your website.
  • ashish: i need to design this car…would you pls send me all the details of it..what all stuff is required every...
  • Rinny Verma: hi………..plz send me the details n specifications of the robot….
  • omar: can u tell me how to control pitman motor using at89s51 through h bridge give ,jut move the motor in forward...
  • Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya