CGR Project-2-Pages-Deleted (1) (1) - Pages-Deleted

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

2020-

21

A Project Report
On
“ ”
SUB:Computer Graphics [22318]

1|Page
INDEX

SR.No Title Page no


1. Acknowledgement 6

2. Problem Statement 7

4. Implementation Details 8

3. Source Code of Project 9-10

4. Output of Program 11

5. Advantages and Applications 12

6. Conclusion 13

7. References 14

5|Page
ACKNOWLEDGEMENT

First and the foremost We , express our deep sense of gratitude, sincere thanks and
deep sense of appreciation to Project Guide Prof. V.G.Lachake, Department of
Computer Technology, Sanjivani K.B.P. Polytechnic, Kopargaon. Your availability
at any time throughout the year, valuable guidance, opinion, view, comments, critics,
encouragement, and support tremendously boosted this project work.
Lots of thanks to Head, Computer Technology Department, Prof.
G.N.JORVEKAR for providing us the best support we ever had. We like to express
our sincere gratitude to Dr.A.R.MIRIKAR, Principal, Sanjivani K. B. P.
Polytechnic, Kopargaon for providing a great platform to complete the project within
the scheduled time.
We are also Thankful to all the faculty members, Computer
Technology Department, Sanjivani K. B. P. Polytechnic, Kopargaon for giving
comments for improvement of work, encouragement and help during completion of
the Project. Last but not the least; We should say thanks from my bottom of heart to
our Family & Friends for their never ending love, help, and support in so many ways
through all this time. Thank you so much.
Patare Pratiksha Ashok
Khapare Arya Sopan
Gore Deepti Dattatray

Diploma in Computer Technology.


Sanivani K.B.P. Polytechnic, Kopargaon.

6|Page
PROBLEM STATEMENT
The project is about “Analog Clock”. The Analog Clock seems like running
with the current time after giving various inputs int the program code .The Analog
Clock shape is implemented using various lines and ellipse functions. We have
also used various 2D transformations such as rotation.We have also used various
mathematical functions.
This is a c program which reads the current time from system and 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 to show correct time. This real-
time analog clock c program uses graphics.h library to display the clock and time.h
library to get current time. The program output is as follows:
Short Introduction of the Project:
1.There are four header file stdio.h , graphics.h, math.h, time.h

2.We have drawn the object by using the circle function.We have initialize
hdeg,mindeg,secdeg i.e they stands for hour,minute,second.We have used for loop
in which we have given the condition to set standard time.We have drawn
minute,second and hour hand using line function.We have given motion to the
hand by using we can see that second hand keeps moving when the program is
run.Minute hand moves after completing one minute ani hour hand moves after
completing one hour.

 Graphic Function used-Circle( ),ellipse( ),line(),cleardevice( )


 Filling Pattern – Setfillstyle(SOLID_FILL,WHITE)
 Graphic Driver Path- initgraph(&gd,&gm,”C\\TC\\BGI”)

7|Page
The Project Code is implemented using Computer Graphics.
Following are the details of Concepts used in the program and the hardware and
software used to run this program.
The Computer Graphics Concepts:
1.Graphic Function
2.Filling Pattern
3.Various Header files

The Software used :Turbo C++

The Hardware used :


Computer i5
Processor:Intel® core™ i5-1035G1 CPU@1.00GHz 1,19 GHz
RAM:4GB
System type:64-bit Operating System ,x64-based processor

8|Page
SOURCE CODE OF PROJECT
#include<stdio.h>
#include<graphics.h>
#include<math.h>
#include<time.h>
int hr,sec,min;
void drawClock(int xc,int yc)
{
int i,inr=70,outr=80;
int hdeg,mindeg,secdeg,x,y;
circle(xc,yc,outr);
setfillstyle(SOLID_FILL,WHITE);
fillellipse(xc,yc,2,2);
for(i=180;i>-360;i-=6)
{
if(i%5==0)
fillellipse(xc+inr*sin(i*3.14f/180),yc+inr*cos(i*3.14f/180),2,2);
else
fillellipse(xc+inr*sin(i*3.14f/180),yc+inr*cos(i*3.14f/180),1,1);
//draw hands
hdeg=hr*360/12+30*min/60;
mindeg=min*6;
secdeg=sec*6;
x=xc+40*sin(hdeg*3.14f/180);
y=yc-40*cos(hdeg*3.14f/180);
line(xc,yc,x,y);
x=xc+55*sin(mindeg*3.14f/180);
y=yc-55*cos(mindeg*3.14f/180);
line(xc,yc,x,y);
x=xc+65*sin(secdeg*3.14f/180);
y=yc-65*cos(secdeg*3.14f/180);
line(xc,yc,x,y);
}
}
void main()
{
time_t now;
struct tm *timeinfo;
int gd=DETECT,gm,midx,midy;
int tsec,tmin,thr;
initgraph(&gd,&gm,"..\\BGI\\");
midx=getmaxx()/2;
midy=getmaxy()/2;
time(&now);
timeinfo=localtime(&now);

9|Page
hr=timeinfo->tm_hour;
min=timeinfo->tm_min;
sec=timeinfo->tm_sec;
while(!kbhit())
{
drawClock(midx,midy);
delay(995);
cleardevice();
tsec=(sec+1)%60;
tmin=(min+(tsec==0?1:0))%60;
thr=(hr+(tmin==0?1:0))%12;
hr=thr;
sec=tsec;
min=tmin;
}
}

10 | P a g e
OUTPUT OF THE PROGRAM

11 | P a g e
ADVANTAGES OF ANALOG CLOCK
1. Easy to implement
2.Easy to understand
3.Easy to access
4.Works without electricity
5.Easy to read quickly
6.Often most reliable
7.Easy to estimate elapsed time

Applications of analog Clock


1.Mostly used in school,colleges
2.Mostly used in multinational companies
3.Used in various shops
4.Used in malls,medicals
5.Used in Hospitals.

12 | P a g e
CONCLUSION
It was a great experience to design and implement “Analog Clock” by
using a Computer Graphics using c language.While working on this project,We
have learned many things especially how to apply the concepts of computer
graphics in our real world.
This assignment helped us to get the better understanding to develop and
organise them such that they will model real world systems within computers.It
also helped us in getting in the better understanding of basic concepts of Computer
Graphics .In this project,we have used every concepts of Computer Graphics
language,we have learned .We have also provided validations throughout the
system for avoiding logical errors,used excellent logic related comments with
proper indentation and the OOP’s concept in an excellent manner.
After doing this project,We are in position to explain Computer Graphics
concepts and apply them to the modelling of real world systems by utilizing its
offered facilities. We have also came across how to use various graphic function in
our real life.This project played a major role in our life because we have came
across through various applications of computer graphics which we all of us are
using in this modern world.This project will definitely help us in our future to deal
with the various functions and applications of computer graphics.

13 | P a g e
REFERENCES
1.https://www.google.com
2.httpp://www.tutorialspoint.com
3.http://www.wikipedia.com
BOOKS:-
1.Fundamentals of computer Graphics
2.Computer Graphics-Mr.Sanjesh S.Pawale
3.Computer Graphics-Mrs.Hemlata S.Ohal

14 | P a g e

You might also like