File:ExampleEquationLog01.png: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Dmitrii Kouznetsov
m (remove extra copyright license)
(== Summary == Importing file)
Tag: Server-side upload
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Summary ==
== Summary ==
{{Image notes bypermission
Importing file
|Description                =
|Author                    =Dmitrii Kouznetsov
|Date                      =2008
|Source                    =
//Example of graphic soluiton of equation
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
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,"/times-Roman findfont 6 scalefont setfont\n");
        fprintf(O,"/W {setlinewidth} bind def\n");
        fprintf(O,"/RGB {setrgbcolor} bind def\n");}
#define DO(x,y) for(x=0;x<y;x++)
main(){ FILE *o; o=fopen("log.eps","w"); ado(o,800,800);
fprintf(o,"10 10 scale\n");
fprintf(o,"10 10 translate\n");
#define M(x,y) fprintf(o,"%5.2f %5.2f M\n",10.*(x),10.*(y));
#define L(x,y) fprintf(o,"%5.2f %5.2f L\n",10.*(x),10.*(y));
M(0,6.3)L(0,0) L(6.3,0)
fprintf(o,".3 W S\n");
int n; DB x,y,t;
for(n=1;n<7;n++){M(0,n)L(6,n)}  fprintf(o,".06 W S\n");
for(n=0;n<6;n++){M(-.4,n-.18) fprintf(o,"(%1d)s\n",n);}
for(n=1;n<7;n++){x=1*n;M(x,0)L(x,6)}
M(-.5,M_E)L(6,M_E)
M(M_E,-.5)L(M_E,6)
fprintf(o,".06 W S\n");
for(n=1;n<6;n+=1){x=1*n;M(x-.16,-.5) fprintf(o,"(%1.0f)s\n",x);}
M(0,0)L(7,7)
fprintf(o,".4 W S\n");
M(-.8,M_E-.16) fprintf(o,"(e)s\n");
M(M_E-.14,-.8) fprintf(o,"(e)s\n");
fprintf(o,"/Times-Italic findfont 6 scalefont setfont\n");
M(-0.5,6) fprintf(o,"(y)s\n");
M(6,-0.5) fprintf(o,"(x)s\n");
for(n=0;n<70;n+=2){x=.8+.02*n+.001*n*n;y=log(x)/log(sqrt(2.));
if(n==0)M(x,y)else L(x,y)}
fprintf(o,"1 0 0 RGB 0.3 W S\n");
for(n=0;n<70;n+=2){x=.7+.02*n+.001*n*n;y=log(x)/log(exp(1/M_E));  if(n==0)M(x,y)else L(x,y)}
fprintf(o,"0 .8 0 RGB 0.3 W S\n");
for(n=0;n<70;n+=2){x=.6+.02*n+.001*n*n;y=log(x)/log (2.);  if(n==0)M(x,y)else L(x,y)}
fprintf(o,"0 0 1 RGB 0.3 W S\n");
fprintf(o,"showpage\n");
fprintf(o,"%cTrailer\n",'%');
fclose(o);
}
|Country first published in =Japan
|Copyright holder          =Dmitrii Kouznetsov
|Notes                      = Use it for free: copy, distribute, modify as you like. Indicate the source and mention that you have modified it if you did.
|Other versions            =
}}
== Licensing/Copyright status ==
{{attribution}}

Latest revision as of 18: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
current18:55, 11 March 2022Thumbnail for version as of 18:55, 11 March 20221,600 × 1,600 (103 KB)Maintenance script (talk | contribs)== Summary == Importing file

Metadata