<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Graphics | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/graphics/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Fri, 02 Oct 2009 10:26:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C Program to implement Hermite curves for a given set of control points.</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-hermite-curves-for-a-given-set-of-control-points/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-hermite-curves-for-a-given-set-of-control-points/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 10:26:54 +0000</pubDate>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hermite curves in c]]></category>
		<category><![CDATA[Hermite curves]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=836</guid>

					<description><![CDATA[<p>point p1,p2;<br />
	printf("Enter 2 hermite points:\n");<br />
	scanf("%d%d%d%d",&#038;p1.x,&#038;p1.y,&#038;p2.x,&#038;p2.y);<br />
	printf("Enter the tangents at p1,p4");<br />
	scanf("%d%d",&#038;r1,&#038;r4);<br />
	cleardevice();</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-hermite-curves-for-a-given-set-of-control-points/">C Program to implement Hermite curves for a given set of control points.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="c" escaped="true" line="1">
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<stdio.h>

struct point
{
int x,y;
};

void hermite(point p1,point p4,double r1,double r4)
{
	float x,y,t;
	for(t=0.0;t<=1.0;t+=.001)
	{
		x=(2*t*t*t-3*t*t+1)*p1.x+(-2*t*t*t+3*t*t)*p4.x+(t*t*t-2*t*t+t)*r1+(t*t*t-t*t)*r4;
		y=(2*t*t*t-3*t*t+1)*p1.y+(-2*t*t*t+3*t*t)*p4.y+(t*t*t-2*t*t+1)*r1+(t*t*t-t*t)*r4;
		putpixel(x,y,YELLOW);
	 }
}

int main()
{
	int gd=DETECT,gm;
	double r1,r4;
	initgraph(&#038;gd,&#038;gm,"..//BGI");
	point p1,p2;
	printf("Enter 2 hermite points:\n");
	scanf("%d%d%d%d",&#038;p1.x,&#038;p1.y,&#038;p2.x,&#038;p2.y);
	printf("Enter the tangents at p1,p4");
	scanf("%d%d",&#038;r1,&#038;r4);
	cleardevice();
	hermite(p1,p2,r1,r4);
	putpixel(x1,y1,WHITE);
	putpixel(x2,y2,WHITE);
	getch();
	closegraph();
	return 0;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-hermite-curves-for-a-given-set-of-control-points/">C Program to implement Hermite curves for a given set of control points.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-hermite-curves-for-a-given-set-of-control-points/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>C Program to create a house and perform the operations.</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-create-a-house-and-perform-the-operations/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-create-a-house-and-perform-the-operations/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 10:14:18 +0000</pubDate>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[y = mx+c]]></category>
		<category><![CDATA[reflect]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[create a house]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=830</guid>

					<description><![CDATA[<p>C Program to create a house like figure and perform the following operations.<br />
	a. Scaling about the origin followed by translation.<br />
        b. Scaling with reference to an arbitrary point.<br />
        c. Reflect about the line y = mx + c.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-create-a-house-and-perform-the-operations/">C Program to create a house and perform the operations.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program to create a house like figure and perform the following operations.<br />
	a. Scaling about the origin followed by translation.<br />
        b. Scaling with reference to an arbitrary point.<br />
        c. Reflect about the line y = mx + c.</p>
<pre lang="c" escaped="true" line="1">
#include <stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>

void reset (int h[][2])
{
    int val[9][2] = {
			{ 50, 50 },{ 75, 50 },{ 75, 75 },{ 100, 75 },
			{ 100, 50 },{ 125, 50 },{ 125, 100 },{ 87, 125 },{ 50, 100 }
		    };
    int i;
    for (i=0; i<9; i++)
    {
	h[i][0] = val[i][0]-50;
	h[i][1] = val[i][1]-50;
    }
}
void draw (int h[][2])
{
    int i;
    setlinestyle (DOTTED_LINE, 0, 1);
    line (320, 0, 320, 480);
    line (0, 240, 640, 240);
    setlinestyle (SOLID_LINE, 0, 1);
    for (i=0; i<8; i++)
	line (320+h[i][0], 240-h[i][1], 320+h[i+1][0], 240-h[i+1][1]);
    line (320+h[0][0], 240-h[0][1], 320+h[8][0], 240-h[8][1]);
}
void rotate (int h[][2], float angle)
{
    int i;
    for (i=0; i<9; i++)
    {
	int xnew, ynew;
	xnew = h[i][0] * cos (angle) - h[i][1] * sin (angle);
	ynew = h[i][0] * sin (angle) + h[i][1] * cos (angle);
	h[i][0] = xnew; h[i][1] = ynew;
    }
}
void scale (int h[][2], int sx, int sy)
{
    int i;
    for (i=0; i<9; i++)
    {
	h[i][0] *= sx;
	h[i][1] *= sy;
    }
}
void translate (int h[][2], int dx, int dy)
{
    int i;
    for (i=0; i<9; i++)
    {
	h[i][0] += dx;
	h[i][1] += dy;
    }
}
void reflect (int h[][2], int m, int c)
{
	int i;
	float angle;
	for (i=0; i<9; i++)
		h[i][1] -= c;
	angle = M_PI/2 - atan (m);
	rotate (h, angle);
	for (i=0; i<9; i++)
		h[i][0] = -h[i][0];
	angle = -angle;
	rotate (h, angle);
	for (i=0; i<9; i++)
		h[i][1] += c;
}

void ini()
{
	int gd=DETECT,gm;
	initgraph(&#038;gd,&#038;gm,"..\\bgi");
}
void dini()
{
	getch();
	closegraph();
}
void main()
{

	int h[9][2],sx,sy,x,y,m,c,choice;
	do
	{
		clrscr();
		printf("1. Scaling about the origin.\n");
		printf("2. Scaling about an arbitrary point.\n");
		printf("3. Reflection about the line y = mx + c.\n");
		printf("4. Exit\n");
		printf("Enter the choice: ");
		scanf("%d",&#038;choice);
		switch(choice)
		{
			case 1: printf ("Enter the x- and y-scaling factors: ");
				scanf ("%d%d", &#038;sx, &#038;sy);
				ini();
				reset (h);
				draw (h);getch();
				scale (h, sx, sy);
				cleardevice();
				draw (h);
				dini();
				break;

			case 2: printf ("Enter the x- and y-scaling factors: ");
				scanf ("%d%d", &#038;sx, &#038;sy);
				printf ("Enter the x- and y-coordinates of the point: ");
				scanf ("%d%d", &#038;x, &#038;y);
				ini();
				reset (h);
				translate (h, x, y);// Go to arbitrary point
				draw(h); getch();//Show its arbitrary position
				cleardevice();
				translate(h,-x,-y);//Take it back to origin
				draw(h);
				getch();
				cleardevice();
				scale (h, sx, sy);//Now Scale it
				draw(h);
				getch();
				translate (h, x, y);//Back to Arbitrary point
				cleardevice();
				draw (h);
				putpixel (320+x, 240-y, WHITE);
				dini();
				break;

			case 3: printf ("Enter the values of m and c: ");
				scanf ("%d%d", &#038;m, &#038;c);
				ini();
				reset (h);
				draw (h); getch();
				reflect (h, m, c);
				cleardevice();
				draw (h);
				dini();
				break;
			
			case 4: exit(0);
		}
	}while(choice!=4);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-create-a-house-and-perform-the-operations/">C Program to create a house and perform the operations.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-create-a-house-and-perform-the-operations/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C Program to implement the midpoint circle drawing algorithm</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-the-midpoint-circle-drawing-algorithm/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-the-midpoint-circle-drawing-algorithm/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 10:09:47 +0000</pubDate>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[circle drawing]]></category>
		<category><![CDATA[midpoint circle]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=825</guid>

					<description><![CDATA[<p>C Program to implement the midpoint circle drawing algorithm to draw a circle. Modify the algorithm toimplement specified arc or sector.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-the-midpoint-circle-drawing-algorithm/">C Program to implement the midpoint circle drawing algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program to implement the midpoint circle drawing algorithm to draw a circle. Modify the algorithm toimplement specified arc or sector.</p>
<pre lang="c" escaped="true" line="1">
#include <graphics.h>
#include <conio.h>
#include <math.h>
#include <stdio.h>

#define PI 3.14

float startangle,endangle;
int x,y;

int Can_draw( float theta )
{
	if( theta >= startangle && theta<= endangle )
		return 1;
	return 0;
}

void Circlepoints(int x,int y,int xc,int yc)
{
	float theta;
	theta = atan( (float)y/x );
	theta = theta * (180/M_PI);
	
if( Can_draw(theta))
		putpixel(xc+x,yc-y,WHITE);
	if( Can_draw(360-theta))
		putpixel(xc+x,yc+y,WHITE);
	
if( Can_draw(90-theta))
		putpixel(xc+y,yc-x,WHITE);
	if( Can_draw(270+theta))
		putpixel(xc+y,yc+x,WHITE);
	
if( Can_draw(180-theta))
		putpixel(xc-x,yc-y,WHITE);
	if( Can_draw(180+theta))
		putpixel(xc-x,yc+y,WHITE);
	
if( Can_draw(90+theta))
		putpixel(xc-y,yc-x,WHITE);
	if( Can_draw(270-theta))
		putpixel(xc-y,yc+x,WHITE);
}

void MidPointcircle(int xc,int yc,int rad)
{
	float d = (5/4.0) - rad;
	x=0,y=rad;

	while(y>x)
	{
		if(d<0) 
 			d += 2*x+3;
		else 	
			d+=(2*x)-(2*y)+5,y--;
		x++;
		Circlepoints(x,y,xc,yc);
		delay(90);
	}
}
void main()
{
	int gd=DETECT,gm;
	int radius,xc,yc,choice,temp;
	float xstart,ystart,xend,yend;
	initgraph(&#038;gd,&#038;gm,"..\\bgi");
	do
	{
		clrscr();
		cleardevice();
		printf("\n Enter your choice\n");
		printf("\n 1.Draw a Circle\n 2.Draw a Sector\n 3.Draw an Arc\n 4.Exit\n");
		scanf("%d",&#038;choice);
		switch(choice)
		{
			case 1: printf("\n Enter the center:");
				scanf("%d %d",&#038;xc,&#038;yc);
				printf("\n Enter the radius:");
				scanf("%d",&#038;radius);
				cleardevice();
				startangle=0,endangle=360;
				MidPointcircle(xc,yc,radius);
				getch();
				break;

			case 2: printf("\n Enter the center:");
				scanf("%d %d",&#038;xc,&#038;yc);
				printf("\n Enter the radius:");
				scanf("%d",&#038;radius);
				printf("\n Enter the startangle:");
				scanf("%f",&#038;startangle);
				printf("\n Enter the endangle:");
				scanf("%f",&#038;endangle);
				cleardevice();
				if(startangle>endangle)
				{
					temp=startangle;
					startangle=endangle;
					endangle=temp;
				}
				MidPointcircle(xc,yc,radius);
				xstart=xc+radius*cos(PI/180*startangle);
				ystart=yc-radius*sin(PI/180*startangle);
				xend=xc+radius*cos(PI/180*endangle);
				yend=yc-radius*sin(PI/180*endangle);
				line(xc,yc,xstart,ystart);
				line(xc,yc,xend,yend);
				getch();
				break;

			case 3: printf("\n Enter the center:");
				scanf("%d %d",&xc,&yc);
				printf("\n Enter the radius:");
				scanf("%d",&radius);
				printf("\n Enter the startangle:");
				scanf("%f",&startangle);
				printf("\n Enter the endangle:");
				scanf("%f",&endangle);
				cleardevice();
				if(startangle>endangle)
				{
					temp=startangle;
					startangle=endangle;
					endangle=temp;
				}
				MidPointcircle(xc,yc,radius);
				getch();
				break;

		       case 4:  closegraph();
		}
	}while(choice!=4);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-the-midpoint-circle-drawing-algorithm/">C Program to implement the midpoint circle drawing algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-the-midpoint-circle-drawing-algorithm/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>C program to implement Spiral Model</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-spiral-model/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-spiral-model/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 07:59:21 +0000</pubDate>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[rings]]></category>
		<category><![CDATA[spiral model]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[initgraph]]></category>
		<category><![CDATA[c graphics]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=811</guid>

					<description><![CDATA[<p>setcolor(YELLOW);<br />
	printf("ENTER THE NUMBER OF RINGS IN THE SPIRAL MODEL\n");<br />
	scanf("%d",&#038;n);<br />
	printf("Enter the origin point of the spiral");<br />
	scanf("%d%d",&#038;x,&#038;y);</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-spiral-model/">C program to implement Spiral Model</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="c" escaped="true" line="1">
#include<graphics.h>
#include<stdio.h>
#include<conio.h>

void main()
{
	int r=5,n,i,x,y;
	int graphdriver = DETECT, graphmode;
	initgraph(&graphdriver, &graphmode, "..\\bgi");

	setcolor(YELLOW);
	printf("ENTER THE NUMBER OF RINGS IN THE SPIRAL MODEL\n");
	scanf("%d",&n);
	printf("Enter the origin point of the spiral");
	scanf("%d%d",&x,&y);
	clrscr();
	for(i=0;i<n;i++)
	{
		 arc(x,y,0,180,r=r+2);
		 arc(x+2,y,180,360,r=r+2);
	}
	getch();
	closegraph();
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-spiral-model/">C program to implement Spiral Model</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-spiral-model/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C Program to implement Kite flying</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-kite-flying/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-kite-flying/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 02:18:07 +0000</pubDate>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[initgraph]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=806</guid>

					<description><![CDATA[<p>void main()<br />
{<br />
	int gd=DETECT,gm;<br />
	int x=10,y=480;<br />
	initgraph(&#038;gd,&#038;gm,"..\\bgi");<br />
	while(!kbhit())<br />
	{<br />
		cleardevice();<br />
		if(y==0)</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-kite-flying/">C Program to implement Kite flying</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="c" escaped="true" line="1">
#include<stdio.h>
#include<time.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>

void main()
{
	int gd=DETECT,gm;
	int x=10,y=480;
	initgraph(&gd,&gm,"..\\bgi");
	while(!kbhit())
	{
		cleardevice();
		if(y==0)
		{
			y=random(480);
			x=random(640);
		}
		else
		{
			y=y-1;
			x=x+1;
			line(x-50,y,x,y-70);
			line(x,y-70,x+50,y);
			line(x+50,y,x,y+70);
			line(x,y+70,x-50,y);
			line(x,y-70,x,y+70);
			line(x,y+70,x+10,y+140);
			line(x,y+70,x-10,y+140);
			line(x-50,y,x+50,y);
			line(x,y,x+130,y+640);
		}
		delay(20);
	}
	closegraph();
	restorecrtmode();
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-kite-flying/">C Program to implement Kite flying</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/graphics/c-program-to-implement-kite-flying/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
