File:2014ruble17t.png: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Dmitrii Kouznetsov
No edit summary
(== Summary == Importing file)
Tag: Server-side upload
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Summary ==
== Summary ==
{{Image_Details|user
Importing file
|description  = Approximations of price or the Russian [[rouble]] ([[ruble]]), measured in the Japanese yens, in the USA cents and in Euro cents for the end of year 2014
|author      = [[User:Dmitrii Kouznetsov|Dmitrii Kouznetsov]] ([[User talk:Dmitrii Kouznetsov|talk]])
|date-created = 2014.12.17
|pub-country  = Japan
|notes        =
|versions    = http://mizugadro.mydns.jp/t/index.php/File:2014ruble17t.png
}}
== Licensing ==
{{CC|by|3.0}}
 
==[[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++)
#include"ado.cin"
/*
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 B=.9;
        DB B=.84;
 
// DB y03(DB t){DB x,y; x=.01*t; return 160.*sqrt((2.64+x)*(B-x));}
// DB y03(DB t){DB x,y; x=.01*t; return 180.*sqrt((2.34+x)*(B-x));}
        DB y03(DB t){DB x,y; x=.01*t; return 200.*sqrt((2.10+x)*(B-x));}
 
// DB d03(DB t){DB x,y; x=.01*t; return 128.*sqrt((3.5+x)*(B-x));}
// DB d03(DB t){DB x,y; x=.01*t; return 142.*sqrt((3.12+x)*(B-x));}
        DB d03(DB t){DB x,y; x=.01*t; return 146.*sqrt((3.12+x)*(B-x));}
 
// DB e03(DB t){DB x,y; x=.01*t; return 110.*sqrt((2.9+x)*(B-x));}
// DB e03(DB t){DB x,y; x=.01*t; return 130.*sqrt((2.34+x)*(B-x));}
        DB e03(DB t){DB x,y; x=.01*t; return 134.*sqrt((2.34+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;
//i=fopen("eurodata.txt","r");
int zero=daju24(2014,10,27); //Date of beginning of the project
 
o=fopen("17.eps","w"); ado(o,202,302);
#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,"101 1 translate 2 setlinecap\n");
for(n=0;n<301;n+=50) { M(-100,n)L(100,n)}
for(n=-100;n<201;n+=50) {M(n,0)L(n,300)}
fprintf(o,"0 0 0 RGB 2 setlinecap .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 1 W 1 setlinejoin \n");
fprintf(o,"1 setlinejoin \n");
//M(t[0],g[0]); for(n=1;n<N;n++) L(t[n],g[n]);
M(t[0],g[0]);for(n=1;n<N;n++){L(t[n],g[n]) if(t[n]<-100) break;}
fprintf(o,"0 .9 0 RGB 9 W S\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 1 W\n"); DO(n,N) o(t[n],g[n]);
//M(t[0],g[0]); for(n=1;n<N;n++) L(t[n],g[n]);
M(t[0],g[0]);for(n=1;n<N;n++){L(t[n],g[n]) if(t[n]<-100) break;}
fprintf(o,"0 .6 1 RGB 6 W S\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%2d%lf",&Y,&c1,&M,&c2,&D, &di,&dr); if(j<3) break;
        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 1 W\n"); DO(n,N) o(t[n],g[n]);
M(t[0],g[0]);for(n=1;n<N;n++){L(t[n],g[n]) if(t[n]<-100) break;}
fprintf(o,"1 0 0 RGB 6 W S\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 17.eps");
      system( "open 17.pdf");
}

Latest revision as of 19:55, 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:55, 11 March 2022Thumbnail for version as of 19:55, 11 March 2022456 × 664 (98 KB)Maintenance script (talk | contribs)== Summary == Importing file

There are no pages that use this file.

Metadata