File:2014ruble15t.png: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Dmitrii Kouznetsov
(C++ generator)
(== Summary == Importing file)
Tag: Server-side upload
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Summary ==
== Summary ==
{{Image_Details|user
Importing file
|description  = Approximations of price of Russian [[rouble]] ([[ruble]]) measured in yen, in the USA cent and in the Euro cent during its [[inflation]] in the end of year 2014
|author      = [[User:Dmitrii Kouznetsov|Dmitrii Kouznetsov]] ([[User talk:Dmitrii Kouznetsov|talk]])
|date-created = 2014.12.15
|pub-country  = Japan
|notes        = I shall load the generator
|versions    = http://mizugadro.mydns.jp/t/index.php/File:2014ruble15t.png
}}
== Licensing ==
{{CC|by|3.0}}
 
==References==
http://mizugadro.mydns.jp/t/index.php/File:2014ruble15t.png
 
==[[C++]] generator of curves==
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
void ado(FILE *O, int X, int Y)
{ fprintf(O,"%c!PS-Adobe-2.0 EPSF-2.0\n",'%');
        fprintf(O,"%c%cBoundingBox: 0 0 %d %d\n",'%','%',X,Y);
        fprintf(O,"/M {moveto} bind def\n");
        fprintf(O,"/L {lineto} bind def\n");
        fprintf(O,"/S {stroke} bind def\n");
        fprintf(O,"/s {show newpath} bind def\n");
        fprintf(O,"/C {closepath} bind def\n");
        fprintf(O,"/F {fill} bind def\n");
        fprintf(O,"/o {3 0 360 arc C S} bind def\n");
        fprintf(O,"/times-Roman findfont 20 scalefont setfont\n");
        fprintf(O,"/W {setlinewidth} bind def\n");
        fprintf(O,"/RGB {setrgbcolor} bind def\n");}
 
#include"daju24.cin"
//DB y02(DB t){ DB x,y; x=.01*t; x+=1.1; x/=2.; y=2.94*sqrt(1.-x*x); return 100*y; }
//DB d02(DB t){ DB x,y; x=.01*t; x+=1.37; x/=2.4; y=2.9*sqrt(1.-x*x); return 100*y; }
//DB e02(DB t){ DB x,y; x=.01*t; x+=.84; x/=1.8; y=2.14*sqrt(1.-x*x); return 100*y; }
 
DB B=1.;
//DB y03(DB t){ DB x,y; x=.01*t; return 125.*sqrt((3.77+x)*(B-x));}
DB y03(DB t){ DB x,y; x=.01*t; return 160.*sqrt((2.64+x)*(B-x));}
 
//DB d03(DB t){ DB x,y; x=.01*t; return 140.*sqrt((2.64+x)*(B-x));}
//DB d03(DB t){ DB x,y; x=.01*t; return 150.*sqrt((2.11+x)*(B-x));}
//DB d03(DB t){ DB x,y; x=.01*t; return 125.*sqrt((3.5+x)*(B-x));}
DB d03(DB t){ DB x,y; x=.01*t; return 128.*sqrt((3.5+x)*(B-x));}
 
//DB e03(DB t){ DB x,y; x=.01*t; return 147.*sqrt((2.10+x)*(B-x));}
DB e03(DB t){ DB x,y; x=.01*t; return 110.*sqrt((2.9+x)*(B-x));}
 
int main(){ int j,jd,n,m,M=500,N; FILE *i,*o; DB t[M],f[M],g[M]; int di; DB dr, x,y;
int zero=daju24(2014,10,27); //Date of beginning of the project
 
o=fopen("15.eps","w"); ado(o,302,304);
#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);
#define o(x,y) fprintf(o,"%6.4f %6.4f o\n",0.+x,0.+y);
fprintf(o,"201 1 translate 2 setlinecap\n");
for(n=0;n<401;n+=50) { M(-200,n)L(100,n)}
for(n=-200;n<201;n+=50) {M(n,0)L(n,300)}
fprintf(o,"0 0 0 RGB 2 setlinecap 1 setlinejoin .1 W S\n");
 
i=fopen("dollardat.txt","r");
DO(n,M) { int Y,M,D; char c1,c2,c3;
j=fscanf(i,"%4d%c%2d%c%2d%2d%lf",&Y,&c1,&M,&c2,&D, &di,&dr); if(j<3) break;
t[n]=daju24(Y,M,D)-zero;
f[n]=di+dr/1000.;
g[n]=10000./f[n];
printf("%4d %2d %2d %9.0f %9.3f\n",Y, M, D, t[n],f[n]);}
fclose(i); N=n; printf("N=%4d\n",N);
fprintf(o,"0 1 0 RGB 5 W\n");
M(t[0],g[0]) for(n=1;n<N;n++) L(t[n],g[n]); fprintf(o,"S\n");
//DO(n,N) o(t[n],g[n]);
 
i=fopen("eurodata.txt","r");
DO(n,M) { int Y,M,D; char c1,c2,c3;
j=fscanf(i,"%4d%c%2d%c%2d%2d%lf",&Y,&c1,&M,&c2,&D, &di,&dr); if(j<3) break;
t[n]=daju24(Y,M,D)-zero;
f[n]=di+dr/1000.;
g[n]=10000./f[n];
printf("%4d %2d %2d %9.0f %9.3f\n",Y, M, D, t[n],f[n]);}
fclose(i); N=n; printf("N=%4d\n",N); // getchar();
fprintf(o,"0 .6 1 RGB 5 W\n");
M(t[0],g[0]) for(n=1;n<N;n++) L(t[n],g[n]); fprintf(o,"S\n");
//DO(n,N) o(t[n],g[n]);
 
i=fopen("yendata.txt","r");
DO(n,N) { int Y,M,D; char c1,c2,c3;
        j=fscanf(i,"%4d%c%2d%c%2d%lf", &Y,&c1,&M,&c2,&D, &dr); if(j<3) break;
t[n]=daju24(Y,M,D)-zero;
//f[n]=di+dr/1000.;
f[n]=dr/10.;
g[n]=10000/f[n];
printf("%4d %2d %2d %9.0f %9.3f\n",Y, M, D, t[n],f[n]);
}
fclose(i); N=n; printf("N=%4d\n",N);
fprintf(o,"1 0 0 RGB 5 W\n");
M(t[0],g[0]) for(n=1;n<N;n++) L(t[n],g[n]); fprintf(o,"S\n");
//DO(n,N) o(t[n],g[n]);
 
DO(n,400){x=n-200.; y=y03(x); if(y>0){if(n==0) M(x,y) else L(x,y)} else break;} fprintf(o,"0 0 0 RGB .4 W S\n");
DO(n,400){x=n-200.; y=d03(x); if(y>0){if(n==0) M(x,y) else L(x,y)} else break;} fprintf(o,"0 0 0 RGB .4 W S\n");
DO(n,400){x=n-200.; y=e03(x); if(y>0){if(n==0) M(x,y) else L(x,y)} else break;} fprintf(o,"0 0 0 RGB 1 setlinejoin .1 W S\n");
 
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
      system("epstopdf 15.eps");
      system( "open 15.pdf");
}

Latest revision as of 19:58, 11 March 2022

Summary

Importing file

File history

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

Date/TimeThumbnailDimensionsUserComment
current19:58, 11 March 2022Thumbnail for version as of 19:58, 11 March 2022693 × 680 (110 KB)Maintenance script (talk | contribs)== Summary == Importing file

There are no pages that use this file.

Metadata