0% found this document useful (0 votes)
92 views5 pages

Analog Clock Project in C Graphics

This document discusses a C program that displays a real-time analog clock using graphics libraries. It gets the current system time from the time.h library and calculates the positions of the hour, minute, and second hands using trigonometric functions to show the correct time. The program logic uses the gettime() function to obtain the time and calculates angles based on the seconds, minutes, and hours to display a functioning analog clock on the screen.

Uploaded by

Aditya Mhaisale
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views5 pages

Analog Clock Project in C Graphics

This document discusses a C program that displays a real-time analog clock using graphics libraries. It gets the current system time from the time.h library and calculates the positions of the hour, minute, and second hands using trigonometric functions to show the correct time. The program logic uses the gettime() function to obtain the time and calculates angles based on the seconds, minutes, and hours to display a functioning analog clock on the screen.

Uploaded by

Aditya Mhaisale
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Introduction..

Computer graphics is an art of drawing


images on computer screen using programs.

This project emphasis on an analog clock as well as that displays


the system time, using graphics.

This real-time analog clock c program uses graphics.h library to


display the clock and time.h library to get current time.

This is a c program which reads the current time from

System and shows an analog clock that shows an analog clock


that shows correct time. The clock hand ticks and the three
hands( hour hand, minute hand second hand) are used to show
correct time.
Proposed logic..

To calculate time taken by a


process, we have used gettime() function
which is available in time.h header file
the code to calculate the system time is
as follows:
I=(int(t.ti_sec)*(0.105))=11
J=(int(t.ti_min)*(0.105))+11
K=((int(t.ti_hour)*(0.105))*5+11)

Min=int(t.ti_min);
Rem=min/12;
K=k+(rem*0.105);
Similarly the second hand, minute hand and hour
hand is calculated using cos()and sin() functions that
are available in math.h header file
Conclusion …

 The project report entitled “ clock with pendulam”


has come to its final stage.

 Computer graphics are pictures that are created


using computers.

 This project focuses on creating an anolog and


digital clock in graphics using suitable libraries.
References..

 Computer graphics book by Tech Knowledge


publications.
 [Link]
 [Link]
 [Link]
 [Link]

You might also like