Difference between revisions of "File:Susinplot.jpg"

From TORI
Jump to: navigation, search
(Importing image file)
 
 
Line 1: Line 1:
  +
[[Explicit plot]] of function [[SuSin]] is shown with the thick curve, $y\!=\! \mathrm{SuSin}(x)$.
Importing image file
 
  +
  +
For comparison, the thin curve shows the asymptotic of [[SuSin]], $y \!=\! \sqrt{3/x}$.
  +
  +
SuSin is [[Superfunction]] of sinus.
  +
  +
The numeric implementation of SuSin below is not yet a final tool, because it provides only 6 significant figures. In addition, the complex double implementation of [[ArcSin]] used is not robust. In such a way, the algorithm below allows to plot the camera–ready figures, but it may be not sufficient for some other applications.
  +
  +
==[[C++]] generator of curves==
  +
// Files [[ado.cin]], [[arcsin.cin]], and [[susin.cin]] should be loaded to the working directory in order to compile the code below
  +
<poem><nomathjax><nowiki>
  +
#include <math.h>
  +
#include <stdio.h>
  +
#include <stdlib.h>
  +
#define DB double
  +
#define DO(x,y) for(x=0;x<y;x++)
  +
using namespace std;
  +
#include<complex>
  +
typedef complex<double> z_type;
  +
#define Re(x) x.real()
  +
#define Im(x) x.imag()
  +
#define I z_type(0.,1.)
  +
  +
#include "ado.cin"
  +
#include "arcsin.cin"
  +
#include "susin.cin"
  +
  +
int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
  +
DB x0=0.;
  +
DO(m,14){y=Re(susin(z_type(1.,1.e-9)+x0))-1.;
  +
x0+=4.*y;
  +
printf("%2d %19.16f %19.16f\n",m,x0,y);}
  +
  +
FILE *o;o=fopen("susinplot1.eps","w"); ado(o,1002,242);
  +
#define M(x,y) {fprintf(o,"%6.4f %6.4f M\n",0.+x,0.+y);}
  +
#define L(x,y) {fprintf(o,"%6.4f %6.4f L\n",0.+x,0.+y);}
  +
  +
fprintf(o,"1 1 translate\n 100 100 scale\n");
  +
fprintf(o,"1 setlinejoin 2 setlinecap\n");
  +
for(m=0;m<11;m++){M(m,-1) L(m,2) }
  +
for(n=0;n<3;n++){M( 0,n) L(10,n)}
  +
fprintf(o,".006 W 0 0 0 RGB S\n");
  +
M(0,M_PI/2.); L(10,M_PI/2)
  +
fprintf(o,".004 W 0 0 0 RGB S\n");
  +
  +
fprintf(o,"1 setlinejoin 1 setlinecap\n");
  +
  +
M(0,M_PI/2.);
  +
DO(m,2002){ x=.005*(m+.3); z=z_type(x,1.e-8); c=susin(z); y=Re(c); L(x,y); printf("%8.5f %8.5f\n",x,y); }
  +
fprintf(o,".03 W 0 0 .8 RGB S\n");
  +
  +
DO(m,100){ x=.5+.1*m; y=sqrt(3./x); if(m==0) M(x,y) else L(x,y) ; if ( x>10.) break;}
  +
fprintf(o,".01 W 0 0 0 RGB S\n");
  +
  +
//n=0;DO(m,100){ x=.1*m; z=z_type(x,1.e-8); c=susin(z); y=Im(c); if(y>-2 && y<3) { if(n==0) M(x,y) else L(x,y); n++;}}
  +
//fprintf(o,".02 W .8 0 0 RGB S\n"); printf("n=%3d\n",n);
  +
  +
fprintf(o,"showpage\n");
  +
fprintf(o,"%c%cTrailer\n",'%','%');
  +
fclose(o);
  +
system("epstopdf susinplot1.eps");
  +
system( "open susinplot1.pdf"); //for macintosh
  +
getchar(); system("killall Preview"); // For macintosh
  +
}
  +
</nowiki></nomathjax></poem>
  +
  +
==[[Latex]] generator of labels==
  +
<poem><nomathjax><nowiki>
  +
\documentclass[12pt]{article}
  +
\usepackage{geometry}
  +
\usepackage{graphics}
  +
\paperwidth 1026pt
  +
\paperheight 225pt
  +
\topmargin -109pt
  +
\oddsidemargin -90pt
  +
\newcommand \sx {\scalebox}
  +
\pagestyle{empty}
  +
\begin{document}
  +
\begin{picture}(1016,204)
  +
\put(20,1){\includegraphics{susinplot1}}
  +
\put(2,191){\sx{2.4}{$y$}}
  +
\put(-1,151){\sx{2.8}{$\frac{\pi}{2}$}}
  +
\put(2,93){\sx{2.4}{$1$}}
  +
\put(2,-5){\sx{2.4}{$0$}}
  +
\put(15,-19){\sx{2.4}{$0$}}
  +
\put(115,-19){\sx{2.4}{$1$}}
  +
\put(215,-19){\sx{2.4}{$2$}}
  +
\put(315,-19){\sx{2.4}{$3$}}
  +
\put(415,-19){\sx{2.4}{$4$}}
  +
\put(516,-19){\sx{2.4}{$5$}}
  +
\put(616,-19){\sx{2.4}{$6$}}
  +
\put(717,-19){\sx{2.4}{$7$}}
  +
\put(817,-19){\sx{2.4}{$8$}}
  +
\put(917,-19){\sx{2.4}{$9$}}
  +
