0% found this document useful (0 votes)
22 views8 pages

CG 33

The micro project proposal outlines the development of an animation of the solar system using the C programming language, focusing on interactive learning and programming skills. The project aims to integrate astronomical concepts with graphical programming, enhancing problem-solving and creative thinking. The methodology includes requirement analysis, design, development, testing, and documentation, with specified resources and group members involved in the project.

Uploaded by

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

CG 33

The micro project proposal outlines the development of an animation of the solar system using the C programming language, focusing on interactive learning and programming skills. The project aims to integrate astronomical concepts with graphical programming, enhancing problem-solving and creative thinking. The methodology includes requirement analysis, design, development, testing, and documentation, with specified resources and group members involved in the project.

Uploaded by

khaparderahil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Government Polytechnic Bramhapuri

PART A – Micro Project Proposal

Animation on Solar system using c language


1.0 Aim/ Benefits of the Micro- Project :

 Interactive Learning: Enhances understanding of the solar system through a visual and
engaging representation.

 Programming Skills: Develops expertise in using the Xe language for animation and
simulation.

 Creative Thinking: Encourages innovation and creativity in presenting scientific concepts.

 Problem-Solving: Strengthens debugging and logical thinking skills while implementing


animations.

2.0 Course Outcomes Addressed :

 Demonstrate the ability to use programming languages for graphical applications.

 Apply basic astronomical concepts to create accurate solar system models.

 Gain experience in developing animations for educational purposes.

 Integrate physics and motion principles into programming for real-world applications.

3.0 Proposed Methodology:

For making this Micro-project we will follow the following steps.

 1. Requirement Analysis: Study the solar system's components, orbital mechanics, and motion
characteristics.

 2. Design: Create a storyboard outlining the animation flow, including planets, orbits, and
celestial interactions.

 3. Development: Use Xe language to code the animation with features like planet rotation,
revolution, and scaling.

 4. Testing and Debugging: Ensure smooth transitions, accurate orbital paths, and
synchronization of planetary motion.
 5. Documentation: Record observations, code structure, and user guidelines for
future reference..

4.0 Resources Required:

Sr. Name of Specifications Qty Remarks


No. Resource/material
1 Computer(i3-i5 preferable),RAM 01
Computer system with
minimum 2GB and onwards but
broad specification
not limited to

2 Software Turbo C/C++ Version 3.0 or later 01


with DOSBOX

3 Any other resource Windows XP/Windows 01


used 7/LINUX version 5.0 or later

5.0 Group members with Roll Numbers:

Sr. Name Roll No. Enrollment No.


No.
1 Ayan Lakhani 1 233102402105
2 Aditya Meshram 37 23310240209
3 Nikhil Amborkar 38 23310240210
4 Mukesh Thawari 44 23310240220
5 Prajwal Meshram 49 23310240226
6 Rahil Khaparde 60 23310240294

Government Polytechnic Bramhapuri

PART B – Micro Project Report

Animation on Solar system using c language


1.0 Rationale:
Creating an animation of the solar system using the C language serves as a practical approach to
blending computer programming with scientific visualization. This project demonstrates the
application of C graphics for simulating real-world phenomena, offering students a deeper
understanding of both programming concepts and the dynamics of celestial bodies.

2.0 Aims/Benefits of the Micro-Project:

 Practical Application of Concepts: Integrates mathematical equations and graphical libraries in


C to represent orbital mechanics.

 Skill Development: Enhances problem-solving, coding efficiency, and knowledge of graphics


programming.

 Visualization of Science: Helps in visualizing complex astronomical concepts, making learning


more interactive and engaging.

 Project-Based Learning: Encourages teamwork, documentation skills, and exposure to real-


world applications of programming.

3.0 Course Outcomes Achieved:

 Apply basic graphics functions in C programming for visual simulations.

 Understand and implement algorithms for motion and transformations.

 Learn problem-solving and debugging techniques for animation projects.

 Gain experience in creating educational tools using programming.

Literature Review:

The information about the topic was collected by different sources such as a different reference
book, YouTube, and also we meet the teacher relate with this topic the corresponding subject in
our college we got good information from our subject teacher Mrs. S. K. Kharkate

4.0 Actual Methodology Followed:

 Problem Analysis: Define the scope of the animation (e.g., number of planets, speed of motion,
and graphical accuracy).

 Resource Preparation: Install and configure the C compiler (like Turbo C++) and graphics
library (graphics.h).
Algorithm Design:

 Calculate planetary positions using equations of motion.

 Implement transformations for rotation and revolution.

Development:

 Initialize graphics modes.

 Draw celestial bodies using functions like circle(), ellipse(), and line().

 Simulate motion using loops and delays (delay()).

