Difference between revisions of "File:Fracit05t150.jpg"

From TORI
Jump to navigation Jump to search
(Iterate of linear fraction; $\displaystyle f(z)=\frac{x}{c+z}$ at $c\!=\!0.5$. In general the $n$th iterate of $f$ can be expressed as follows: $\displaystyle f^n(z)=\frac{z}{c^n+\frac{1-c^n}{1-c} z}$ $y=f^n(x)$ is plotted versus $x$ for vario...)
 
 
(2 intermediate revisions by one other user not shown)
Line 14: Line 14:
   
 
//<poem><nomathjax><nowiki>
 
//<poem><nomathjax><nowiki>
  +
#include<math.h>
..
 
  +
#include<stdio.h>
  +
#include<stdlib.h>
  +
#define DO(x,y) for(x=0;x<y;x++)
  +
#define DB double
  +
#include"ado.cin"
  +
  +
DB c=.5;
  +
  +
//DB F(DB n,DB x){ DB cn=pow(c,n); DB r=(1.-cn)/(1.-c); return x/( cn + r*x); }
  +
DB F(DB n,DB x){ if(c==1.) return x/(1.+n*x); DB cn=pow(c,n); DB r=(1.-cn)/(1.-c); return x/( cn + r*x); }
  +
  +
main(){ FILE *o; int m,n,k; DB x,y,t;
  +
o=fopen("fracit05.eps","w");
  +
ado(o,702,702);
  +
#define M(x,y) fprintf(o,"%7.4f %7.4f M\n",0.+x,0.+y);
  +
#define L(x,y) fprintf(o,"%7.4f %7.4f L\n",0.+x,0.+y);
  +
  +
fprintf(o,"101 101 translate 100 100 scale 2 setlinecap\n");
  +
for(n=-1;n<7;n++) { M(-1,n)L(6,n)}
  +
for(m=-1;m<7;m++) { M(m,-1)L(m,6)}
  +
fprintf(o,".01 W S\n");
  +
  +
// n=0;DO(m,701){x=-1.+.01*(m-.5);y=F(-4.,x);if(y>-10.4&&y<10.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-3.,x);if(y>-8.4&&y<8.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-2.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-1.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 1.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 2.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
  +
n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 3.,x);if(y>-8.4&&y<8.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
  +
// n=0;DO(m,701){x=-1.+.005*(m-.5);y=F( 4.,x);if(y>-10.4&&y<10.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
  +
  +
DO(k,21){ t=-1.+.1*k;
  +
n=0;DO(m,2801){x=-1.+.0250*(m-.5);y=F(t,x);if(y>-7.2&&y<7.2){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".01 W 0 0 0 RGB S\n");
  +
}
  +
  +
fprintf(o,"showpage\n"); fprintf(o,"%c%cTrailer\n",'%','%');
  +
fclose(o);
  +
system("epstopdf fracit05.eps");
  +
system( "open fracit05.pdf");
  +
}
  +
 
//</nowiki></nomathjax></poem>
 
//</nowiki></nomathjax></poem>
   
Line 23: Line 64:
 
% <poem><nomathjax><nowiki>
 
% <poem><nomathjax><nowiki>
 
\documentclass[12pt]{article}
 
\documentclass[12pt]{article}
  +
\paperwidth 706pt
  +
\paperheight 706pt
  +
\textwidth 800pt
  +
\textheight 800pt
  +
\topmargin -108pt
  +
\oddsidemargin -72pt
  +
\parindent 0pt
  +
\pagestyle{empty}
  +
\usepackage {graphics}
  +
\usepackage{rotating}
  +
\newcommand \rot {\begin{rotate}}
  +
\newcommand \ero {\end{rotate}}
  +
\newcommand \ing {\includegraphics}
  +
\newcommand \sx {\scalebox}
  +
\begin{document}%H0H1H2HHHHHHHHHHHHHH
  +
\begin{picture}(704,704)
  +
\put(0,0){\ing{fracit05}}
  +
\put(104,684){\sx{3}{$y$}}
  +
\put(104,592){\sx{3}{$5$}}
  +
\put(104,492){\sx{3}{$4$}}
  +
\put(104,392){\sx{3}{$3$}}
  +
\put(104,292){\sx{3}{$2$}}
  +
\put(104,192){\sx{3}{$1$}}
  +
%\put(79,92){\sx{3}{$0$}}
  +
%\put(94,74){\sx{3}{$0$}}
  +
\put(194,104){\sx{3}{$1$}}
  +
\put(294,104){\sx{3}{$2$}}
  +
\put(394,104){\sx{3}{$3$}}
  +
\put(494,104){\sx{3}{$4$}}
  +
\put(594,104){\sx{3}{$5$}}
  +
\put(686,105){\sx{3}{$x$}}
  +
%\put(0,0){\ing{fracit10}}
  +
%\put(0,0){\ing{fracit10}}
  +
  +
\put(18,313){\rot{76}\sx{3.2}{$n\!=\!1$}\ero}
  +
\put(68,204){\rot{78}\sx{3.2}{$n\!=\!2$}\ero}
  +
\put(14,152){\rot{12}\sx{3.2}{$n\!=\!3$}\ero}
  +
  +
%\put(139,560){\rot{89}\sx{3.2}{$n\!=\!-2$}\ero}
  +
\put(201,560){\rot{88}\sx{3.2}{$n\!=\!-1$}\ero}
  +
\put(247,558){\rot{86}\sx{3}{$n\!=\!-0.5$}\ero}
  +
\put(265,558){\rot{84}\sx{3}{$n\!=\!-0.4$}\ero}
  +
\put(293,558){\rot{82}\sx{3}{$n\!=\!-0.3$}\ero}
  +
\put(334,558){\rot{78}\sx{3}{$n\!=\!-0.2$}\ero}
  +
\put(406,558){\rot{67}\sx{3}{$n\!=\!-0.1$}\ero}
  +
  +
\put(580,567){\rot{45}\sx{3}{$n\!=\!0$}\ero}
  +
\put(608,407){\rot{19}\sx{3}{$n\!=\!0.1$}\ero}
  +
\put(607,324){\rot{11}\sx{3}{$n\!=\!0.2$}\ero}
  +
\put(606,279){\rot{7}\sx{3}{$n\!=\!0.3$}\ero}
  +
\put(605,250){\rot{5}\sx{3}{$n\!=\!0.4$}\ero}
  +
\put(604,230){\rot{2}\sx{2.9}{$n\!=\!0.5$}\ero}
  +
\put(620,184){\sx{3.2}{$n\!=\!1$}}
  +
\put(620,160){\sx{3.2}{$n\!=\!2$}}
   
  +
\put(162, 0){\rot{70}\sx{2.9}{$n\!=\!-3$}\ero}
  +
\put(204, 50){\rot{10}\sx{2.9}{$n\!=\!-2$}\ero}
  +
\put(308, 0){\rot{10}\sx{2.9}{$n\!=\!-1$}\ero}
  +
\end{picture}
  +
\end{document}
 
% </nowiki></nomathjax></poem>
 
% </nowiki></nomathjax></poem>
   
Line 29: Line 129:
 
<references/>
 
<references/>
   
  +
[[Category:Book]]
  +
[[Category:BookPlot]]
 
[[Category:C++]]
 
[[Category:C++]]
 
[[Category:Elementary function]]
 
[[Category:Elementary function]]

Latest revision as of 08:36, 1 December 2018

Iterate of linear fraction;

$\displaystyle f(z)=\frac{x}{c+z}$ at $c\!=\!0.5$.

In general the $n$th iterate of $f$ can be expressed as follows:

$\displaystyle f^n(z)=\frac{z}{c^n+\frac{1-c^n}{1-c} z}$

$y=f^n(x)$ is plotted versus $x$ for various values of $n$.

Generator of curves

// File ado.cin should be loaded to the working directory in order to compile the C++ code below.

//


#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#define DO(x,y) for(x=0;x<y;x++)
#define DB double
#include"ado.cin"

DB c=.5;

//DB F(DB n,DB x){ DB cn=pow(c,n); DB r=(1.-cn)/(1.-c); return x/( cn + r*x); }
DB F(DB n,DB x){ if(c==1.) return x/(1.+n*x); DB cn=pow(c,n); DB r=(1.-cn)/(1.-c); return x/( cn + r*x); }

main(){ FILE *o; int m,n,k; DB x,y,t;
o=fopen("fracit05.eps","w");
ado(o,702,702);
#define M(x,y) fprintf(o,"%7.4f %7.4f M\n",0.+x,0.+y);
#define L(x,y) fprintf(o,"%7.4f %7.4f L\n",0.+x,0.+y);

fprintf(o,"101 101 translate 100 100 scale 2 setlinecap\n");
for(n=-1;n<7;n++) { M(-1,n)L(6,n)}
for(m=-1;m<7;m++) { M(m,-1)L(m,6)}
fprintf(o,".01 W S\n");

// n=0;DO(m,701){x=-1.+.01*(m-.5);y=F(-4.,x);if(y>-10.4&&y<10.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-3.,x);if(y>-8.4&&y<8.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-2.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F(-1.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 1 0 1 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 1.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 2.,x);if(y>-7.4&&y<7.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
        n=0;DO(m,2801){x=-1.+.0025*(m-.5);y=F( 3.,x);if(y>-8.4&&y<8.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");
// n=0;DO(m,701){x=-1.+.005*(m-.5);y=F( 4.,x);if(y>-10.4&&y<10.4){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".03 W 0 1 0 RGB S\n");

DO(k,21){ t=-1.+.1*k;
n=0;DO(m,2801){x=-1.+.0250*(m-.5);y=F(t,x);if(y>-7.2&&y<7.2){ if(n==0){M(x,y) n=1;}else L(x,y)} else n=0;} fprintf(o,".01 W 0 0 0 RGB S\n");
}

fprintf(o,"showpage\n"); fprintf(o,"%c%cTrailer\n",'%','%');
fclose(o);
system("epstopdf fracit05.eps");
system( "open fracit05.pdf");
}

//

Latex generator of labels

%File Fracit20t.pdf should be generated with the code above in order to compile the Latex document below.

%


\documentclass[12pt]{article}
\paperwidth 706pt
\paperheight 706pt
\textwidth 800pt
\textheight 800pt
\topmargin -108pt
\oddsidemargin -72pt
\parindent 0pt
\pagestyle{empty}
\usepackage {graphics}
\usepackage{rotating}
\newcommand \rot {\begin{rotate}}
\newcommand \ero {\end{rotate}}
\newcommand \ing {\includegraphics}
\newcommand \sx {\scalebox}
\begin{document}%H0H1H2HHHHHHHHHHHHHH
\begin{picture}(704,704)
\put(0,0){\ing{fracit05}}
\put(104,684){\sx{3}{$y$}}
\put(104,592){\sx{3}{$5$}}
\put(104,492){\sx{3}{$4$}}
\put(104,392){\sx{3}{$3$}}
\put(104,292){\sx{3}{$2$}}
\put(104,192){\sx{3}{$1$}}
%\put(79,92){\sx{3}{$0$}}
%\put(94,74){\sx{3}{$0$}}
\put(194,104){\sx{3}{$1$}}
\put(294,104){\sx{3}{$2$}}
\put(394,104){\sx{3}{$3$}}
\put(494,104){\sx{3}{$4$}}
\put(594,104){\sx{3}{$5$}}
\put(686,105){\sx{3}{$x$}}
%\put(0,0){\ing{fracit10}}
%\put(0,0){\ing{fracit10}}

\put(18,313){\rot{76}\sx{3.2}{$n\!=\!1$}\ero}
\put(68,204){\rot{78}\sx{3.2}{$n\!=\!2$}\ero}
\put(14,152){\rot{12}\sx{3.2}{$n\!=\!3$}\ero}

%\put(139,560){\rot{89}\sx{3.2}{$n\!=\!-2$}\ero}
\put(201,560){\rot{88}\sx{3.2}{$n\!=\!-1$}\ero}
\put(247,558){\rot{86}\sx{3}{$n\!=\!-0.5$}\ero}
\put(265,558){\rot{84}\sx{3}{$n\!=\!-0.4$}\ero}
\put(293,558){\rot{82}\sx{3}{$n\!=\!-0.3$}\ero}
\put(334,558){\rot{78}\sx{3}{$n\!=\!-0.2$}\ero}
\put(406,558){\rot{67}\sx{3}{$n\!=\!-0.1$}\ero}

\put(580,567){\rot{45}\sx{3}{$n\!=\!0$}\ero}
\put(608,407){\rot{19}\sx{3}{$n\!=\!0.1$}\ero}
\put(607,324){\rot{11}\sx{3}{$n\!=\!0.2$}\ero}
\put(606,279){\rot{7}\sx{3}{$n\!=\!0.3$}\ero}
\put(605,250){\rot{5}\sx{3}{$n\!=\!0.4$}\ero}
\put(604,230){\rot{2}\sx{2.9}{$n\!=\!0.5$}\ero}
\put(620,184){\sx{3.2}{$n\!=\!1$}}
\put(620,160){\sx{3.2}{$n\!=\!2$}}

\put(162, 0){\rot{70}\sx{2.9}{$n\!=\!-3$}\ero}
\put(204, 50){\rot{10}\sx{2.9}{$n\!=\!-2$}\ero}
\put(308, 0){\rot{10}\sx{2.9}{$n\!=\!-1$}\ero}
\end{picture}
\end{document}
%

References

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:24, 4 August 2013Thumbnail for version as of 21:24, 4 August 20131,466 × 1,466 (441 KB)T (talk | contribs)Iterate of linear fraction; $\displaystyle f(z)=\frac{x}{c+z}$ at $c\!=\!0.5$. In general the $n$th iterate of $f$ can be expressed as follows: $\displaystyle f^n(z)=\frac{z}{c^n+\frac{1-c^n}{1-c} z}$ $y=f^n(x)$ is plotted versus $x$ for vario...

The following page uses this file:

Metadata