<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7024532010084688924</id><updated>2024-09-14T20:54:30.379-07:00</updated><category term="data structure"/><category term="Numerical Analysis C Program"/><category term="C Programming"/><category term="C Graphics"/><category term="c++"/><category term="my stuff"/><category term="Java programming"/><title type='text'>C, C++, Java, Data Structure, Numerical Analysis Programming</title><subtitle type='html'>Hi, this is the blog for programs in different programming languages designd by me. the all programs are original and not copied from any where.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>78</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-9057966600616648596</id><published>2011-10-23T09:52:00.000-07:00</published><updated>2011-10-23T09:54:46.156-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>Continuous distribution(weibull,uniform,triangle) implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;math.h&amp;gt;&lt;br /&gt;
void triangular();&lt;br /&gt;
void weibull();&lt;br /&gt;
void lognormal();&lt;br /&gt;
void uniform();&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;int c;&lt;br /&gt;
&amp;nbsp;clrscr();&lt;br /&gt;
&amp;nbsp;printf(&quot;choose distribution system:&quot;);&lt;br /&gt;
&amp;nbsp;printf(&quot;\n1:Triangular distribution&quot;);&lt;br /&gt;
&amp;nbsp;printf(&quot;\n2:Weibull distribution &quot;);&lt;br /&gt;
&amp;nbsp;printf(&quot;\n3:Lognormal distribution&quot;);&lt;br /&gt;
&amp;nbsp;printf(&quot;\n4:Uniform distribution&quot;);&lt;br /&gt;
&amp;nbsp;printf(&quot;enter ur choice:&quot;);&lt;br /&gt;
&amp;nbsp;scanf(&quot;%d&quot;,&amp;amp;c);&lt;br /&gt;
&amp;nbsp;clrscr();&lt;br /&gt;
&amp;nbsp;switch(c)&lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;case 1:&lt;br /&gt;
&amp;nbsp;triangular();&lt;br /&gt;
&amp;nbsp;break;&lt;br /&gt;
&amp;nbsp;case 2:&lt;br /&gt;
&amp;nbsp;weibull();&lt;br /&gt;
&amp;nbsp;break;&lt;br /&gt;
&amp;nbsp;case 3:&lt;br /&gt;
&amp;nbsp;normal();&lt;br /&gt;
&amp;nbsp;break;&lt;br /&gt;
&amp;nbsp;case 4:&lt;br /&gt;
&amp;nbsp;uniform();&lt;br /&gt;
&amp;nbsp;break;&lt;br /&gt;
&amp;nbsp;default:&lt;br /&gt;
&amp;nbsp;printf(&quot;invalid selection&quot;);&lt;br /&gt;
&amp;nbsp;exit(0);&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;getch();&lt;br /&gt;
}&lt;br /&gt;
void triangular()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;double x,a,b,c;&lt;br /&gt;
&amp;nbsp;printf(&quot;enter d value of x, a, b &amp;amp; c:&amp;nbsp; &quot;);&lt;br /&gt;
scanf(&quot; %lf %lf %lf %lf&quot;,&amp;amp;x, &amp;amp;a, &amp;amp;b, &amp;amp;c);&lt;br /&gt;
&lt;br /&gt;
printf(&quot; f(%.2f) = %f&quot;,x,f(x,a,b,c));&lt;br /&gt;
&lt;br /&gt;
printf(&quot; F(%.2f) = %f&quot;,x,F(x,a,b,c));&lt;br /&gt;
double f(double x, double a, double b, double c)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if(a &amp;lt;= x &amp;amp;&amp;amp; x &amp;lt;= b)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
return (2*(x-a))/((b-a)*(c-a));&lt;br /&gt;
}&lt;br /&gt;
else if( b &amp;lt; x &amp;amp;&amp;amp; x &amp;lt;= c)&lt;br /&gt;
{&lt;br /&gt;
return 2*(c-x)/((c-b)*(c-a));&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
return 0;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double F(double x, double a, double b, double c)&lt;br /&gt;
{&lt;br /&gt;
if(x&amp;lt;=a)&lt;br /&gt;
return 0;&lt;br /&gt;
&lt;br /&gt;
else if( a&lt;x &amp;amp;&amp;amp;=&quot;&quot; x&lt;=&quot;b)&amp;lt;br&quot;&gt;{&lt;br /&gt;&lt;br /&gt;return ( (x-a)*(x-a)/((b-a)*(c-a)) );&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;else if(b &amp;lt; x &amp;amp;&amp;amp; x &amp;lt;= c )&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;return (1 - (c-x)*(c-x)/((c-b)*(c-a)));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;else if(x&amp;gt;c)&lt;br /&gt;return 1;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void weibull()&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;double v,a,b;&lt;br /&gt;printf(&quot;enter d value of x, location, shape &amp;amp; scale:&amp;nbsp; &quot;);&lt;br /&gt;scanf(&quot; %d %lf %lf %lf&quot;,&amp;amp;x, &amp;amp;v, &amp;amp;b, &amp;amp;a);&lt;br /&gt;&lt;br /&gt;printf(&quot; f(%d) = %f&quot;,x,f(x,v,a,b));&lt;br /&gt;&lt;br /&gt;printf(&quot; F(%d) = %f&quot;,x,F(x,v,a,b));&lt;br /&gt;double f(int x, double v, double a, double b)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if(x&amp;lt; v)&lt;br /&gt;return 0;&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return b/a*(pow((x-v)/a,b-1))*exp(-pow((x-v)/a,b));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;double F(int x, double v, double a, double b)&lt;br /&gt;{&lt;br /&gt;if(x&lt;v)&lt;br&gt;return 0;&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;return (1 - exp(-pow((x-v)/a,b)));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;void lognormal()&lt;br /&gt;{&lt;br /&gt;int sigma,x,u;&lt;br /&gt;printf(&quot;enter sigma,x,u&quot;);&lt;br /&gt;scanf(&quot;%d%d%d&quot;,&amp;amp;sigma,&amp;amp;x,&amp;amp;u);&lt;br /&gt;if(x&amp;gt;0)&lt;br /&gt;printf(&quot;pdf=%.3lf&quot;,(1/(sqrt(2*PI)*sigma*x))*exp(-pow((log(x)-u),2)/(2*sigma*sigma)));&lt;br /&gt;}&lt;br /&gt;void uniform()&lt;br /&gt;{&lt;br /&gt;int a,x,b;&lt;br /&gt;printf(&quot;enter the value for a,x,b:&quot;);&lt;br /&gt;scanf(&quot;%d%d%d&quot;,&amp;amp;a,&amp;amp;x,&amp;amp;b);&lt;br /&gt;printf(&quot; f(%d) = %f&quot;,x,f(x,a,b));&lt;br /&gt;&lt;br /&gt;printf(&quot; F(%d) = %f&quot;,x,F(x,a,b));&lt;br /&gt;double f(int x, double v, double a, double b)&lt;br /&gt;{&lt;br /&gt;if(a&amp;lt;=x &amp;amp;&amp;amp; x&amp;lt;=b)&lt;br /&gt;return (1/(b-a));&lt;br /&gt;else &lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;double F(int x, double v, double a, double b)&lt;br /&gt;{&lt;br /&gt;if(x&lt;a) &lt;br=&quot;&quot;&gt;return 0;&lt;br /&gt;else if(a&amp;lt;=x &amp;amp;&amp;amp; x&lt;b)&lt;br&gt;return((x-a)/(b-a));&lt;br /&gt;else if(x&amp;gt;=b)&lt;br /&gt;return 1;&lt;br /&gt;}&lt;br /&gt;}&lt;/b)&lt;br&gt;&lt;/a)&gt;&lt;/v)&lt;br&gt;&lt;/x&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/9057966600616648596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/continuous-distribution-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/9057966600616648596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/9057966600616648596'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/continuous-distribution-implementation.html' title='Continuous distribution(weibull,uniform,triangle) implementation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-7074939847703699323</id><published>2011-10-20T07:13:00.000-07:00</published><updated>2011-10-20T07:14:56.240-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>Bernouli distribution implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void bernouli()&lt;br /&gt;
{&lt;br /&gt;
double p;&lt;br /&gt;
printf(&quot;bernouli distribution implementation:\n&quot;);&lt;br /&gt;
printf(&quot;enter success probability&quot;);&lt;br /&gt;
scanf(&quot;%lf&quot;,&amp;amp;p);&lt;br /&gt;
printf(&quot;\nmean =%.3lf&quot;,p);&lt;br /&gt;
printf(&quot;\tvariance =%.3lf&quot;,p*(1-p));&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/7074939847703699323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/bernouli-distribution-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7074939847703699323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7074939847703699323'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/bernouli-distribution-implementation.html' title='Bernouli distribution implementation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-3209771724043717688</id><published>2011-10-20T07:11:00.001-07:00</published><updated>2011-10-20T07:11:47.989-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>Poisson distribution implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void poisson()&lt;br /&gt;
{&lt;br /&gt;
int x;&lt;br /&gt;
double a;&lt;br /&gt;
printf(&quot;poisson distribution implementation:\n&quot;);&lt;br /&gt;
printf(&quot;enter x &amp;amp; a:&quot;);&lt;br /&gt;
scanf(&quot;%d%lf&quot;,&amp;amp;x,&amp;amp;a);&lt;br /&gt;
if(x&amp;gt;0)&lt;br /&gt;
printf(&quot;pmf=%.3lf&quot;,(exp(-a)*pow(a,x))/fact(x));&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/3209771724043717688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/poisson-distribution-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3209771724043717688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3209771724043717688'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/poisson-distribution-implementation.html' title='Poisson distribution implementation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-8984099794591065088</id><published>2011-10-20T06:29:00.000-07:00</published><updated>2011-10-20T06:29:44.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>Binomial distribution implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void binomial()&lt;br /&gt;
{&lt;br /&gt;
int n,x;&lt;br /&gt;
double p;&lt;br /&gt;
printf(&quot;binomial distribution implementation:\n&quot;);&lt;br /&gt;
printf(&quot;enter n,x,p&quot;);&lt;br /&gt;
scanf(&quot;%d%d%lf&quot;,&amp;amp;n,&amp;amp;x,&amp;amp;p);&lt;br /&gt;
if(x&amp;gt;0)&lt;br /&gt;
printf(&quot;\npmf=%.3lf&quot;,(fact(n)/(fact(x)*fact(n-x)))*pow(p,x)*pow((1-p),(n-x)));&lt;br /&gt;
printf(&quot;\nmean=%.3lf \t variance=%.3lf&quot;,n*p,n*p*(1-p));&lt;br /&gt;
}&lt;br /&gt;
void neg_binomial()&lt;br /&gt;
{&lt;br /&gt;
int y,k;&lt;br /&gt;
double p;&lt;br /&gt;
printf(&quot;negative binomial distribution:\n&quot;);&lt;br /&gt;
printf(&quot;enter y,k and p for kth success (y&amp;gt;k)&quot;);&lt;br /&gt;
scanf(&quot;%d%d%lf&quot;,&amp;amp;y,&amp;amp;k,&amp;amp;p);&lt;br /&gt;
if(y&amp;gt;k)&lt;br /&gt;
printf(&quot;pmf=%.3lf&quot;,(fact(y-1)/(fact(k-1)*fact(y-k)))*pow((1-p),(y-k))*pow(p,k));&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/8984099794591065088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/binomial-distribution-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/8984099794591065088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/8984099794591065088'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/binomial-distribution-implementation.html' title='Binomial distribution implementation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-6997915388651216956</id><published>2011-10-17T07:14:00.000-07:00</published><updated>2011-10-17T07:15:00.508-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Line clipping of right boundary only using Liang Barsky algo</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
#include&amp;lt;graphics.h&amp;gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int x1,y1,x2,y2,x,y,dx,dy;&lt;br /&gt;int xmin,xmax,ymin,ymax;&lt;br /&gt;float u,p,q;&lt;br /&gt;int gd=DETECT,gm;&lt;br /&gt;initgraph(&amp;amp;gd,&amp;amp;gm,&quot;c:\\tc&quot;);&lt;br /&gt;xmin=ymin=100;&lt;br /&gt;xmax=ymax=300;&lt;br /&gt;x1=150;y1=150; x2=350; y2=200;&lt;br /&gt;rectangle(xmin,ymin,xmax,ymax);&lt;br /&gt;line(x1,y1,x2,y2);&lt;br /&gt;u=(float)(xmax-x1)/(x2-x1);&lt;br /&gt;dx=x2-x1;&lt;br /&gt;dy=y2-y1;&lt;br /&gt;x=x1+(int)(dx*u);&lt;br /&gt;y=y1+(int)(dy*u);&lt;br /&gt;getch();&lt;br /&gt;cleardevice();&lt;br /&gt;rectangle(xmin,ymin,xmax,ymax);&lt;br /&gt;line(x1,y1,x,y);&lt;br /&gt;getch();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/6997915388651216956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/c-graphics-line-clipping-of-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6997915388651216956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6997915388651216956'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/c-graphics-line-clipping-of-right.html' title='C Graphics : Line clipping of right boundary only using Liang Barsky algo'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-1094559973891769953</id><published>2011-10-16T04:50:00.000-07:00</published><updated>2011-10-16T04:53:50.442-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Shearing in 2D transformation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void shearing(int *x,int *y,double shx,double shy)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
double trans[3][3]={1,0,0,0,1,0,0,0,1};&lt;br /&gt;
&lt;br /&gt;
double a[3][1]={0,0,1};&lt;br /&gt;
&lt;br /&gt;
double c[3][1];&lt;br /&gt;
&lt;br /&gt;
int i,j,k;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
trans[0][1]=shx;&lt;br /&gt;
&lt;br /&gt;
trans[1][0]=shy;&lt;br /&gt;
&lt;br /&gt;
a[0][0]=*x;&lt;br /&gt;
&lt;br /&gt;
a[0][1]=*y;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;3;i++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
for(j=0;j&amp;lt;1;j++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]=0;&lt;br /&gt;
&lt;br /&gt;
for(k=0;k&amp;lt;3;k++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]+=trans[i][k]*a[k][j];&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*x=c[0][0];&lt;br /&gt;
&lt;br /&gt;
*y=c[1][0];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/1094559973891769953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/c-graphics-shearing-in-2d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/1094559973891769953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/1094559973891769953'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/c-graphics-shearing-in-2d.html' title='C Graphics : Shearing in 2D transformation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-7323877685250878030</id><published>2011-10-16T04:46:00.001-07:00</published><updated>2011-10-16T04:47:36.418-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Scaling in 2D transformation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void scale(int *x,int *y,double sx,double sy)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
double trans[3][3]={1,0,0,0,1,0,0,0,1};&lt;br /&gt;
&lt;br /&gt;
double a[3][1]={0,0,1};&lt;br /&gt;
&lt;br /&gt;
double c[3][1];&lt;br /&gt;
&lt;br /&gt;
int i,j,k;&lt;br /&gt;
&lt;br /&gt;
trans[0][0]=sx;&lt;br /&gt;
&lt;br /&gt;
trans[1][1]=sy;&lt;br /&gt;
&lt;br /&gt;
a[0][0]=*x;&lt;br /&gt;
&lt;br /&gt;
a[0][1]=*y;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;3;i++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
for(j=0;j&amp;lt;1;j++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]=0;&lt;br /&gt;
&lt;br /&gt;
for(k=0;k&amp;lt;3;k++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]+=trans[i][k]*a[k][j];&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*x=c[0][0];&lt;br /&gt;
&lt;br /&gt;
*y=c[1][0];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/7323877685250878030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-scaleint-xint-ydouble-sxdouble-sy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7323877685250878030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7323877685250878030'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-scaleint-xint-ydouble-sxdouble-sy.html' title='C Graphics : Scaling in 2D transformation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-3820845131830892639</id><published>2011-10-16T04:45:00.001-07:00</published><updated>2011-10-16T04:46:00.619-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Rotation in 2D transformation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void rotate(int *x,int *y,double th)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
double trans[3][3]={1,0,0,0,1,0,0,0,1};&lt;br /&gt;
&lt;br /&gt;
double a[3][1]={0,0,1};&lt;br /&gt;
&lt;br /&gt;
double c[3][1];&lt;br /&gt;
&lt;br /&gt;
int i,j,k;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
th=th*M_PI/180;&lt;br /&gt;
&lt;br /&gt;
trans[0][0]=cos(th);&lt;br /&gt;
&lt;br /&gt;
trans[0][1]=-sin(th);&lt;br /&gt;
&lt;br /&gt;
trans[1][0]=sin(th);&lt;br /&gt;
&lt;br /&gt;
trans[1][1]=cos(th);&lt;br /&gt;
&lt;br /&gt;
a[0][0]=*x;&lt;br /&gt;
&lt;br /&gt;
a[1][0]=*y;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;3;i++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
for(j=0;j&amp;lt;1;j++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]=0;&lt;br /&gt;
&lt;br /&gt;
for(k=0;k&amp;lt;3;k++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]+=trans[i][k]*a[k][j];&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*x=abs(c[0][0]);&lt;br /&gt;
&lt;br /&gt;
*y=abs(c[1][0]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/3820845131830892639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-rotateint-xint-ydouble-th-double.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3820845131830892639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3820845131830892639'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-rotateint-xint-ydouble-th-double.html' title='C Graphics : Rotation in 2D transformation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-2016232548629324248</id><published>2011-10-16T04:39:00.001-07:00</published><updated>2011-10-16T04:43:29.769-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Translation in 2D transformation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void transalate(int *x,int *y,int tx,int ty)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int trans[3][3]={1,0,0,0,1,0,0,0,1};&lt;br /&gt;
&lt;br /&gt;
int a[3][1]={0,0,1};&lt;br /&gt;
&lt;br /&gt;
int c[3][1];&lt;br /&gt;
&lt;br /&gt;
int i,j,k;&lt;br /&gt;
&lt;br /&gt;
trans[0][2]=tx;&lt;br /&gt;
&lt;br /&gt;
trans[1][2]=ty;&lt;br /&gt;
&lt;br /&gt;
a[0][0]=*x;&lt;br /&gt;
&lt;br /&gt;
a[0][1]=*y;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;3;i++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
for(j=0;j&amp;lt;1;j++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]=0;&lt;br /&gt;
&lt;br /&gt;
for(k=0;k&amp;lt;3;k++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c[i][j]+=trans[i][k]*a[k][j];&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*x=c[0][0];&lt;br /&gt;
&lt;br /&gt;
*y=c[1][0];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/2016232548629324248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-transalateint-xint-yint-txint-ty.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2016232548629324248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2016232548629324248'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/10/void-transalateint-xint-yint-txint-ty.html' title='C Graphics : Translation in 2D transformation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-8953409280326723987</id><published>2011-09-12T10:47:00.000-07:00</published><updated>2011-09-12T10:51:07.832-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Flood Fill Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
void flood_fill(int x,int y,int fc,int bc)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int color=getpixel(x,y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(color==bc)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; putpixel(x,y,12);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;flood_fill(x,y+1,fc,bc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;flood_fill(x+1,y,fc,bc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;flood_fill(x,y-1,fc,bc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;flood_fill(x-1,y,fc,bc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/8953409280326723987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/void-floodfillint-xint-yint-fcint-bc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/8953409280326723987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/8953409280326723987'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/void-floodfillint-xint-yint-fcint-bc.html' title='C Graphics : Flood Fill Function'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-5291359947737039968</id><published>2011-09-12T10:01:00.000-07:00</published><updated>2011-09-12T10:03:57.784-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Ellipse Generation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void midpoint_ellipse(int xaxis,int yaxis,int a,int b)&lt;br /&gt;
{&lt;br /&gt;
int x=0,y=b;&lt;br /&gt;
int aa=a*a,bb=b*b;&lt;br /&gt;
int aa2=2*a*a,bb2=2*b*b;&lt;br /&gt;
&lt;br /&gt;
float p=b*b-a*a*b+0.25*a*a;&lt;br /&gt;
&lt;br /&gt;
draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
while(bb2*x&amp;lt;=aa2*y)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
x++;&lt;br /&gt;
if(p&amp;lt;=0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p=p+bb2*x+bb;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y--;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p=p+bb2*x+bb-aa2*y;&lt;br /&gt;
}&lt;br /&gt;
draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
x=-x;&lt;br /&gt;
draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
x=-x;&lt;br /&gt;
&lt;br /&gt;
}//end while&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
x=a;&lt;br /&gt;
y=0;&lt;br /&gt;
draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
p=aa+bb2*a+bb*0.25;&lt;br /&gt;
//p=bb*(x+0.5)*(x+0.5)+aa*(y-1)*(y-1)-aa*bb;&lt;br /&gt;
&lt;br /&gt;
while(bb2*x&amp;gt;aa2*y) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;//fy=fy-aa2;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(p&amp;gt;0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p=p+aa-aa2*y;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;x--;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p=p+bb2*x-aa2*y+aa;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y=-y;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;draw_ellipse(xaxis,yaxis,x,y);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y=-y;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void draw_ellipse(int xaxis,int yaxis,int x,int y)&lt;br /&gt;
{&lt;br /&gt;
putpixel(xaxis+x,yaxis+y,4);&lt;br /&gt;
putpixel(xaxis-x,yaxis+y,4);&lt;br /&gt;
putpixel(xaxis+x,yaxis-y,4);&lt;br /&gt;
putpixel(xaxis-x,yaxis-y,4);&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/5291359947737039968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-ellipse-generation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/5291359947737039968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/5291359947737039968'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-ellipse-generation.html' title='C Graphics : Ellipse Generation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-4133244336134750846</id><published>2011-09-10T10:34:00.001-07:00</published><updated>2011-09-10T10:49:07.907-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : DDA Line Draw</title><content type='html'>#include &amp;lt;graphics.h&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;conio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;void dda_line(int x1,int y1,int x2,int y2);&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;   /* request auto detection */&lt;br /&gt;   int gdriver = DETECT, gmode, errorcode;&lt;br /&gt;&lt;br /&gt;   /* initialize graphics mode */&lt;br /&gt;   initgraph(&amp;gdriver, &amp;gmode, &quot;c:\\tc&quot;);&lt;br /&gt;&lt;br /&gt;   /* read result of initialization */&lt;br /&gt;   errorcode = graphresult();&lt;br /&gt;&lt;br /&gt;   if (errorcode != grOk)  /* an error occurred */&lt;br /&gt;   {&lt;br /&gt;      printf(&quot;Graphics error: %s\n&quot;, grapherrormsg(errorcode));&lt;br /&gt;      printf(&quot;Press any key to halt:&quot;);&lt;br /&gt;      getch();&lt;br /&gt;      exit(1);             /* return with error code */&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   getch();&lt;br /&gt;   return(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void dda_line(int x1,int y1,int x2,int y2)&lt;br /&gt;{&lt;br /&gt;int dx,dy,step;&lt;br /&gt;float x,y,ix,iy;&lt;br /&gt;dx=x2-x1;&lt;br /&gt;dy=y2-y1;&lt;br /&gt;&lt;br /&gt;if(abs(dx)&gt;abs(dy))&lt;br /&gt; step=abs(dx);&lt;br /&gt;else&lt;br /&gt; step=abs(dy);&lt;br /&gt;&lt;br /&gt;ix=dx/(float)step;&lt;br /&gt;iy=dy/(float)step;&lt;br /&gt;&lt;br /&gt;x=x1;&lt;br /&gt;y=y1;&lt;br /&gt;putpixel(x,y,1);&lt;br /&gt;while(step--&gt;0)&lt;br /&gt;{&lt;br /&gt; x=x+ix;&lt;br /&gt; y=y+iy;&lt;br /&gt;&lt;br /&gt; putpixel(x,y,1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/4133244336134750846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-dda-line-draw.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/4133244336134750846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/4133244336134750846'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-dda-line-draw.html' title='C Graphics : DDA Line Draw'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-2094116919269231689</id><published>2011-09-10T10:10:00.000-07:00</published><updated>2011-09-11T08:44:03.740-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Graphics"/><title type='text'>C Graphics : Mid-Point Circle Draw</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;graphics.h&amp;gt;&lt;br /&gt;
#include &amp;lt;conio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void draw_circle(int,int,int);&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int gd=DETECT,gm;&lt;br /&gt;
int r;&lt;br /&gt;
int xcen,ycen;&lt;br /&gt;
initgraph(&amp;amp;gd,&amp;amp;gm,&quot;c:\\tc\\&quot;);&lt;br /&gt;
&lt;br /&gt;
//clrscr();&lt;br /&gt;
printf(&quot;enter radius :&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;r);&lt;br /&gt;
printf(&quot;enter circle centre coordinate :&quot;);&lt;br /&gt;
scanf(&quot;%d%d&quot;,&amp;amp;xcen,&amp;amp;ycen);&lt;br /&gt;
&lt;br /&gt;
draw_circle(xcen,ycen,r);&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
void draw_circle(int xcen,int ycen,int r)&lt;br /&gt;
{&lt;br /&gt;
int x,y,p;&lt;br /&gt;
x=0;&lt;br /&gt;
y=r;&lt;br /&gt;
p=1-r;&lt;br /&gt;
putpixel(xcen+x,ycen+y,12);&lt;br /&gt;
putpixel(xcen-x,ycen+y,12);&lt;br /&gt;
putpixel(xcen+x,ycen-y,12);&lt;br /&gt;
putpixel(xcen-x,ycen-y,12);&lt;br /&gt;
putpixel(xcen+y,ycen+x,12);&lt;br /&gt;
putpixel(xcen+y,ycen-x,12);&lt;br /&gt;
putpixel(xcen-y,ycen+x,12);&lt;br /&gt;
putpixel(xcen-y,ycen+x,12);&lt;br /&gt;
while(x&amp;lt;=y)&lt;br /&gt;
{&lt;br /&gt;
if(p&amp;lt;0)&lt;br /&gt;
p=p+2*x+1;&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
p=p+2*(x-y)+1;&lt;br /&gt;
y--;&lt;br /&gt;
}&lt;br /&gt;
x++;&lt;br /&gt;
putpixel(xcen+x,ycen+y,10);&lt;br /&gt;
putpixel(xcen-x,ycen+y,11);&lt;br /&gt;
putpixel(xcen+x,ycen-y,12);&lt;br /&gt;
putpixel(xcen-x,ycen-y,11);&lt;br /&gt;
putpixel(xcen+y,ycen+x,14);&lt;br /&gt;
putpixel(xcen+y,ycen-x,11);&lt;br /&gt;
putpixel(xcen-y,ycen-x,13);&lt;br /&gt;
putpixel(xcen-y,ycen+x,11);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/2094116919269231689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-mid-point-circle-draw.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2094116919269231689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2094116919269231689'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2011/09/c-graphics-mid-point-circle-draw.html' title='C Graphics : Mid-Point Circle Draw'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-2205185331793019198</id><published>2010-10-31T03:39:00.000-07:00</published><updated>2010-10-31T03:45:16.572-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java programming"/><title type='text'>Java Programming - Calculator in swing</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVD3NiBPoEVrFFRBmQrQfFhOgB35qvGeu7Ohp66JzmzeY4r2zDhUzRfRjUehQNPbYFmBXdHQbksuiebySrolnXNQ7ksYoj_8_ZXtKBfBWCGIqnc70kcM9y5kiDRKv5C5wrJedZrLJEz2o/s1600/untitled.JPG&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 321px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVD3NiBPoEVrFFRBmQrQfFhOgB35qvGeu7Ohp66JzmzeY4r2zDhUzRfRjUehQNPbYFmBXdHQbksuiebySrolnXNQ7ksYoj_8_ZXtKBfBWCGIqnc70kcM9y5kiDRKv5C5wrJedZrLJEz2o/s400/untitled.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5534158620890123378&quot; /&gt;&lt;/a&gt;&lt;br /&gt;.......................................................&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;public class GuiCalculator &lt;br /&gt;{&lt;br /&gt;String o=&quot;+&quot;;&lt;br /&gt;double d1=0.0,d2=0.0;&lt;br /&gt;&lt;br /&gt;JFrame jf;&lt;br /&gt;Container c;&lt;br /&gt;JTextField tf;&lt;br /&gt;JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17;&lt;br /&gt;public GuiCalculator()&lt;br /&gt;{&lt;br /&gt;jf=new JFrame(&quot;Calculator&quot;);&lt;br /&gt;jf.setSize(400,500);&lt;br /&gt;jf.setResizable(false);&lt;br /&gt;&lt;br /&gt;jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;tf=new JTextField(&quot;&quot;,12);&lt;br /&gt;&lt;br /&gt;c=jf.getContentPane();&lt;br /&gt;//GridBagLayout gb=new GridBagLayout();&lt;br /&gt;//gb.addLayoutComponent(tf);&lt;br /&gt;c.setLayout(null);&lt;br /&gt;tf.setColumns(12); &lt;br /&gt;tf.setHorizontalAlignment(JTextField.RIGHT);&lt;br /&gt;tf.setFont(new Font(&quot;Font.TIMESNEWROMAN&quot;,Font.BOLD,36));&lt;br /&gt;c.add(tf);&lt;br /&gt;b1=new JButton(&quot;1&quot;);&lt;br /&gt;b2=new JButton(&quot;2&quot;);&lt;br /&gt;b3=new JButton(&quot;3&quot;);&lt;br /&gt;b4=new JButton(&quot;4&quot;);&lt;br /&gt;b5=new JButton(&quot;5&quot;);&lt;br /&gt;b6=new JButton(&quot;6&quot;);&lt;br /&gt;b7=new JButton(&quot;7&quot;);&lt;br /&gt;b8=new JButton(&quot;8&quot;);&lt;br /&gt;b9=new JButton(&quot;9&quot;);&lt;br /&gt;b10=new JButton(&quot;0&quot;);&lt;br /&gt;b11=new JButton(&quot;.&quot;);&lt;br /&gt;b12=new JButton(&quot;=&quot;);&lt;br /&gt;b13=new JButton(&quot;+&quot;);&lt;br /&gt;b14=new JButton(&quot;-&quot;);&lt;br /&gt;b15=new JButton(&quot;x&quot;);&lt;br /&gt;b16=new JButton(&quot;/&quot;);&lt;br /&gt;b17=new JButton(&quot;&quot;);&lt;br /&gt;tf.setBounds(20,10,330,50);&lt;br /&gt;b1.setBounds(10,120,60,35);&lt;br /&gt;b2.setBounds(110,120,60,35);&lt;br /&gt;b3.setBounds(210,120,60,35);&lt;br /&gt;b4.setBounds(310,120,60,35);&lt;br /&gt;b5.setBounds(10,220,60,35);&lt;br /&gt;b6.setBounds(110,220,60,35);&lt;br /&gt;b7.setBounds(210,220,60,35);&lt;br /&gt;b8.setBounds(310,220,60,35);&lt;br /&gt;b9.setBounds(10,320,60,35);&lt;br /&gt;b10.setBounds(110,320,60,35);&lt;br /&gt;b11.setBounds(210,320,60,35);&lt;br /&gt;b12.setBounds(310,320,60,35);&lt;br /&gt;b13.setBounds(10,420,60,35);&lt;br /&gt;b14.setBounds(110,420,60,35);&lt;br /&gt;b15.setBounds(210,420,60,35);&lt;br /&gt;b16.setBounds(310,420,60,35);&lt;br /&gt;b17.setBounds(310,420,60,35);&lt;br /&gt;&lt;br /&gt;//c.setLayout(new GridLayout(4,4));&lt;br /&gt;b1.addActionListener(new Perform());&lt;br /&gt;b2.addActionListener(new Perform());&lt;br /&gt;b3.addActionListener(new Perform());&lt;br /&gt;b4.addActionListener(new Perform());&lt;br /&gt;b5.addActionListener(new Perform());&lt;br /&gt;b6.addActionListener(new Perform());&lt;br /&gt;b7.addActionListener(new Perform());&lt;br /&gt;b8.addActionListener(new Perform());&lt;br /&gt;b9.addActionListener(new Perform());&lt;br /&gt;b10.addActionListener(new Perform());&lt;br /&gt;b11.addActionListener(new Perform());&lt;br /&gt;b12.addActionListener(new Perform());&lt;br /&gt;b13.addActionListener(new Perform());&lt;br /&gt;b14.addActionListener(new Perform());&lt;br /&gt;b15.addActionListener(new Perform());&lt;br /&gt;b16.addActionListener(new Perform());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;c.add(b1);&lt;br /&gt;c.add(b2);&lt;br /&gt;c.add(b3);&lt;br /&gt;c.add(b4);&lt;br /&gt;c.add(b5);&lt;br /&gt;c.add(b6);&lt;br /&gt;c.add(b7);&lt;br /&gt;c.add(b8);&lt;br /&gt;c.add(b9);&lt;br /&gt;c.add(b10);&lt;br /&gt;c.add(b11);&lt;br /&gt;c.add(b12);&lt;br /&gt;c.add(b13);&lt;br /&gt;c.add(b14);&lt;br /&gt;c.add(b15);&lt;br /&gt;c.add(b16);&lt;br /&gt;c.add(b17);&lt;br /&gt;jf.setVisible(true);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Perform implements ActionListener&lt;br /&gt;{&lt;br /&gt;//String o=&quot;+&quot;;&lt;br /&gt;//double d1=0.0,d2=0.0;&lt;br /&gt; &lt;br /&gt;public void actionPerformed(ActionEvent e)&lt;br /&gt;{&lt;br /&gt;String s=e.getActionCommand();&lt;br /&gt;int j=-1;&lt;br /&gt;if(Character.isDigit(s.charAt(0)))&lt;br /&gt;j=Integer.parseInt(s);&lt;br /&gt;for(int i=0;i&amp;lt;=9;i++)&lt;br /&gt;if(i==j)&lt;br /&gt;tf.setText(tf.getText()+s);&lt;br /&gt;if((s.equals(&quot;+&quot;))||(s.equals(&quot;-&quot;))||(s.equals(&quot;x&quot;))||(s.equals(&quot;/&quot;)))&lt;br /&gt;{&lt;br /&gt;if(!(tf.getText().equals(&quot;&quot;)))&lt;br /&gt;d1=Double.parseDouble(tf.getText());&lt;br /&gt;o=s;&lt;br /&gt;tf.setText(&quot;&quot;);&lt;br /&gt;}&lt;br /&gt;if(s.equals(&quot;=&quot;))&lt;br /&gt;{&lt;br /&gt;d2=Double.parseDouble(tf.getText());&lt;br /&gt;if(o.equals(&quot;+&quot;))&lt;br /&gt;tf.setText(String.valueOf(d1+d2));&lt;br /&gt;if(o.equals(&quot;-&quot;))&lt;br /&gt;tf.setText(String.valueOf(d1-d2));&lt;br /&gt;if(o.equals(&quot;x&quot;))&lt;br /&gt;tf.setText(String.valueOf(d1*d2));&lt;br /&gt;if(o.equals(&quot;/&quot;))&lt;br /&gt;tf.setText(String.valueOf(d1/d2));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;GuiCalculator gui=new GuiCalculator();&lt;br /&gt;}&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/2205185331793019198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/10/java-programming-calculator-in-swing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2205185331793019198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2205185331793019198'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/10/java-programming-calculator-in-swing.html' title='Java Programming - Calculator in swing'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVD3NiBPoEVrFFRBmQrQfFhOgB35qvGeu7Ohp66JzmzeY4r2zDhUzRfRjUehQNPbYFmBXdHQbksuiebySrolnXNQ7ksYoj_8_ZXtKBfBWCGIqnc70kcM9y5kiDRKv5C5wrJedZrLJEz2o/s72-c/untitled.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-6411031682218600544</id><published>2010-10-07T11:49:00.000-07:00</published><updated>2010-11-12T07:30:23.123-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="my stuff"/><title type='text'>my stuff - welcome to amrendra world</title><content type='html'>&lt;font color=&quot;cyan&quot;&gt;&lt;marquee bgcolor=&quot;orange&quot; vspace=0&gt;&lt;/marquee&gt;&lt;br /&gt;&lt;marquee bgcolor=&quot;&quot; vspace=0&gt;****************************************&lt;/marquee&gt;&lt;br /&gt;&lt;marquee bgcolor=&quot;green&quot; vspace=0&gt;&lt;/marquee&gt;&lt;br /&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dz9lkmC75SS1Zi43B0zwZL1nJTcWEcxKWEcv2hHha--Lk3x8_XjLPcbsUm7u7n8HBxEwC9hkH6y5FM05FMmRw&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;marquee bgcolor=&quot;orange&quot; &gt;&lt;/marquee&gt;&lt;br /&gt;&lt;marquee bgcolor=&quot;&quot; color=&quot;cyan&quot; &gt;cwg hockey match and me&lt;/marquee&gt;&lt;br /&gt;&lt;marquee bgcolor=&quot;green&quot; &gt;&lt;/marquee&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/6411031682218600544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/10/my-stuff-cwg-delhi-hockey-match-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6411031682218600544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6411031682218600544'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/10/my-stuff-cwg-delhi-hockey-match-video.html' title='my stuff - welcome to amrendra world'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-2852789043451112334</id><published>2010-08-19T07:16:00.002-07:00</published><updated>2010-08-19T07:18:35.070-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Guass Sedial Method</title><content type='html'>//Gauss Seidal method &lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# include &amp;lt;math.h&amp;gt;&lt;br /&gt;# define MAXIT 50&lt;br /&gt;# define EPS .000001&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; float a[10][10],b[10],x[10],sum,x0[10];&lt;br /&gt; int i,j,n,count=0;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Enter Number of equation : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; printf(&quot;Enter Coefficients row by row \n&quot;);&lt;br /&gt; printf(&quot;One row in each line\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  for(j=1;j&amp;lt;=n;j++)&lt;br /&gt;   scanf(&quot;%f&quot;,&amp;a[i][j]);&lt;br /&gt; printf(&quot;Enter vector elements\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  x0[i]=x[i]=0;&lt;br /&gt;  scanf(&quot;%f&quot;,&amp;b[i]);&lt;br /&gt; }&lt;br /&gt; printf(&quot;N\t&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  printf(&quot;X%d    \t&quot;,i);&lt;br /&gt; printf(&quot;\n&quot;);&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt;s:    printf(&quot;%d\t&quot;,count+1);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  sum=0;&lt;br /&gt;  for(j=1;j&amp;lt;=n;j++)&lt;br /&gt;  {&lt;br /&gt;   if(i==j)&lt;br /&gt;    continue;&lt;br /&gt;   else&lt;br /&gt;    sum=sum+(a[i][j]*x[j]);&lt;br /&gt;  }&lt;br /&gt;  x[i]=(b[i]-sum)/a[i][i];&lt;br /&gt;  printf(&quot;%f \t&quot;,x[i]);&lt;br /&gt; }&lt;br /&gt; count++;&lt;br /&gt; if(fabs(x[n]-x0[n])&amp;gt;EPS &amp;&amp; count&amp;lt;MAXIT)&lt;br /&gt; {&lt;br /&gt;  for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;   x0[i]=x[i];&lt;br /&gt;  printf(&quot;\n&quot;);&lt;br /&gt;  goto s;&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;  printf(&quot;\n----------------------------------------------\nSolution : \n&quot;);&lt;br /&gt;  for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;   printf(&quot;X%d = %3.4f\t&quot;,i,x[i]);&lt;br /&gt; }&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;OUTPUT&lt;br /&gt;&lt;br /&gt;Enter Number of equation : 4&lt;br /&gt;Enter Coefficients row by row&lt;br /&gt;One row in each line&lt;br /&gt;10 -2 -1 -1&lt;br /&gt;-2 10 -1 -1&lt;br /&gt;-1 -1 10 -2&lt;br /&gt;-1 -1 -2 10&lt;br /&gt;Enter vector elements&lt;br /&gt;3 15 27 -9&lt;br /&gt;N           X1             X2               X3               X4&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;1       0.300000        1.560000        2.886000        -0.136800&lt;br /&gt;2       0.886920        1.952304        2.956562        -0.024765&lt;br /&gt;3       0.983641        1.989908        2.992402        -0.004165&lt;br /&gt;4       0.996805        1.998185        2.998666        -0.000768&lt;br /&gt;5       0.999427        1.999675        2.999757        -0.000138&lt;br /&gt;6       0.999897        1.999941        2.999956        -0.000025&lt;br /&gt;7       0.999981        1.999989        2.999992        -0.000004&lt;br /&gt;8       0.999997        1.999998        2.999999        -0.000001&lt;br /&gt;9       0.999999        2.000000        3.000000        -0.000000&lt;br /&gt;---------------------------------------------------------------------&lt;br /&gt;Solution :&lt;br /&gt;X1 = 1.0000     X2 = 2.0000     X3 = 3.0000     X4 = -0.0000</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/2852789043451112334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-guass-sedial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2852789043451112334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/2852789043451112334'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-guass-sedial.html' title='C Program Of NA Using Guass Sedial Method'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-1321703331979135191</id><published>2010-08-19T07:16:00.001-07:00</published><updated>2010-08-19T07:18:35.070-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Euler Method</title><content type='html'>/*Euler method */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int c=0;&lt;br /&gt; float x,y,xp,h,dy,i,n;&lt;br /&gt; float f(float,float);&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution by Euler Method\n&quot;);&lt;br /&gt; printf(&quot;Enter initial Boundry condition x,y : &quot;);&lt;br /&gt; scanf(&quot;%f%f&quot;,&amp;x,&amp;y);&lt;br /&gt; printf(&quot;Enter Value of X at which Y is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; printf(&quot;Enter Interval ,h : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;h);&lt;br /&gt; printf(&quot; No. \t  X\t      f(x,y) \t      Y\n&quot;);&lt;br /&gt; printf(&quot;----------------------------------------------------------\n&quot;);&lt;br /&gt; for(i=x;i&amp;lt;=xp;i=i+h)&lt;br /&gt; {&lt;br /&gt;  c++;&lt;br /&gt;  n=y+h*f(i,y);&lt;br /&gt;  printf(&quot;%2d\t %2.3f\t      %5.5f\t   %5.6f\n&quot;,c,i,f(i,y),n);&lt;br /&gt;  y=n;&lt;br /&gt; }&lt;br /&gt; printf(&quot;----------------------------------------------------------\n&quot;);&lt;br /&gt; printf(&quot;Value of y @ %f is %f&quot;,xp,n);&lt;br /&gt;getch();&lt;br /&gt;}&lt;br /&gt;float f(float x,float y)&lt;br /&gt;{&lt;br /&gt; return (y-x)/(y+x);&lt;br /&gt;}&lt;br /&gt;OUTPUT&lt;br /&gt;Solution by Euler Method&lt;br /&gt;Enter initial Boundry condition x,y : 1 2&lt;br /&gt;Enter Value of X at which Y is required : 2&lt;br /&gt;Enter Interval ,h : .25&lt;br /&gt; No.      X           f(x,y)          Y&lt;br /&gt;----------------------------------------------------------&lt;br /&gt; 1       1.000        0.33333      2.083333&lt;br /&gt; 2       1.250        0.25000      2.145833&lt;br /&gt; 3       1.500        0.17714      2.190119&lt;br /&gt; 4       1.750        0.11170      2.218045&lt;br /&gt; 5       2.000        0.05169      2.230968&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Value of y @ 2.000000 is 2.230968</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/1321703331979135191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-euler-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/1321703331979135191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/1321703331979135191'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-euler-method.html' title='C Program Of NA Using Euler Method'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-3467043201826219278</id><published>2010-08-19T07:15:00.002-07:00</published><updated>2010-08-19T07:18:35.071-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Runga-Kutta Mthod Of 4th Order</title><content type='html'>/* Runge-kutta method of 4th order to solve 10*dy/dx=(x*x)+(y*y)*/&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int c=0;&lt;br /&gt; float x,y0,xp,h,i,y1,m1,m2,m3,m4;&lt;br /&gt; float f(float,float);&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution by Runge kutta 2nd order Method\n&quot;);&lt;br /&gt; printf(&quot;Enter initial Boundry condition x,y : &quot;);&lt;br /&gt; scanf(&quot;%f%f&quot;,&amp;x,&amp;y0);&lt;br /&gt; printf(&quot;Enter Value of X at which Y is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; printf(&quot;Enter Interval ,h : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;h);&lt;br /&gt; printf(&quot; No.      X\t     m1 \t  m2\t      m3 \t   m4  \t      Y\n&quot;);&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt; for(i=x;i&amp;lt;=xp;i=i+h)&lt;br /&gt; {&lt;br /&gt;  c++;&lt;br /&gt;  m1=h*f(i,y0);&lt;br /&gt;  m2=h*f(i+(h/2),y0+(m1/2));&lt;br /&gt;  m3=h*f(i+(h/2),y0+(m2/2));&lt;br /&gt;  m4=h*f(i+h,y0+m3);&lt;br /&gt;  y1=y0+((m1+2*m2+2*m3+m4)/6);&lt;br /&gt;  printf(&quot;%2d %5.6f  %5.6f %5.6f %5.6f %5.6f %5.6f\n&quot;,c,i,m1,m2,m3,m4,y1);&lt;br /&gt;  y0=y1;&lt;br /&gt; }&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;float f(float x,float y)&lt;br /&gt;{&lt;br /&gt; return ((x*x)+(y*y))/10;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OUTPUT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution by Runge kutta 2nd order Method&lt;br /&gt;Enter initial Boundry condition x,y : 0 1&lt;br /&gt;Enter Value of X at which Y is required : .09&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enter Interval ,h : .03&lt;br /&gt; No.      X          m1          m2          m3         m4         Y&lt;br /&gt;-------------------------------------------------------------------------------&lt;br /&gt; 1    0.000000    0.003000    0.003010    0.003010   0.003021   1.003010&lt;br /&gt; 2    0.030000    0.003021    0.003033    0.003033   0.003047   1.006043&lt;br /&gt; 3    0.060000    0.003047    0.003062    0.003062   0.003079   1.009106&lt;br /&gt; 4    0.090000    0.003079    0.003097    0.003097   0.003117   1.012204</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/3467043201826219278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-runga-kutta-mthod.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3467043201826219278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3467043201826219278'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-runga-kutta-mthod.html' title='C Program Of NA Using Runga-Kutta Mthod Of 4th Order'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-7370628275433459475</id><published>2010-08-19T07:15:00.001-07:00</published><updated>2010-08-19T07:18:35.071-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Runga-Kutta Method</title><content type='html'>/* Runge-kutta method of 2nd order */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int c=0;&lt;br /&gt; float x,y0,xp,h,i,y1,m1,m2;&lt;br /&gt; float f(float,float);&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution by Runge kutta 2nd order Method\n&quot;);&lt;br /&gt; printf(&quot;Enter initial Boundry condition x,y : &quot;);&lt;br /&gt; scanf(&quot;%f%f&quot;,&amp;x,&amp;y0);&lt;br /&gt; printf(&quot;Enter Value of X at which Y is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; printf(&quot;Enter Interval ,h : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;h);&lt;br /&gt; printf(&quot; No. \t   X\t         m1 \t            m2\t             Y\n&quot;);&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt; for(i=x;i&amp;lt;=xp;i=i+h)&lt;br /&gt; {&lt;br /&gt;  c++;&lt;br /&gt;  m1=h*f(i,y0);&lt;br /&gt;  m2=h*f(i+h,y0+m1);&lt;br /&gt;  y1=y0+(.5*(m1+m2));&lt;br /&gt;  printf(&quot;%2d\t%5.6f\t%5.6f\t%5.6f\t %5.6f\n&quot;,c,i,m1,m2,y1);&lt;br /&gt;  y0=y1;&lt;br /&gt; }&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;float f(float x,float y)&lt;br /&gt;{&lt;br /&gt; return (y-x);&lt;br /&gt;}&lt;br /&gt;OUTPUT&lt;br /&gt;Solution by Runge kutta 2nd order Method&lt;br /&gt;Enter initial Boundry condition x,y : 0 2&lt;br /&gt;Enter Value of X at which Y is required : .1&lt;br /&gt;Enter Interval ,h : .1&lt;br /&gt; No.       X             m1                 m2               Y&lt;br /&gt;--------------------------------------------------------------------&lt;br /&gt; 1      0.000000        0.200000        0.210000         2.205000&lt;br /&gt; 2      0.100000        0.210500        0.221550         2.421025</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/7370628275433459475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-runga-kutta.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7370628275433459475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7370628275433459475'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-runga-kutta.html' title='C Program Of NA Using Runga-Kutta Method'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-7834259121151293294</id><published>2010-08-19T07:14:00.001-07:00</published><updated>2010-08-19T07:18:35.071-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Simpson 3/8 Rule</title><content type='html'>/*Simpson 3/8 rule */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int j,n=0;&lt;br /&gt; float x[MAX],y[MAX],sum=0,h,res,lb,ub,i;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution of 1/(1+x)dx using Simpson&#39;s 3/8 rule \n&quot;);&lt;br /&gt; printf (&quot;Enter initial value : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;lb);&lt;br /&gt; printf(&quot;Enter final value : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;ub);&lt;br /&gt; printf(&quot;Enter no. of Subinterval : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;h);&lt;br /&gt; h=(ub-lb)/h;&lt;br /&gt; for(i=lb;i&amp;lt;=ub;i=i+h)&lt;br /&gt; {&lt;br /&gt;  x[n]=i;&lt;br /&gt;  y[n]=1/(1+x[n]);&lt;br /&gt;  n++;&lt;br /&gt; }&lt;br /&gt; printf(&quot;No.\t   X\t\tY=1/(1+x)\n&quot;);&lt;br /&gt; printf(&quot;---------------------------------------\n&quot;);&lt;br /&gt; sum=y[0]+y[n-1];&lt;br /&gt; for(j=0;j&amp;lt;n;j++)&lt;br /&gt;  printf(&quot;%d\t%f\t%f\n&quot;,j,x[j],y[j]);&lt;br /&gt; printf(&quot;---------------------------------------\n&quot;);&lt;br /&gt; for(j=1;j&amp;lt;n-1;j++)&lt;br /&gt; {&lt;br /&gt;  if(j%3==0)&lt;br /&gt;   sum=sum+y[j]*2;&lt;br /&gt;  else&lt;br /&gt;   sum=sum+y[j]*3;&lt;br /&gt; }&lt;br /&gt; res=((3*h)/8)*sum;&lt;br /&gt; printf(&quot;\nIntegral from %f to %f  when h = %f is = %f&quot;,x[0],x[n-1],h,res);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;OUTPUT&lt;br /&gt;&lt;br /&gt;Solution of 1/(1+x)dx using Simpson&#39;s 3/8 rule&lt;br /&gt;Enter initial value : 6&lt;br /&gt;Enter final value : 15&lt;br /&gt;Enter no. of Subinterval : 8&lt;br /&gt;No.        X            Y=1/(1+x)&lt;br /&gt;---------------------------------------&lt;br /&gt;0       6.000000        0.142857&lt;br /&gt;1       7.125000        0.123077&lt;br /&gt;2       8.250000        0.108108&lt;br /&gt;3       9.375000        0.096386&lt;br /&gt;4       10.500000       0.086957&lt;br /&gt;5       11.625000       0.079208&lt;br /&gt;6       12.750000       0.072727&lt;br /&gt;7       13.875000       0.067227&lt;br /&gt;8       15.000000       0.062500&lt;br /&gt;---------------------------------------&lt;br /&gt;&lt;br /&gt;Integral from 6.000000 to 15.000000  when h = 1.125000 is = 0.817303</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/7834259121151293294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-simpson-38-rule.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7834259121151293294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/7834259121151293294'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-simpson-38-rule.html' title='C Program Of NA Using Simpson 3/8 Rule'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-4629490974726785870</id><published>2010-08-19T07:13:00.002-07:00</published><updated>2010-08-19T07:18:35.071-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Simpson 1/3 Rule</title><content type='html'>/*Simpson 1/3 Rule */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int i,j,n;&lt;br /&gt; float x[MAX],y[MAX],sum=0,h,res;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution of 1/(1+x)dx using Simpson&#39;s 1/3 rule \n&quot;);&lt;br /&gt; printf(&quot;Enter Number of data points : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; printf(&quot;Enter value of table value set by set\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  scanf(&quot;%f&quot;,&amp;x[i]);&lt;br /&gt;  y[i]=1/(x[i]+1);&lt;br /&gt; }&lt;br /&gt; printf(&quot;X \t\t Y\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  printf(&quot;%f\t%f\n&quot;,x[i],y[i]);&lt;br /&gt; h=x[2]-x[1];&lt;br /&gt; printf(&quot;\nSegment Interval `h&#39;:=0.25\n&quot;);&lt;br /&gt; sum=sum+y[1]+y[n];&lt;br /&gt; for(i=2;i&amp;lt;n;i++)&lt;br /&gt; {&lt;br /&gt;  if(i%2==0)&lt;br /&gt;   sum=sum+y[i]*4;&lt;br /&gt;  else&lt;br /&gt;   sum=sum+y[i]*2;&lt;br /&gt; }&lt;br /&gt; res=sum*(0.25/3);&lt;br /&gt; printf (&quot;Integral from %3.2f to %3.2f is : = %f&quot;,x[1],x[n],res);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;OUTPUT    &lt;br /&gt;Solution of 1/(1+x)dx using Simpson&#39;s 1/3 rule        &lt;br /&gt;Enter Number of data points : 5&lt;br /&gt;Enter value of table value for x column&lt;br /&gt;0 .25 .50 .75 1&lt;br /&gt;X                Y&lt;br /&gt;0.000000        1.000000&lt;br /&gt;0.250000        0.800000&lt;br /&gt;0.500000        0.666667&lt;br /&gt;0.750000        0.571429&lt;br /&gt;1.000000        0.500000&lt;br /&gt;&lt;br /&gt;Segment Interval `h&#39;:=0.25&lt;br /&gt;Integral from 0.00 to 1.00 is : = 0.693254</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/4629490974726785870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-simpson-13-rule.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/4629490974726785870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/4629490974726785870'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-simpson-13-rule.html' title='C Program Of NA Using Simpson 1/3 Rule'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-6559819566004505963</id><published>2010-08-19T07:13:00.001-07:00</published><updated>2010-08-19T07:18:35.072-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Trapezoidal Interpolation</title><content type='html'>/*Trapezoidal rule */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int i,j,n;&lt;br /&gt; float x[MAX],y[MAX],sum=0,h,res;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Solution using Trapezoidal rule \n&quot;);&lt;br /&gt; printf(&quot;Enter Number of data points : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; printf(&quot;Enter value of table value set by set\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  printf(&quot;Enter value of x[%d] and y[%d] &quot;,i,i);&lt;br /&gt;  scanf(&quot;%f%f&quot;,&amp;x[i],&amp;y[i]);&lt;br /&gt; }&lt;br /&gt; h=x[2]-x[1];&lt;br /&gt; printf(&quot;\nInterval :=%f\n&quot;,h);&lt;br /&gt; sum=y[1]+y[n];&lt;br /&gt; for(i=2;i&amp;lt;n;i++)&lt;br /&gt;  sum=sum+y[i]*2;&lt;br /&gt;&lt;br /&gt; res=sum*(h/2);&lt;br /&gt; printf (&quot;Integral from %3.2f to %3.2f is : = %f&quot;,x[1],x[n],res);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;OUTPUT :-&lt;br /&gt;Solution using Trapezoidal rule&lt;br /&gt;Enter Number of data points : 6&lt;br /&gt;Enter value of table value set by set&lt;br /&gt;Enter value of x[1] and y[1] 7.47 1.93&lt;br /&gt;Enter value of x[2] and y[2] 7.48 1.95&lt;br /&gt;Enter value of x[3] and y[3] 7.49 1.98&lt;br /&gt;Enter value of x[4] and y[4] 7.50 2.01&lt;br /&gt;Enter value of x[5] and y[5] 7.51 2.03&lt;br /&gt;Enter value of x[6] and y[6] 7.52 2.06&lt;br /&gt;&lt;br /&gt;Interval :=0.010000&lt;br /&gt;Integral from 7.47 to 7.52 is : = 0.099652</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/6559819566004505963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-trapezoidal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6559819566004505963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6559819566004505963'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-trapezoidal.html' title='C Program Of NA Using Trapezoidal Interpolation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-6063476031966452813</id><published>2010-08-19T07:12:00.000-07:00</published><updated>2010-08-19T07:18:35.072-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Langrange’s Interpolation</title><content type='html'>/*Lagrange’s Interpolation */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int i,j,n;&lt;br /&gt; float x[MAX],f[MAX],lf=1,sum=0,xp;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;Lagrange&#39;s Interpolation\n&quot;);&lt;br /&gt; printf(&quot;Enter No. of Data points : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; printf(&quot;Enter data points x(i) and function value f(i)\n&quot;);&lt;br /&gt; printf(&quot;(One set in each line)\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  scanf(&quot;%f%f&quot;,&amp;x[i],&amp;f[i]);&lt;br /&gt;&lt;br /&gt; printf(&quot;Enter Value of x at which Interpolation is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  lf=1;&lt;br /&gt;  for(j=1;j&amp;lt;=n;j++)&lt;br /&gt;  {&lt;br /&gt;   if(i!=j)&lt;br /&gt;    lf=lf*((xp-x[j])/(x[i]-x[j]));&lt;br /&gt;  }&lt;br /&gt;  sum=sum+lf*f[i];&lt;br /&gt; }&lt;br /&gt; printf(&quot;Interpolated Function value : \n&quot;);&lt;br /&gt; printf(&quot;at x = %5.2f is %f \n&quot;,xp,sum);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;OUTPUT&lt;br /&gt;Lagrange&#39;s Interpolation&lt;br /&gt;Enter No. of Data points : 4&lt;br /&gt;Enter data points x(i) and function value f(i)&lt;br /&gt;(One set in each line)&lt;br /&gt;0 3&lt;br /&gt;1 9&lt;br /&gt;3 17&lt;br /&gt;5 39&lt;br /&gt;Enter Value of x at which Interpolation is required : 2&lt;br /&gt;Interpolated Function value : at x =  2.00 is 12.700000</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/6063476031966452813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-langranges.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6063476031966452813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6063476031966452813'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-langranges.html' title='C Program Of NA Using Langrange’s Interpolation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-6145776503026311114</id><published>2010-08-19T07:10:00.000-07:00</published><updated>2010-08-19T07:18:35.072-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Divide Deference</title><content type='html'>/* Newton Divided difference formula */&lt;br /&gt;# include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;# include &amp;lt;conio.h&amp;gt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int i,j,n;&lt;br /&gt; float x[MAX],fx[MAX][MAX],xp,u,sum=0;&lt;br /&gt; printf(&quot;Newton Divided Difference formula \n&quot;);&lt;br /&gt; printf(&quot;Enter No. of data points : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; printf(&quot;Enter values of X and f(x) set by set each at once \n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  scanf(&quot;%f%f&quot;,&amp;x[i],&amp;fx[i][1]);&lt;br /&gt; printf(&quot;Enter value of X at which interpolation is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; for(i=2;i&amp;lt;=n;i++)&lt;br /&gt;  for(j=1;j&amp;lt;=n-i+1;j++)&lt;br /&gt;   fx[j][i]=(fx[j+1][i-1]-fx[j][i-1])/(x[j+i-1]-x[j]);&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt; printf(&quot;X       F(x)         &quot;);&lt;br /&gt; for(i=1;i&amp;lt;n;i++)&lt;br /&gt;  printf(&quot;y%d         &quot;,i);&lt;br /&gt; printf(&quot;\n-----------------------------------------------------------------\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  printf(&quot;%4.2f\t &quot;,x[i]);&lt;br /&gt;  for(j=1;j&amp;lt;=n-i+1;j++)&lt;br /&gt;   printf(&quot;%4.2f       &quot;,fx[i][j]);&lt;br /&gt;  printf(&quot;\n&quot;);&lt;br /&gt; }&lt;br /&gt; printf(&quot;\n-----------------------------------------------------------------\n&quot;);&lt;br /&gt; sum=fx[1][1];&lt;br /&gt; for(i=2;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  u=1;&lt;br /&gt;  for(j=1;j&amp;lt;i;j++)&lt;br /&gt;   u=u*(xp-x[j]);&lt;br /&gt;  u=u*fx[1][i];&lt;br /&gt;  sum=sum+u;&lt;br /&gt; }&lt;br /&gt; printf(&quot;For %3.2f Interpolated value = %4.2f&quot;,xp,sum);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;OUTPUT&lt;br /&gt;Newton Divided Difference formula&lt;br /&gt;Enter No. of data points : 5&lt;br /&gt;Enter values of X and f(x) set by set each at once&lt;br /&gt;-1 3&lt;br /&gt;0 -6&lt;br /&gt;3 39&lt;br /&gt;6 822&lt;br /&gt;7 1611&lt;br /&gt;Enter value of X at which interpolation is required : 4&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;X        F(x)         y1         y2         y3         y4&lt;br /&gt;-----------------------------------------------------------------------------&lt;br /&gt;-1.00    3.00        -9.00       6.00       5.00       1.00&lt;br /&gt;0.00     -6.00       15.00       41.00      13.00&lt;br /&gt;3.00     39.00       261.00      132.00&lt;br /&gt;6.00     822.00      789.00&lt;br /&gt;7.00     1611.00&lt;br /&gt;-----------------------------------------------------------------------------&lt;br /&gt;For 4.00 Interpolated value = 138.00</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/6145776503026311114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-divide-deference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6145776503026311114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/6145776503026311114'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-divide-deference.html' title='C Program Of NA Using Divide Deference'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7024532010084688924.post-3506997104170141779</id><published>2010-08-19T07:08:00.000-07:00</published><updated>2010-08-19T07:18:35.072-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numerical Analysis C Program"/><title type='text'>C Program Of NA Using Backward Interpolation</title><content type='html'>/* Backward Interpolation */&lt;br /&gt;# include &amp;lt;stdio.h&amp;lt;&lt;br /&gt;# include &amp;lt;conio.h&amp;lt;&lt;br /&gt;# define MAX 20&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; int i,j,n;&lt;br /&gt; float x[MAX],fx[MAX][MAX],u,xp,sum,p;&lt;br /&gt; clrscr();&lt;br /&gt; printf(&quot;\t\t\t  BACKWARD INTERPOLATION\n&quot;);&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt; printf(&quot;Enter number of data points : &quot;);&lt;br /&gt; scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt; // reading independant &amp; dependant value&lt;br /&gt; printf(&quot;Enter data values set by set \n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  scanf(&quot;%f%f&quot;,&amp;x[i],&amp;fx[i][1]);&lt;br /&gt; printf(&quot;Enter value of X at which interpolation is required : &quot;);&lt;br /&gt; scanf(&quot;%f&quot;,&amp;xp);&lt;br /&gt; u=(xp-x[n])/(x[2]-x[1]);&lt;br /&gt; // generating table&lt;br /&gt; for(i=2;i&amp;lt;=n;i++)&lt;br /&gt;  for(j=i;j&amp;lt;=n;j++)&lt;br /&gt;   fx[j][i]=fx[j][i-1]-fx[j-1][i-1];&lt;br /&gt; // printing table&lt;br /&gt; printf(&quot;-------------------------------------------------------------------\n&quot;);&lt;br /&gt; printf(&quot;X       F(x)     &quot;);&lt;br /&gt; for(i=1;i&amp;lt;n;i++)&lt;br /&gt;  printf(&quot;y%d       &quot;,i);&lt;br /&gt; printf(&quot;\n-----------------------------------------------------------------\n&quot;);&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt; {&lt;br /&gt;  printf(&quot;%4.2f  &quot;,x[i]);&lt;br /&gt;  for(j=1;j&amp;lt;=i;j++)&lt;br /&gt;         printf(&quot;%6.2f  &quot;,fx[i][j]);&lt;br /&gt;&lt;br /&gt;  printf(&quot;\n&quot;);&lt;br /&gt; }&lt;br /&gt; printf(&quot;-----------------------------------------------------------------\n&quot;);&lt;br /&gt; // calculting interpolated value&lt;br /&gt; sum=fx[n][1]+fx[n][2]*u;&lt;br /&gt; for(i=2;i&amp;lt;n;i++)&lt;br /&gt; {&lt;br /&gt;  p=u;&lt;br /&gt;  for(j=1;j&amp;lt;i;j++)&lt;br /&gt;   p=p*(u+j);&lt;br /&gt;  p=p/fact(i);&lt;br /&gt;  sum=sum+p*fx[n][i+1];&lt;br /&gt; }&lt;br /&gt; printf(&quot;Value of U := %5.2f\n&quot;,u);&lt;br /&gt; printf(&quot;Interpolation value := %4.4f\n&quot;,sum);&lt;br /&gt; getch();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;int fact(int n)&lt;br /&gt;{&lt;br /&gt; int i,f=1;&lt;br /&gt; for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;  f=f*i;&lt;br /&gt; return f;&lt;br /&gt;}&lt;br /&gt;OUTPUT&lt;br /&gt;BACKKWARD INTERPOLATION&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;Enter number of data points : 7&lt;br /&gt;Enter data values set by set&lt;br /&gt;3 13&lt;br /&gt;4 21&lt;br /&gt;5 31&lt;br /&gt;6 43&lt;br /&gt;7 57&lt;br /&gt;8 73&lt;br /&gt;9 91&lt;br /&gt;Enter value of X at which interpolation is required : 10&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;X       F(x)     y1       y2       y3       y4       y5       y6&lt;br /&gt;-----------------------------------------------------------------------------&lt;br /&gt;3.00   13.00&lt;br /&gt;4.00   21.00    8.00&lt;br /&gt;5.00   31.00   10.00     2.00&lt;br /&gt;6.00   43.00   12.00     2.00     0.00&lt;br /&gt;7.00   57.00   14.00     2.00     0.00     0.00&lt;br /&gt;8.00   73.00   16.00     2.00     0.00     0.00     0.00&lt;br /&gt;9.00   91.00   18.00     2.00     0.00     0.00     0.00     0.00&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;Value of U :=  1.00&lt;br /&gt;Interpolation value := 111.0000</content><link rel='replies' type='application/atom+xml' href='http://amrendraworld.blogspot.com/feeds/3506997104170141779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-backward.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3506997104170141779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7024532010084688924/posts/default/3506997104170141779'/><link rel='alternate' type='text/html' href='http://amrendraworld.blogspot.com/2010/08/c-program-of-na-using-backward.html' title='C Program Of NA Using Backward Interpolation'/><author><name>AMRENDRA KUMAR</name><uri>http://www.blogger.com/profile/03812292821327133993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgL16KLA-TmHAINu9wyDdxKWeslV7LnQTwDQ3Zjo_vHywxGO50BeacdSBiqJJ486DEHGzLVnKJFfRWGoJG9e-0k42sazI_r4hWsGRwS49fSjTz3dwg-IlgCpeyUTXWg/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry></feed>