Algorithm for Solar System Animation


 Initialize the Graphics Mode:
 Set the graphics driver and mode using initgraph().
 Check for any graphics errors.
 Define Parameters:
o Define the center of the screen (midx, midy).
o Initialize the radii for each planet’s orbit (xrad, yrad). o Set up arrays for the positions
(x, y) and motion of planets.
o Define initial positions (pos[]) for the planets, and their colors and names.
 Calculate Planet Motion:
o For each planet, calculate the orbital coordinates using polar to Cartesian conversion
(cos and sin) for each 6-degree step (360 degrees total).
o Store the coordinates for each planet in the x and y arrays.

 Start Animation Loop:

Continuously run the animation as long as no key is pressed (! kbhit()):


1. Draw Orbits:
 Draw ellipses (orbits) for each planet using ellipse() function with varying radii.

2.Draw the Sun:


 Draw the Sun as a yellow circle at the center using circle(). Add text “Sun” at
the center of the Sun.

3.Draw “SOLAR SYSTEM”:


 Draw the text “SOLAR SYSTEM” at the bottom of the screen using outtextxy().

4.Draw Planets:
 For each planet, draw it using pieslice() at the appropriate coordinates based on
the precomputed orbital positions.
 Display each planet’s name beside it using outtextxy().

5. Update Planet Positions:

 Update the position of each planet by decreasing the position index (pos[i] =
(pos[i] <= 0) ? 59 : pos[i] - 1;) to simulate motion.
6. Pause for Delay:

 Use delay() to control the speed of animation.


7. Clear Screen:

 Use cleardevice() to clear the screen for the next frame.


 End Animation:

 Once the loop ends (when a key is pressed), use getch() to capture the input
and exit the program.

 Close the Graphics Mode:

 Use closegraph() to properly close the graphics mode before ending


the program
 PROGRAM

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

void planetmotion(int xrad, int yrad, int midx, int midy, int x[60], int y[60]) {
int i, j = 0;
for (i = 0; i < 360; i += 6) {
x[j] = midx - (int)(xrad * cos(i * 3.14159 / 180));
y[j++] = midy - (int)(yrad * sin(i * 3.14159 / 180));
}
}

void main() {
int gd = DETECT, gm, midx, midy;
int xrad[9], yrad[9], x[9][60], y[9][60];
int pos[9] = {0, 6, 12, 18, 24, 30, 36, 42, 48};
int planet[9] = {7, 8, 9, 10, 11, 12, 13, 14, 15};
int planetColors[9] = {CYAN, GREEN, BLUE, RED, BROWN, LIGHTGRAY, BROWN,
LIGHTBLUE, LIGHTRED};
char *planetNames[9] = {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus",
"Neptune", "Pluto"};
int i;

initgraph(&gd, &gm, "C:\\Turboc3\\BGI");


if (graphresult() != grOk) {
printf("Graphics Error: %s\n", grapherrormsg(graphresult()));
return;
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;

xrad[0] = 60;
yrad[0] = 30;
for (i = 1; i < 9; i++) {
xrad[i] = xrad[i - 1] + 30;
yrad[i] = yrad[i - 1] + 15;
}

// Precompute planet motion coordinates


for (i = 0; i < 9; i++) {
planetmotion(xrad[i], yrad[i], midx, midy, x[i], y[i]);
}

// Animation loop
while (!kbhit()) {
setcolor(WHITE);
for (i = 0; i < 9; i++) {
ellipse(midx, midy, 0, 360, xrad[i], yrad[i]);
}

// Draw Sun
setcolor(YELLOW);
setfillstyle(SOLID_FILL, YELLOW);
circle(midx, midy, 20);
floodfill(midx, midy, YELLOW);

// Draw "Sun" text in the center of the Sun


setcolor(BLACK);
outtextxy(midx - 10, midy - 5, "Sun");

// Set larger text style and draw "SOLAR SYSTEM"


settextstyle(1, 0, 5); // Font, direction, size
setcolor(14); // Yellow color for "SOLAR SYSTEM"
outtextxy(160, 400, "SOLAR SYSTEM");

// Reset to default text style for planet names


settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);

// Draw planets and their names


for (i = 0; i < 9; i++) {
setcolor(planetColors[i]);
setfillstyle(SOLID_FILL, planetColors[i]);
pieslice(x[i][pos[i]], y[i][pos[i]], 0, 360, planet[i]);
setcolor(WHITE);
outtextxy(x[i][pos[i]] - 20, y[i][pos[i]] - 30, planetNames[i]);
}

// Update planet positions


for (i = 0; i < 9; i++) {
pos[i] = (pos[i] <= 0) ? 59 : pos[i] - 1;
}

delay(100);
cleardevice();
}
getch();
closegraph();
}

 OUTPUT:-

You might also like