Difference between revisions of "File:Quaplot.jpg"

From TORI
Jump to: navigation, search
(Importing image file)
 
 
Line 1: Line 1:
  +
$y=\,$[[qua]]$(x)=\frac{1}{2}\big( x\sqrt{1\!-\!x^2}+\arcsin(x)\big)$
Importing image file
 
  +
  +
The additional horizontal grid line corresponds to $y=\,$[[qua]]$(1)=\pi/4\approx 0.785398$
  +
  +
==[[C++]] generator of curve==
  +
[[ado.cin]] should be loaded in order to compile the code below
  +
  +
<poem><nomathjax><nowiki>
  +
#include<stdio.h>
  +
#include<math.h>
  +
#include<stdlib.h>
  +
//#define DB double
  +
#define DB double
  +
#define DO(x,y) for(x=0;x<y;x++)
  +
#include"ado.cin"
  +
  +
DB qua(DB x){ return .5*( x*sqrt(1.-x*x) + asin(x));}
  +
  +
int main(){ int m,n; DB x,y; FILE *o;
  +
o=fopen("quaplo.eps","w");
  +
ado(o,1004,804);
  +
#define M(x,y) fprintf(o,"%6.5lf %6.5lf M\n",0.+x, 0.+y);
  +
#define L(x,y) fprintf(o,"%6.5lf %6.5lf L\n",0.+x, 0.+y);
  +
fprintf(o,"2 2 translate 1000 1000 scale\n");
  +
DO(m,11){ M(.1*m,0) L(.1*m,.8)}
  +
DO(n,9) { M(0,.1*n) L(1,.1*n)}
  +
fprintf(o,"2 setlinecap 1 setlinejoin .002 W S\n");
  +
M(0,M_PI/4.) L(1,M_PI/4.)
  +
fprintf(o," .001 W S\n");
  +
DO(m,101){x=.01*m;y=qua(x); if(m==0)M(x,y) else L(x,y) }
  +
fprintf(o,"1 0 0 RGB .003 W S\n");
  +
fprintf(o,"showpage\n%c%cTrailer\n",'%','%');fclose(o);
  +
system("epstopdf quaplo.eps");
  +
system( "open quaplo.pdf");
  +
}
  +
</nowiki></nomathjax></poem>
  +
  +
==[[Latex]] generator of labels==
  +
  +
<poem><nomathjax><nowiki>
  +
\documentclass[12pt]{article}
  +
\usepackage{geometry}
  +
\paperwidth 1010pt
  +
\paperheight 810pt
  +
\topmargin -104pt
  +
\oddsidemargin -72pt
  +
\pagestyle{empty}
  +
\usepackage{graphicx}
  +
\parindent 0pt
  +
\textwidth 1200px
  +
\textheight 900px
  +
\newcommand \sx {\scalebox}
  +
\begin{document}
  +
\begin{picture}(1008,804)
  +
\put(0,0){\includegraphics{quaplo}}
  +
\put(14,744){\sx{4.2}{$y\!=\!\mathrm{qua}(x)$}}
  +
\put(9,590){\sx{4}{$0.6$}}
  +
\put(9,390){\sx{4}{$0.4$}}
  +
\put(9,190){\sx{4}{$0.2$}}
  +
\put(170,8){\sx{4}{$0.2$}}
  +
\put(370,8){\sx{4}{$0.4$}}
  +
\put(570,8){\sx{4}{$0.6$}}
  +
\put(770,8){\sx{4}{$0.8$}}
  +
\put(980,8){\sx{4}{$x$}}
  +
\end{picture}
  +
\end{document}
  +
</nowiki></nomathjax></poem>
  +
  +
[[Category:Explicit plot]]
  +
[[Category:Oscillator function]]
  +
[[Category:Qua]]

Latest revision as of 08:48, 1 December 2018

$y=\,$qua$(x)=\frac{1}{2}\big( x\sqrt{1\!-\!x^2}+\arcsin(x)\big)$

The additional horizontal grid line corresponds to $y=\,$qua$(1)=\pi/4\approx 0.785398$

C++ generator of curve

ado.cin should be loaded in order to compile the code below


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

DB qua(DB x){ return .5*( x*sqrt(1.-x*x) + asin(x));}

int main(){ int m,n; DB x,y; FILE *o;
o=fopen("quaplo.eps","w");
ado(o,1004,804);
#define M(x,y) fprintf(o,"%6.5lf %6.5lf M\n",0.+x, 0.+y);
#define L(x,y) fprintf(o,"%6.5lf %6.5lf L\n",0.+x, 0.+y);
fprintf(o,"2 2 translate 1000 1000 scale\n");
DO(m,11){ M(.1*m,0) L(.1*m,.8)}
DO(n,9) { M(0,.1*n) L(1,.1*n)}
fprintf(o,"2 setlinecap 1 setlinejoin .002 W S\n");
M(0,M_PI/4.) L(1,M_PI/4.)
fprintf(o," .001 W S\n");
DO(m,101){x=.01*m;y=qua(x); if(m==0)M(x,y) else L(x,y) }
fprintf(o,"1 0 0 RGB .003 W S\n");
fprintf(o,"showpage\n%c%cTrailer\n",'%','%');fclose(o);
system("epstopdf quaplo.eps");
system( "open quaplo.pdf");
}

Latex generator of labels


\documentclass[12pt]{article}
\usepackage{geometry}
\paperwidth 1010pt
\paperheight 810pt
\topmargin -104pt
\oddsidemargin -72pt
\pagestyle{empty}
\usepackage{graphicx}
\parindent 0pt
\textwidth 1200px
\textheight 900px
\newcommand \sx {\scalebox}
\begin{document}
\begin{picture}(1008,804)
\put(0,0){\includegraphics{quaplo}}
\put(14,744){\sx{4.2}{$y\!=\!\mathrm{qua}(x)$}}
\put(9,590){\sx{4}{$0.6$}}
\put(9,390){\sx{4}{$0.4$}}
\put(9,190){\sx{4}{$0.2$}}
\put(170,8){\sx{4}{$0.2$}}
\put(370,8){\sx{4}{$0.4$}}
\put(570,8){\sx{4}{$0.6$}}
\put(770,8){\sx{4}{$0.8$}}
\put(980,8){\sx{4}{$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:13, 1 December 2018Thumbnail for version as of 06:13, 1 December 20182,096 × 1,681 (291 KB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

There are no pages that link to this file.

Metadata