// Elenco delle librerie e delle relative funzioni in esse incluse // LIBRERIA g n r a n d o m . t x t ( per generare esercizi e in generale funzioni matematiche) // en(x) Esponential Notation // trunc(x,n) // sn(x) Scientifi Notatio // intrnd(a,b) // realrnd(a,b) // trunc(x,n) //............................................................................................. // LIBRERIA: g n g r a p h . t x t ( per fare grafica) // // per disegnare un punto // setPoint(x,y); draw a point in x,y (black or of the color setted by setColor() // // // per tracciare 1)ARCHI, 2)IMMAGINI, 3)OVALI, 4)LINEE, 5)RETTANGOLI, 6)SCRITTE // 1) drawArc(x,y,l,h,alpha0,alpha1): draw an arc of oval from alpha0 to alpha1 (radians) // 2) drawImage(x,y,fileName) : draws an image (fileName) in x,y // 3) drawOval(x,y,width,heigth): draw an oval (or circle) (use last setColor color) // 4) drawLine(x0,y0,x1,y1): draws a line from x0,y0 to x1,y1 // 5) drawRect(x0,y0,width,heigth): draws a rectangle // 6) drawString(s,x,y): draws a strings s in x,y // // per figure piene: 1)ARCO, 2)RETTANGOLO, 3)OVALE // 1) fillArc(x,y,l,h,alpha0,alpha1): draw a filled arc of oval from alpha0 to alpha1 (radians) // 2) fillRect(x0,y0,width,heigth,color): draw a filled rectangle (need color) // 3) fillOval(x,y,width,heigth): draw a filled oval (or circle) (use last setColor color) // // per impostare il colore // setColor(c); sets the color of next figures to be c (unsetted color is black) // // //............................................................................................. //............................................................................................. // LIBRERIA g n m a t h . t x t (per usare simboli matematici) // // // COSTANTI ALFANUMERICHE // a,b,....,z :variabili definite come 'a','b',...,'z' // A,B,....,Z :variabili definite come 'A','B',...,'Z' // // VARIABILI Matematiche // Parentesi, integrali, radici: // agBig, ag, cg , cgBig (Aperta Graffa Big, Aperta Graffa, Chiusa Graffa, Chiusa Graffa Big) // aqBig, aq, cq, cqBig idem per la quadra // atBig, at, ct,ctBig tonda // int,intBig integrale,integrale da 3 linee // bra,ket minore,maggiore // overscore tratto sopra // root radice // Sigma,PI sommatoria, produttoria // Lettere greche // aleph,alpha,beta,csi,Csi,delta,Delta,epsilon,erba,eta,gamma,Gamma, // iota ,Jota,Kappa,kappa,lambda,Lambda,mu,nolispe,nu,omega,Omega,omegabar // phi,Phi,pi,PI,psi,PSI,rho,sigma,Sigma // Simboli: // Uguale, circa, minore etc.. // approx uguale con circa // bitilde circa con due tildi // bra,ket minore, maggiore // coincide coincidenza (uguale con tre linee) // leq lower equal (minore o uguale) // lt lowet than (minore) // ne not equal (diverso) // pm piu'/meno // Freccie // bifreccia,biimp: doppia freccia singola sx-dx,doppia freccia doppia (biimplicazione) // downarrow,Downarrow: freccia giu, doppia freccia gił // leftarrow,Lefttarrow: freccia a sinista, doppia freccia a sinistra // rightarrow , Rigtharrow: freccia a destra, doppia freccia a destra // Insiemi // Re: R di Insieme dei numeri reali // not: segno di not // forall: qualsiasi , ge , grades , gt , H , I , imm , include , // empty: insieme vuoto // exists: esiste // nolispe: epsilon ruotato a dx // inset,notinset: appartiene, non appartiene // cup: unione (U) // noinclude: non include // included: incluso // includedeq: incluso o uguale // includeeq:include o uguale // Altro // pc: non so // pe: non so // angle: angolo // infty: infinito // cap: circonflesso // cuori: carta di cuori // diesis: # // dots: 3 puntini di continuazione // lev: non ricordo // diff: derivata parziale // dot: puntino centrale per il per // line: non ricordo // nablagiu: triangolo // PPI: non ricordo // prop: non ricordo // pv: non ricordo // qp: non ricordo // ret: non ricordo // Speciali // cr: carriage return (a capo) // dp: non ricordo // cuori,quadri,fiori,picche: carta di fiori // registered: R nel cerchietto // square: quadrato // SSigma: non ricordo // operazionii // plus,minus,times,dot,star: piu',meno,per (croce),per (punto),asterisco // // Raggiungili comunque da tastiera in notepad o similari // and: e commerciale // apix: apice // bar: barra verticale // biapix: doppio apice // comma: virgola // point: punto // slash: barra piegata a destra // _include,_aleph,... :variabili con un spazio davanti // include_,aleph_,... :variabili con un spazio in fondo // _include_,_aleph_,... :variabili con un spazio davanti e in fondo , T , tau , teta , tilde , times , tm , tp , tp , Tr , tra , tx , underscore , Uparrow , vel , X , Y , yupsilon , Z , zeta bold(a,b,...,u) :restituisce in bold la stringa a+b+....+u compatta(a,b,...,u) :restituisce la stringa a+b+..+u (come join) compattaABvC(X,y,Z):restituisce una stringa X+(B+y[0],B+y[1],..,B+y[n-1])+Z ;serve per costruire righe o colonne (header, corpo ripetuto, tail) fontChar(f,c) :restituisce il carattere numero c del font f. frac(num,den) :restituiste la stringa html per stampare una frazione join(a,b,...,u) :restituisce una stringa a+b+...+u (per continuare a usare la virgola come accorpatore) l(a,b,...,u) :restituisce una stringa dove a,b,...,u sono impacchettati in una riga di tabella in modo da impedire al browser di andare a capo, in pratica forza la stampa in linea lc(a,b,...,u) :come l() ma con centratura verticale (utile per le frazioni) mat31(a,b,c) :restituisce 3 dati incolonnati log10(x) :restituisce LOG in base 10 di x overline(x) :per mettere il simbolo di vettore su x pow(a,b) :restituisce b in apice rispetto ad a red(a,b,...,u) :restituisce in bold la stringa a+b+....+u say('x') :stampa il nome di una variabile seguito dal suo valore sayl('x') :idem e va a capo ssay('a','b',...,'u') :stampa il nome e i valori di una lista di variabili saySymbols() :stampa tutti i simboli presenti in gnmath toVett(a,b,...,u) :restituisce un 'vettore' con dentro a,b,...,u w(x) :stampa x ww(a,b,.....,u) :stampa a,b,...,u wwl(a,b,....,u) :stampa a,b,...,u e poi va a capo */ function ww(){w(compattaABvC("","",arguments,""))}// stampa tutte le stringhe-argomenti passate function wwl(){w(compattaABvC("","",arguments,"")+'
')}// stampa tutte le stringhe-argomenti passate function log10(x){return Math.LOG10E*Math.log(x);} function say(x){eval("ww('"+x+"=',"+x+")")} function ssay(){ for(var i=0;i')")} function w(x){document.writeln(x)} // stampa semplice function l(){return compattaABvC("","
",arguments,"
")} //restituisce in linea function lc(){return compattaABvC("","
",arguments,"
")}// idem centrata verticalmente function join(){return(compattaABvC("","",arguments,""))} function fontChar(f,c){ return ""+String.fromCharCode(c)+""} var p="+",t="*",m="-",d=":"; // operatori aritmetici var plus="+", time="*", menus="-", divide=":"; var x="x",y="y",z="z",a="a",b="b",c="c",d="d";e="e",o="o";A="A",B="B",C="C",D="D"; // variabili var sx=" x ",sy=" y ",sz=" z ",sa=" a ",sb=" b ",sc=" c ",se=" e ",so=" o ";sA=" A ",sB=" B ",sC=" C "; // variabili con spazio var comma=",";eq="="; var bar="|";var _bar=" |";var bar_="| ";var _bar_=" | " // simboli comunque accessibili da tastiera var ag="{",cg="}",aq="[",cq="]",at="(",ct=")"; // parentesi (a)perte e (c)hiuse var s=" ",sp=s+s;spa=s+s+s;spac=s+s+s+s;space=s+s+s+s+s; // spazi pił o meno lunghi // abbreviazioni di comandi html /* momentaneamente sospesa function html(){ var s=""; for(var i=0;i" } return s; } */ // PARENTESI GRANDI ************** var atUP = fontChar("Symbol",230);var atMIDDLE = fontChar("Symbol",231); var atBOTTOM = fontChar("Symbol",232);var ctUP = fontChar("Symbol",246); var ctMIDDLE = fontChar("Symbol",247);var ctBOTTOM = fontChar("Symbol",248); var atBig= mat31(atUP,atMIDDLE,atBOTTOM) var ctBig= mat31(ctUP,ctMIDDLE,ctBOTTOM) var aqUP = fontChar("Symbol",233);var aqMIDDLE = fontChar("Symbol",234); var aqBOTTOM = fontChar("Symbol",235);var cqUP = fontChar("Symbol",249); var cqMIDDLE = fontChar("Symbol",250);var cqBOTTOM = fontChar("Symbol",251); var aqBig = mat31(aqUP,aqMIDDLE,aqBOTTOM) var cqBig = mat31(cqUP,cqMIDDLE,cqBOTTOM) var agUP = fontChar("Symbol",236);var agMIDDLE = fontChar("Symbol",237); var agBOTTOM = fontChar("Symbol",238);var cgUP = fontChar("Symbol",252); var cgMIDDLE = fontChar("Symbol",253);var cgBOTTOM = fontChar("Symbol",254); var agBig = mat31(agUP,agMIDDLE,agBOTTOM) var cgBig = mat31(cgUP,cgMIDDLE,cgBOTTOM) var intUP = fontChar("Symbol",243);var agMIDDLE = fontChar("Symbol",237); var intOTTOM = fontChar("Symbol",244);var cgUP = fontChar("Symbol",252); var intMIDDLE = fontChar("Symbol",245);var cgBOTTOM = fontChar("Symbol",254); var intBig = mat31(agUP,agMIDDLE,cgBOTTOM) var intLittle = fontChar("Symbol",242);var agMIDDLE = fontChar("Symbol",237); // ********************************************** function pow(a,b){ return a+""+b+"" } // FUNZIONI A NUMERO DI ARGOMENTI VARIABILE function toVett(){return arguments} function compatta(x){var s="";for(var i=0;i","",arguments,"")} // compatta con prefisso, infisso e suffisso function mat31(a,b,c){ // restituisce 3 dati incolonnati return "
"+a+ "
"+b+ "
"+c+"
" } function red(){return compattaABvC("","",arguments,"")} function frac(num,den){ return mat31(num,"
",den)} // frazione function overline(x){ return ""+ ""+ "

