Skip to main content

Posts

Showing posts with the label C Graphics

Analog clock in c - Simplified

C program implement analog clock   #include <stdio.h>   #include <conio.h>   #include <string.h>   #include <math.h>   #include <time.h>   #include <graphics.h>   #include <dos.h>  /*   * calculates the position for minute and second needle.   * 360 to 90 degree is equivalent to 45 to 0 th minute   * in clock.  So, store the points in reverse direction(45 to 0)   * Once 0 is reached, we need to store points corresponds to   * 84th degree to 0 degree in reverse direction(59 to 46). So,   * totally we will get 60 points which corresponds to 60   * minute or second position in clock.   */   void minSecCalc(int xrad, int midx, int midy, int x[60], int y[60]) {         int i, j = 45;         for (i = 360; i >= 0; i = i - 6) {                 x[j] = midx - (xrad * cos((i * 3.14) / ...