CGR TTTT

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

Computer Graphics (22318) Analog Clock

INDEX

SR NO CONTENTS PAGE NO

1 Rationale 4

2 Aim of micro-project 4

3 Course Outcomes Achieved 4

4 Actual Methodology Followed 4

6 Actual Resources Used 5

7 Source Code 5

8 Output 7

9 Skills developed 8

10 Conclusion 8

Department of Computer Technology (2023-24) 1


Computer Graphics (22318) Analog Clock

Annexure – I

Micro-Project Proposal

1.0 Aim of the Micro-Project:


The aim of the Micro-project is to design Analog Clock using ‘C’ programming.

2.0 Intended Course Outcomes:


• Manipulate visual and geometric information of images
• Develop programs for 2-D and 3-D Transformations.

3.0 Proposed methodology:


• Understand the aim of the topic.
• Go through available resources.
• Develop the program
• Test the program.
• Prepare the final report.

4.0 Action Plan:


Sr. Details of Activity Planned Planned Name of
Start Date Finish Date responsible
No.
Team members
1 Identify the requirements of
The project. 15/8/2023 16/ 8/2023 MD Sohail Khan

Samarth Deshmukh
2 Design the structure of the project. 22/8/2023 23/ 8/2023
3 Develop a program using ‘C’ Pranav Narkhede
29/8/2023 31/ 8/2023
4 Debug code and eliminate
errors occurred while 12/9/2023 14/ 9/2023 Samarth Deshmukh
compilation.
Pranav Narkhede
5 Test the project. 26/9/2023 28/9/2023

6 Prepare the final report. 24/10/2023 26/ 10/2023 MD Sohail Khan

Department of Computer Technology (2023-24) 2


Computer Graphics (22318) Analog Clock

5.0 Resources Required:

S. No. Resources required Specifications

1 Computer system Intel(R) CORE(TM)i5-2370M, CPU @ 2.40


GHz RAM 8 GB
2 Operating System Windows 10, 64 Bit Operating System

3 Software’s DevC++

6.0 Team members:


S. No. Roll. number Name of Student
1 50 Pranav Narkhede
2 54 MD Sohail Khan
3 55 Samarth Deshmukh

Department of Computer Technology (2023-24) 3


Computer Graphics (22318) Analog Clock

Annexure - II
Micro-Project Report

1.0 Aim of the Micro-Project:


The aim of the Micro-project is to design Analog Clock using C programming.

2.0 Rationale:
This course provides an introduction to the principles of computer graphics. In
particular, the course will consider methods for object design, transformation, scan
conversion, visualization and modeling of real world. The emphasis of the course
will be placed on understanding how the various elements that underlie computer
graphics (algebra, geometry, algorithms) interact in the design of graphics software
systems.

3.0 Course Outcomes Achieved:


• Manipulate visual and geometric information of images
• Implement standard algorithms to draw various graphics objects using c program.
• Develop programs for 2-D and 3-D Transformations.
• Use projections to visualize objects on view plane e. Implement various clipping
Algorithms.

4.0 Literature Review:


An Analog Clock is used to note the time and can be used for different time zones.

5.0 Actual Methodology Followed:

• Understand the aim of the topic.


• Go through available resources.
• Develop the program
• Test the program.
• Prepare the final report.

Department of Computer Technology (2023-24) 4


Computer Graphics (22318) Analog Clock

6.0 Actual Resources Used:

S. No. Resources required Specifications

1 Computer system Intel(R) CORE(TM) i5-2370M, CPU @ 2.40


GHz RAM 8 GB
2 Operating System Windows 10, 64 Bit Operating System

3 Software’s DevC++

Graphics function in c:

1. <stdio.h>: Standard for standard input-output.


2. <conio.h>: Console input-output.
3. <graphics.h>: The graphics. h header file provides access to a simple graphics library that makes it
possible to draw lines, rectangles, ovals, arcs, polygons, images, and strings on a graphical window.
4. initgraph(): This function is used to initialize the graphics system.
5. circle(): This function is used to draw a circle at (X,Y) of the given circle.
Void circle ( int X,int Y,int Radius).
6. Setcolor():Sets the current drawing color.
Setcolor(color).
7. closegraph(): Shuts down the graphics system.
8. line(): Used to draw a line .
Void line (int X1, int Y1, int X2, int Y2).

7.0 Source Code:

#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<dos.h>

#define WBC 5
//watchbackcolor
#define X 200
#define Y 200

void dial(int x, int y);


void sechand(int timeminute);

void minhand(int t)
{
int x1,y1;
setlinestyle(0,0,3);

Department of Computer Technology (2023-24) 5


Computer Graphics (22318) Analog Clock

x1= X+ (80 * cos(t*0.1047));


y1= Y+ (80 * sin(t*0.1047));

setcolor(BLACK);
line( X, Y, x1, y1);

setcolor(WBC+1);
line( X, Y, X+ 80 * cos((t-1)*0.1047),Y+ 80 * sin((t-1)*0.1047));
circle(X,Y,4);
}
void sechand(int t)
{
int x1,y1

setlinestyle(0,0,3);

x1= X+(100 * cos(t*0.1047)); y1= Y+(100 * sin(t*0.1047));

setcolor(RED); line(X, Y, x1, y1);

setcolor(WBC+1);
line(X, Y, X+ 100 * cos((t-1)*0.1047),Y+ 100 * sin((t-1)*0.1047));

circle(X,Y,4);
}

void dial(int x,int y)


{
int const size=200;

setfillstyle(1,WBC); fillellipse(x,y,size,size);

setfillstyle(1,WBC+1); fillellipse(x,y,size-20,size-20);

outtextxy(x,y-(size-40),"12");
outtextxy(x,y+(size-40),"6");
outtextxy(x+(size-40),y,"3");
outtextxy(x-(size-40),y,"9"); outtextxy(x+size/3,y-2*size/3,"1"); outtextxy(x+2*size/3,y-size/3,"2");
outtextxy(x+2*size/3,y+size/3,"4"); outtextxy(x+size/3,y+2*size/3,"5"); outtextxy(x-size/3,y+2*size/3,"7");
outtextxy(x-2*size/3,y+size/3,"8"); outtextxy(x-size/3,y-2*size/3,"11"); outtextxy(x-2*size/3,y-size/3,"10");

circle(x,y,4);

void main()
{
int gd=DETECT, gm,i,j, flag=1; initgraph(&gd,&gm,"C:\\turboc3\\bgi");

Department of Computer Technology (2023-24) 6


Computer Graphics (22318) Analog Clock
dial(200,200);
do
{
minhand(i);
(j=0;j<60;j++)
{
sechand(j);
delay(1000
);
if(kbhit()) {
flag =0;
break;
}
}
i++;
}while(flag);
closegraph();
}

8. Output:

Department of Computer Technology (2023-24) 7


Computer Graphics (22318) Analog Clock

9.0 Skills Developed:

▪ While developing the micro project, we learnt many practicallyapplied concepts


of Computer graphics and as we theory concepts.

▪ We learned to build a programs of computer graphics

10.0 Conclusion:

We learnt how to make a Analog clock using c language incomputer


graphics.

Department of Computer Technology (2023-24) 8

You might also like