"+ x+"
" } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::// // // Here (using the 'interpret' instruction ie 'eval' ) are constructed the constants // you will use; For each of the character of the font SYMBOL either is unusefull ("a") or // it is the symbol we need, for example 'include'. The eval instructions will construct the variable // var cdot='.'; var simbols=[ "a","a","a","a","a","a","a","a","a","a" //1-10 ,"a","a","a","a","a","a","a","a","a","a" //11-20 ,"a","a","a","a","a","a","a","a","a","a" //21-30 ,"a","a","a","pe","forall","diesis","exists","pc","and","nolispe" //31-40 ,"at","ct","star","plus","comma","minus","point","slash","n0","n1" //41-50 ,"n2","n3","n4","n5","n6","n7","n8","n9","dp","pv" //51-60 ,"lt","eq","gt","qp","approx","A","B","X","Delta","E" //61-70 ,"Phi","Gamma","H","I","Jota","Kappa","Lambda","M","N","O" //71-80 ,"PI","Omega","P","Sigma","T","Y","Csi","Omega","Csi","Psi" //81-90 ,"Z","aq","tp","cq","Tr","underscore","overscore","alpha","beta","csi" //91-100 ,"delta","epsilon","phi","gamma","eta","iota","psi","kappa","lambda","mu"//101-110 ,"nu","o","pi","teta","rho","sigma","tau","nu","omegabar","omega" //111-120 ,"yupsilon","psi","zeta","ag","bar","cg","tilde","a","a","a" //121-130 ,"a","a","a","a","a","a","a","a","a","a" //131-140 ,"a","a","a","a","a","a","a","a","a","a" //141-150 ,"a","a","a","a","a","a","a","a","a","a" //151-160 ,"a","erba","apix","leq","a","infty","f","fiori","quadri","cuori" //161-170 ,"picche","bifreccia","leftarrow","a","rightarrow","downarrow","grades","pm","biapix","ge" //171-180 ,"times","prop","diff","dot","tra","ne","coincide","bitilde","dots","bar"//181-190 ,"line","ret","aleph","imm","Re","p","tx","tp","empty","cap" //191-200 ,"cup","include","includeeq","noinclude","included","includedeq","inset","notinset","angle","nablagiu"//201-210 ,"registered","cr","tm","PPI","root","dot","not","vel","lev","biimp" //211-220 ,"Lefttarrow","Uparrow","Rigtharrow","Downarrow","bra","a","a","a","SSigma",//221-230 ,"atTOP","atMIDDLE","ctBOTTOM","aqTOP","aqMIDDLE","aqBOTTOM","agTOP","agMIDDLE","agBOTTOM","a"//231-240 ,"square","ket","int","intTOP","intMIDDLE","intBOTTOM","ctTOP","ctMIDDLE","ctBOTTOM"//241-250 ,"cqTOP","cqMIDDLE","cqBOTTOM","cgTOP","cgMIDDLE","cgBOTTOM","a","a","a"//251-255?? ]; // Constructing variable (also with a space in front and/or at end for emproving printing) // _diesis will be " #" , _diesis_ will be " # " // for(var k=33;k<255;k++){ if(k==39){nolispe=fontChar("Symbol",39);continue} zz=( "var "+ simbols[k] + "='" +fontChar("Symbol",k) +"';" ) zpre=( "var _"+ simbols[k] + "= '" +fontChar("Symbol",k) +"';" ) zpost=( "var "+ simbols[k] + "_='" +fontChar("Symbol",k) +" ';" ) zprepost=( "var _"+ simbols[k] + "_=' " +fontChar("Symbol",k) +" ';" ) eval(zz);eval(zpre);eval(zpost);eval(zprepost); } // // //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // Here we define variable _a= "a" and _b="b" and _A="A" and _B="B" in order to use them without // opening and closin apix // It has been choseen to use _a to let free for the user the a variable or the i variable // hoping user is not used to use underscore!! // Here there is no multiple declaration with blank so if you want to write " a " just write " a ". var autodefined=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; for(var k=0;k