\put(1010,-19){\sx{2.5}{$x$}}
  +
%\put(45,134){\sx{2.5}{$y\!=\!\mathrm{SuSin}(x)$}}
  +
\put(140,166){\sx{2.8}{$y\!=\! \sqrt{3/x}$}}
  +
\put(135,56){\sx{2.8}{$y\!=\!\mathrm{SuSin}(x)$}}
  +
\end{picture}
  +
\end{document}
  +
</nowiki></nomathjax></poem>
  +
  +
[[Category:Book]]
  +
[[Category:BookPlot]]
  +
[[Category:Explicit plot]]
  +
[[Category:Sin]]
  +
[[Category:SuSin]]
  +
[[Category:Superfunction]]
  +
[[Category:Book]]

Latest revision as of 08:53, 1 December 2018

Explicit plot of function SuSin is shown with the thick curve, $y\!=\! \mathrm{SuSin}(x)$.

For comparison, the thin curve shows the asymptotic of SuSin, $y \!=\! \sqrt{3/x}$.

SuSin is Superfunction of sinus.

The numeric implementation of SuSin below is not yet a final tool, because it provides only 6 significant figures. In addition, the complex double implementation of ArcSin used is not robust. In such a way, the algorithm below allows to plot the camera–ready figures, but it may be not sufficient for some other applications.

C++ generator of curves

// Files ado.cin, arcsin.cin, and susin.cin should be loaded to the working directory in order to compile the code below


#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
using namespace std;
#include<complex>
typedef complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)

#include "ado.cin"
#include "arcsin.cin"
#include "susin.cin"

int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
DB x0=0.;
DO(m,14){y=Re(susin(z_type(1.,1.e-9)+x0))-1.;
        x0+=4.*y;
        printf("%2d %19.16f %19.16f\n",m,x0,y);}

FILE *o;o=fopen("susinplot1.eps","w"); ado(o,1002,242);
#define M(x,y) {fprintf(o,"%6.4f %6.4f M\n",0.+x,0.+y);}
#define L(x,y) {fprintf(o,"%6.4f %6.4f L\n",0.+x,0.+y);}

fprintf(o,"1 1 translate\n 100 100 scale\n");
fprintf(o,"1 setlinejoin 2 setlinecap\n");
for(m=0;m<11;m++){M(m,-1) L(m,2) }
for(n=0;n<3;n++){M( 0,n) L(10,n)}
fprintf(o,".006 W 0 0 0 RGB S\n");
M(0,M_PI/2.); L(10,M_PI/2)
fprintf(o,".004 W 0 0 0 RGB S\n");

fprintf(o,"1 setlinejoin 1 setlinecap\n");

M(0,M_PI/2.);
DO(m,2002){ x=.005*(m+.3); z=z_type(x,1.e-8); c=susin(z); y=Re(c); L(x,y); printf("%8.5f %8.5f\n",x,y); }
fprintf(o,".03 W 0 0 .8 RGB S\n");

DO(m,100){ x=.5+.1*m; y=sqrt(3./x); if(m==0) M(x,y) else L(x,y) ; if ( x>10.) break;}
fprintf(o,".01 W 0 0 0 RGB S\n");

//n=0;DO(m,100){ x=.1*m; z=z_type(x,1.e-8); c=susin(z); y=Im(c); if(y>-2 && y<3) { if(n==0) M(x,y) else L(x,y); n++;}}
//fprintf(o,".02 W .8 0 0 RGB S\n"); printf("n=%3d\n",n);

fprintf(o,"showpage\n");
fprintf(o,"%c%cTrailer\n",'%','%');
fclose(o);
      system("epstopdf susinplot1.eps");
      system( "open susinplot1.pdf"); //for macintosh
      getchar(); system("killall Preview"); // For macintosh
}

Latex generator of labels


\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{graphics}
\paperwidth 1026pt
\paperheight 225pt
\topmargin -109pt
\oddsidemargin -90pt
\newcommand \sx {\scalebox}
\pagestyle{empty}
\begin{document}
\begin{picture}(1016,204)
\put(20,1){\includegraphics{susinplot1}}
\put(2,191){\sx{2.4}{$y$}}
\put(-1,151){\sx{2.8}{$\frac{\pi}{2}$}}
\put(2,93){\sx{2.4}{$1$}}
\put(2,-5){\sx{2.4}{$0$}}
\put(15,-19){\sx{2.4}{$0$}}
\put(115,-19){\sx{2.4}{$1$}}
\put(215,-19){\sx{2.4}{$2$}}
\put(315,-19){\sx{2.4}{$3$}}
\put(415,-19){\sx{2.4}{$4$}}
\put(516,-19){\sx{2.4}{$5$}}
\put(616,-19){\sx{2.4}{$6$}}
\put(717,-19){\sx{2.4}{$7$}}
\put(817,-19){\sx{2.4}{$8$}}
\put(917,-19){\sx{2.4}{$9$}}
\put(1010,-19){\sx{2.5}{$x$}}
%\put(45,134){\sx{2.5}{$y\!=\!\mathrm{SuSin}(x)$}}
\put(140,166){\sx{2.8}{$y\!=\! \sqrt{3/x}$}}
\put(135,56){\sx{2.8}{$y\!=\!\mathrm{SuSin}(x)$}}
\end{picture}
\end{document}

File history

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

Date/TimeThumbnailDimensionsUserComment
current06:14, 1 December 2018Thumbnail for version as of 06:14, 1 December 20182,129 × 466 (112 KB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

The following page links to this file:

Metadata