diff --git a/ccm-core/web/assets/xinha/plugins/Equation/ASCIIMathML.js b/ccm-core/web/assets/xinha/plugins/Equation/ASCIIMathML.js index 9846c30e4..e89738a9b 100644 --- a/ccm-core/web/assets/xinha/plugins/Equation/ASCIIMathML.js +++ b/ccm-core/web/assets/xinha/plugins/Equation/ASCIIMathML.js @@ -1,2 +1,2 @@ /* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ -var mathcolor="blue";var mathfontsize="1em";var mathfontfamily="serif";var automathrecognize=false;var checkForMathML=true;var notifyIfNoMathML=true;var alertIfNoMathML=false;var translateOnLoad=true;var translateLaTeX=true;var translateLaTeXformatting=true;var translateASCIIMath=true;var translateASCIIsvg=true;var avoidinnerHTML=false;var displaystyle=true;var showasciiformulaonhover=true;var decimalsign=".";var AMdelimiter1="`",AMescape1="\\\\`";var AMdocumentId="wikitext";var checkforprocessasciimathinmoodle=false;var dsvglocation="";var isIE=document.createElementNS==null;var noMathML=false,translated=false;if(isIE){document.write('');document.write('')}function setStylesheet(a){var c="AMMLcustomStyleSheet";var b=document.getElementById(c);if(document.createStyleSheet){if(b){b.parentNode.removeChild(b)}document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," ")}else{if(b){b.replaceChild(document.createTextNode(a),b.firstChild)}else{b=document.createElement("style");b.type="text/css";b.id=c;b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)}}}setStylesheet("#AMMLcloseDiv {font-size:0.8em; padding-top:1em; color:#014}\n#AMMLwarningBox {position:absolute; width:100%; top:0; left:0; z-index:200; text-align:center; font-size:1em; font-weight:bold; padding:0.5em 0 0.5em 0; color:#ffc; background:#c30}");function init(){var b,a=new Array();if(document.getElementById==null){alert("This webpage requires a recent browser such as Mozilla Firefox/Netscape 7+ or Internet Explorer 6+ with MathPlayer and Adobe SVGviewer");return null}if(checkForMathML&&(b=checkMathML())){a.push(b)}if(checkIfSVGavailable&&(b=checkSVG())){a.push(b)}if(a.length>0){displayWarnings(a)}if(!noMathML){initSymbols()}return true}function checkMathML(){if(navigator.appName.slice(0,8)=="Netscape"){if(navigator.appVersion.slice(0,1)>="5"){noMathML=null}else{noMathML=true}}else{if(navigator.appName.slice(0,9)=="Microsoft"){try{var c=new ActiveXObject("MathPlayer.Factory.1");noMathML=null}catch(a){noMathML=true}}else{if(navigator.appName.slice(0,5)=="Opera"){if(navigator.appVersion.slice(0,3)>="9.5"){noMathML=null}else{noMathML=true}}}}if(noMathML&¬ifyIfNoMathML){var b="To view the ASCIIMathML notation use Internet Explorer + MathPlayer or Mozilla Firefox 2.0 or later.";if(alertIfNoMathML){alert(b)}else{return b}}}function hideWarning(){var a=document.getElementsByTagName("body")[0];a.removeChild(document.getElementById("AMMLwarningBox"));a.onclick=null}function displayWarnings(b){var c,g,f=createElementXHTML("div");var a=document.getElementsByTagName("body")[0];a.onclick=hideWarning;f.id="AMMLwarningBox";for(c=0;c=",tag:"mo",output:"\u2265",tex:"ge",ttype:CONST},{input:"geq",tag:"mo",output:"\u2265",tex:null,ttype:CONST},{input:"-<",tag:"mo",output:"\u227A",tex:"prec",ttype:CONST},{input:"-lt",tag:"mo",output:"\u227A",tex:null,ttype:CONST},{input:">-",tag:"mo",output:"\u227B",tex:"succ",ttype:CONST},{input:"-<=",tag:"mo",output:"\u2AAF",tex:"preceq",ttype:CONST},{input:">-=",tag:"mo",output:"\u2AB0",tex:"succeq",ttype:CONST},{input:"in",tag:"mo",output:"\u2208",tex:null,ttype:CONST},{input:"!in",tag:"mo",output:"\u2209",tex:"notin",ttype:CONST},{input:"sub",tag:"mo",output:"\u2282",tex:"subset",ttype:CONST},{input:"sup",tag:"mo",output:"\u2283",tex:"supset",ttype:CONST},{input:"sube",tag:"mo",output:"\u2286",tex:"subseteq",ttype:CONST},{input:"supe",tag:"mo",output:"\u2287",tex:"supseteq",ttype:CONST},{input:"-=",tag:"mo",output:"\u2261",tex:"equiv",ttype:CONST},{input:"~=",tag:"mo",output:"\u2245",tex:"cong",ttype:CONST},{input:"~~",tag:"mo",output:"\u2248",tex:"approx",ttype:CONST},{input:"prop",tag:"mo",output:"\u221D",tex:"propto",ttype:CONST},{input:"and",tag:"mtext",output:"and",tex:null,ttype:SPACE},{input:"or",tag:"mtext",output:"or",tex:null,ttype:SPACE},{input:"not",tag:"mo",output:"\u00AC",tex:"neg",ttype:CONST},{input:"=>",tag:"mo",output:"\u21D2",tex:"implies",ttype:CONST},{input:"if",tag:"mo",output:"if",tex:null,ttype:SPACE},{input:"<=>",tag:"mo",output:"\u21D4",tex:"iff",ttype:CONST},{input:"AA",tag:"mo",output:"\u2200",tex:"forall",ttype:CONST},{input:"EE",tag:"mo",output:"\u2203",tex:"exists",ttype:CONST},{input:"_|_",tag:"mo",output:"\u22A5",tex:"bot",ttype:CONST},{input:"TT",tag:"mo",output:"\u22A4",tex:"top",ttype:CONST},{input:"|--",tag:"mo",output:"\u22A2",tex:"vdash",ttype:CONST},{input:"|==",tag:"mo",output:"\u22A8",tex:"models",ttype:CONST},{input:"(",tag:"mo",output:"(",tex:null,ttype:LEFTBRACKET},{input:")",tag:"mo",output:")",tex:null,ttype:RIGHTBRACKET},{input:"[",tag:"mo",output:"[",tex:null,ttype:LEFTBRACKET},{input:"]",tag:"mo",output:"]",tex:null,ttype:RIGHTBRACKET},{input:"{",tag:"mo",output:"{",tex:null,ttype:LEFTBRACKET},{input:"}",tag:"mo",output:"}",tex:null,ttype:RIGHTBRACKET},{input:"|",tag:"mo",output:"|",tex:null,ttype:LEFTRIGHT},{input:"(:",tag:"mo",output:"\u2329",tex:"langle",ttype:LEFTBRACKET},{input:":)",tag:"mo",output:"\u232A",tex:"rangle",ttype:RIGHTBRACKET},{input:"<<",tag:"mo",output:"\u2329",tex:null,ttype:LEFTBRACKET},{input:">>",tag:"mo",output:"\u232A",tex:null,ttype:RIGHTBRACKET},{input:"{:",tag:"mo",output:"{:",tex:null,ttype:LEFTBRACKET,invisible:true},{input:":}",tag:"mo",output:":}",tex:null,ttype:RIGHTBRACKET,invisible:true},{input:"int",tag:"mo",output:"\u222B",tex:null,ttype:CONST},{input:"dx",tag:"mi",output:"{:d x:}",tex:null,ttype:DEFINITION},{input:"dy",tag:"mi",output:"{:d y:}",tex:null,ttype:DEFINITION},{input:"dz",tag:"mi",output:"{:d z:}",tex:null,ttype:DEFINITION},{input:"dt",tag:"mi",output:"{:d t:}",tex:null,ttype:DEFINITION},{input:"oint",tag:"mo",output:"\u222E",tex:null,ttype:CONST},{input:"del",tag:"mo",output:"\u2202",tex:"partial",ttype:CONST},{input:"grad",tag:"mo",output:"\u2207",tex:"nabla",ttype:CONST},{input:"+-",tag:"mo",output:"\u00B1",tex:"pm",ttype:CONST},{input:"O/",tag:"mo",output:"\u2205",tex:"emptyset",ttype:CONST},{input:"oo",tag:"mo",output:"\u221E",tex:"infty",ttype:CONST},{input:"aleph",tag:"mo",output:"\u2135",tex:null,ttype:CONST},{input:"...",tag:"mo",output:"...",tex:"ldots",ttype:CONST},{input:":.",tag:"mo",output:"\u2234",tex:"therefore",ttype:CONST},{input:"/_",tag:"mo",output:"\u2220",tex:"angle",ttype:CONST},{input:"\\ ",tag:"mo",output:"\u00A0",tex:null,ttype:CONST},{input:"quad",tag:"mo",output:"\u00A0\u00A0",tex:null,ttype:CONST},{input:"qquad",tag:"mo",output:"\u00A0\u00A0\u00A0\u00A0",tex:null,ttype:CONST},{input:"cdots",tag:"mo",output:"\u22EF",tex:null,ttype:CONST},{input:"vdots",tag:"mo",output:"\u22EE",tex:null,ttype:CONST},{input:"ddots",tag:"mo",output:"\u22F1",tex:null,ttype:CONST},{input:"diamond",tag:"mo",output:"\u22C4",tex:null,ttype:CONST},{input:"square",tag:"mo",output:"\u25A1",tex:null,ttype:CONST},{input:"|__",tag:"mo",output:"\u230A",tex:"lfloor",ttype:CONST},{input:"__|",tag:"mo",output:"\u230B",tex:"rfloor",ttype:CONST},{input:"|~",tag:"mo",output:"\u2308",tex:"lceiling",ttype:CONST},{input:"~|",tag:"mo",output:"\u2309",tex:"rceiling",ttype:CONST},{input:"CC",tag:"mo",output:"\u2102",tex:null,ttype:CONST},{input:"NN",tag:"mo",output:"\u2115",tex:null,ttype:CONST},{input:"QQ",tag:"mo",output:"\u211A",tex:null,ttype:CONST},{input:"RR",tag:"mo",output:"\u211D",tex:null,ttype:CONST},{input:"ZZ",tag:"mo",output:"\u2124",tex:null,ttype:CONST},{input:"f",tag:"mi",output:"f",tex:null,ttype:UNARY,func:true},{input:"g",tag:"mi",output:"g",tex:null,ttype:UNARY,func:true},{input:"lim",tag:"mo",output:"lim",tex:null,ttype:UNDEROVER},{input:"Lim",tag:"mo",output:"Lim",tex:null,ttype:UNDEROVER},{input:"sin",tag:"mo",output:"sin",tex:null,ttype:UNARY,func:true},{input:"cos",tag:"mo",output:"cos",tex:null,ttype:UNARY,func:true},{input:"tan",tag:"mo",output:"tan",tex:null,ttype:UNARY,func:true},{input:"sinh",tag:"mo",output:"sinh",tex:null,ttype:UNARY,func:true},{input:"cosh",tag:"mo",output:"cosh",tex:null,ttype:UNARY,func:true},{input:"tanh",tag:"mo",output:"tanh",tex:null,ttype:UNARY,func:true},{input:"cot",tag:"mo",output:"cot",tex:null,ttype:UNARY,func:true},{input:"sec",tag:"mo",output:"sec",tex:null,ttype:UNARY,func:true},{input:"csc",tag:"mo",output:"csc",tex:null,ttype:UNARY,func:true},{input:"log",tag:"mo",output:"log",tex:null,ttype:UNARY,func:true},{input:"ln",tag:"mo",output:"ln",tex:null,ttype:UNARY,func:true},{input:"det",tag:"mo",output:"det",tex:null,ttype:UNARY,func:true},{input:"dim",tag:"mo",output:"dim",tex:null,ttype:CONST},{input:"mod",tag:"mo",output:"mod",tex:null,ttype:CONST},{input:"gcd",tag:"mo",output:"gcd",tex:null,ttype:UNARY,func:true},{input:"lcm",tag:"mo",output:"lcm",tex:null,ttype:UNARY,func:true},{input:"lub",tag:"mo",output:"lub",tex:null,ttype:CONST},{input:"glb",tag:"mo",output:"glb",tex:null,ttype:CONST},{input:"min",tag:"mo",output:"min",tex:null,ttype:UNDEROVER},{input:"max",tag:"mo",output:"max",tex:null,ttype:UNDEROVER},{input:"uarr",tag:"mo",output:"\u2191",tex:"uparrow",ttype:CONST},{input:"darr",tag:"mo",output:"\u2193",tex:"downarrow",ttype:CONST},{input:"rarr",tag:"mo",output:"\u2192",tex:"rightarrow",ttype:CONST},{input:"->",tag:"mo",output:"\u2192",tex:"to",ttype:CONST},{input:">->",tag:"mo",output:"\u21A3",tex:"rightarrowtail",ttype:CONST},{input:"->>",tag:"mo",output:"\u21A0",tex:"twoheadrightarrow",ttype:CONST},{input:">->>",tag:"mo",output:"\u2916",tex:"twoheadrightarrowtail",ttype:CONST},{input:"|->",tag:"mo",output:"\u21A6",tex:"mapsto",ttype:CONST},{input:"larr",tag:"mo",output:"\u2190",tex:"leftarrow",ttype:CONST},{input:"harr",tag:"mo",output:"\u2194",tex:"leftrightarrow",ttype:CONST},{input:"rArr",tag:"mo",output:"\u21D2",tex:"Rightarrow",ttype:CONST},{input:"lArr",tag:"mo",output:"\u21D0",tex:"Leftarrow",ttype:CONST},{input:"hArr",tag:"mo",output:"\u21D4",tex:"Leftrightarrow",ttype:CONST},{input:"sqrt",tag:"msqrt",output:"sqrt",tex:null,ttype:UNARY},{input:"root",tag:"mroot",output:"root",tex:null,ttype:BINARY},{input:"frac",tag:"mfrac",output:"/",tex:null,ttype:BINARY},{input:"/",tag:"mfrac",output:"/",tex:null,ttype:INFIX},{input:"stackrel",tag:"mover",output:"stackrel",tex:null,ttype:BINARY},{input:"_",tag:"msub",output:"_",tex:null,ttype:INFIX},{input:"^",tag:"msup",output:"^",tex:null,ttype:INFIX},{input:"hat",tag:"mover",output:"\u005E",tex:null,ttype:UNARY,acc:true},{input:"bar",tag:"mover",output:"\u00AF",tex:"overline",ttype:UNARY,acc:true},{input:"vec",tag:"mover",output:"\u2192",tex:null,ttype:UNARY,acc:true},{input:"dot",tag:"mover",output:".",tex:null,ttype:UNARY,acc:true},{input:"ddot",tag:"mover",output:"..",tex:null,ttype:UNARY,acc:true},{input:"ul",tag:"munder",output:"\u0332",tex:"underline",ttype:UNARY,acc:true},{input:"text",tag:"mtext",output:"text",tex:null,ttype:TEXT},{input:"mbox",tag:"mtext",output:"mbox",tex:null,ttype:TEXT},AMquote,{input:"bb",tag:"mstyle",atname:"fontweight",atval:"bold",output:"bb",tex:null,ttype:UNARY},{input:"mathbf",tag:"mstyle",atname:"fontweight",atval:"bold",output:"mathbf",tex:null,ttype:UNARY},{input:"sf",tag:"mstyle",atname:"fontfamily",atval:"sans-serif",output:"sf",tex:null,ttype:UNARY},{input:"mathsf",tag:"mstyle",atname:"fontfamily",atval:"sans-serif",output:"mathsf",tex:null,ttype:UNARY},{input:"bbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",output:"bbb",tex:null,ttype:UNARY,codes:AMbbb},{input:"mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",output:"mathbb",tex:null,ttype:UNARY,codes:AMbbb},{input:"cc",tag:"mstyle",atname:"mathvariant",atval:"script",output:"cc",tex:null,ttype:UNARY,codes:AMcal},{input:"mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",output:"mathcal",tex:null,ttype:UNARY,codes:AMcal},{input:"tt",tag:"mstyle",atname:"fontfamily",atval:"monospace",output:"tt",tex:null,ttype:UNARY},{input:"mathtt",tag:"mstyle",atname:"fontfamily",atval:"monospace",output:"mathtt",tex:null,ttype:UNARY},{input:"fr",tag:"mstyle",atname:"mathvariant",atval:"fraktur",output:"fr",tex:null,ttype:UNARY,codes:AMfrk},{input:"mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",output:"mathfrak",tex:null,ttype:UNARY,codes:AMfrk}];function compareNames(b,a){if(b.input>a.input){return 1}else{return -1}}var AMnames=[];function initSymbols(){var b=[],a;for(a=0;a>1;if(b[a]=AMnames[a]}AMpreviousSymbol=AMcurrentSymbol;if(f!=""){AMcurrentSymbol=AMsymbols[d].ttype;return AMsymbols[d]}AMcurrentSymbol=CONST;a=1;m=h.slice(0,1);var l=true;while("0"<=m&&m<="9"&&a<=h.length){m=h.slice(a,a+1);a++}if(m==decimalsign){m=h.slice(a,a+1);if("0"<=m&&m<="9"){l=false;a++;while("0"<=m&&m<="9"&&a<=h.length){m=h.slice(a,a+1);a++}}}if((l&&a>1)||a>2){m=h.slice(0,a-1);n="mn"}else{a=2;m=h.slice(0,1);n=(("A">m||m>"Z")&&("a">m||m>"z")?"mo":"mi")}if(m=="-"&&AMpreviousSymbol==INFIX){AMcurrentSymbol=INFIX;return{input:m,tag:n,output:m,ttype:UNARY,func:true}}return{input:m,tag:n,output:m,ttype:CONST}}function AMremoveBrackets(b){var a;if(b.nodeName=="mrow"){a=b.firstChild.firstChild.nodeValue;if(a=="("||a=="["||a=="{"){b.removeChild(b.firstChild)}}if(b.nodeName=="mrow"){a=b.lastChild.firstChild.nodeValue;if(a==")"||a=="]"||a=="}"){b.removeChild(b.lastChild)}}}var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;function AMparseSexpr(h){var d,b,k,f,m,g=document.createDocumentFragment();h=AMremoveCharsAndBlanks(h,0);d=AMgetSymbol(h);if(d==null||d.ttype==RIGHTBRACKET&&AMnestingDepth>0){return[null,h]}if(d.ttype==DEFINITION){h=d.output+AMremoveCharsAndBlanks(h,d.input.length);d=AMgetSymbol(h)}switch(d.ttype){case UNDEROVER:case CONST:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode(d.tag,document.createTextNode(d.output)),h];case LEFTBRACKET:AMnestingDepth++;h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseExpr(h,true);AMnestingDepth--;if(typeof d.invisible=="boolean"&&d.invisible){b=createMmlNode("mrow",k[0])}else{b=createMmlNode("mo",document.createTextNode(d.output));b=createMmlNode("mrow",b);b.appendChild(k[0])}return[b,k[1]];case TEXT:if(d!=AMquote){h=AMremoveCharsAndBlanks(h,d.input.length)}if(h.charAt(0)=="{"){f=h.indexOf("}")}else{if(h.charAt(0)=="("){f=h.indexOf(")")}else{if(h.charAt(0)=="["){f=h.indexOf("]")}else{if(d==AMquote){f=h.slice(1).indexOf('"')+1}else{f=0}}}}if(f==-1){f=h.length}m=h.slice(1,f);if(m.charAt(0)==" "){b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b)}g.appendChild(createMmlNode(d.tag,document.createTextNode(m)));if(m.charAt(m.length-1)==" "){b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b)}h=AMremoveCharsAndBlanks(h,f+1);return[createMmlNode("mrow",g),h];case UNARY:h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseSexpr(h);if(k[0]==null){return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}if(typeof d.func=="boolean"&&d.func){m=h.charAt(0);if(m=="^"||m=="_"||m=="/"||m=="|"||m==","){return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}else{b=createMmlNode("mrow",createMmlNode(d.tag,document.createTextNode(d.output)));b.appendChild(k[0]);return[b,k[1]]}}AMremoveBrackets(k[0]);if(d.input=="sqrt"){return[createMmlNode(d.tag,k[0]),k[1]]}else{if(typeof d.acc=="boolean"&&d.acc){b=createMmlNode(d.tag,k[0]);b.appendChild(createMmlNode("mo",document.createTextNode(d.output)));return[b,k[1]]}else{if(!isIE&&typeof d.codes!="undefined"){for(f=0;f64&&m.charCodeAt(c)<91){l=l+String.fromCharCode(d.codes[m.charCodeAt(c)-65])}else{l=l+m.charAt(c)}}if(k[0].nodeName=="mi"){k[0]=createMmlNode("mo").appendChild(document.createTextNode(l))}else{k[0].replaceChild(createMmlNode("mo").appendChild(document.createTextNode(l)),k[0].childNodes[f])}}}}b=createMmlNode(d.tag,k[0]);b.setAttribute(d.atname,d.atval);return[b,k[1]]}}case BINARY:h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseSexpr(h);if(k[0]==null){return[createMmlNode("mo",document.createTextNode(d.input)),h]}AMremoveBrackets(k[0]);var a=AMparseSexpr(k[1]);if(a[0]==null){return[createMmlNode("mo",document.createTextNode(d.input)),h]}AMremoveBrackets(a[0]);if(d.input=="root"||d.input=="stackrel"){g.appendChild(a[0])}g.appendChild(k[0]);if(d.input=="frac"){g.appendChild(a[0])}return[createMmlNode(d.tag,g),a[1]];case INFIX:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode("mo",document.createTextNode(d.output)),h];case SPACE:h=AMremoveCharsAndBlanks(h,d.input.length);b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b);g.appendChild(createMmlNode(d.tag,document.createTextNode(d.output)));b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b);return[createMmlNode("mrow",g),h];case LEFTRIGHT:AMnestingDepth++;h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseExpr(h,false);AMnestingDepth--;var m="";if(k[0].lastChild!=null){m=k[0].lastChild.firstChild.nodeValue}if(m=="|"){b=createMmlNode("mo",document.createTextNode(d.output));b=createMmlNode("mrow",b);b.appendChild(k[0]);return[b,k[1]]}else{b=createMmlNode("mo",document.createTextNode("\u2223"));b=createMmlNode("mrow",b);return[b,h]}default:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}}function AMparseIexpr(h){var a,j,g,d,f,b;h=AMremoveCharsAndBlanks(h,0);j=AMgetSymbol(h);f=AMparseSexpr(h);d=f[0];h=f[1];a=AMgetSymbol(h);if(a.ttype==INFIX&&a.input!="/"){h=AMremoveCharsAndBlanks(h,a.input.length);f=AMparseSexpr(h);if(f[0]==null){f[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}else{AMremoveBrackets(f[0])}h=f[1];if(a.input=="_"){g=AMgetSymbol(h);b=(j.ttype==UNDEROVER);if(g.input=="^"){h=AMremoveCharsAndBlanks(h,g.input.length);var c=AMparseSexpr(h);AMremoveBrackets(c[0]);h=c[1];d=createMmlNode((b?"munderover":"msubsup"),d);d.appendChild(f[0]);d.appendChild(c[0]);d=createMmlNode("mrow",d)}else{d=createMmlNode((b?"munder":"msub"),d);d.appendChild(f[0])}}else{d=createMmlNode(a.tag,d);d.appendChild(f[0])}}return[d,h]}function AMparseExpr(p,q){var x,o,a,t,z=[],g=document.createDocumentFragment();do{p=AMremoveCharsAndBlanks(p,0);a=AMparseIexpr(p);o=a[0];p=a[1];x=AMgetSymbol(p);if(x.ttype==INFIX&&x.input=="/"){p=AMremoveCharsAndBlanks(p,x.input.length);a=AMparseIexpr(p);if(a[0]==null){a[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}else{AMremoveBrackets(a[0])}p=a[1];AMremoveBrackets(o);o=createMmlNode(x.tag,o);o.appendChild(a[0]);g.appendChild(o);x=AMgetSymbol(p)}else{if(o!=undefined){g.appendChild(o)}}}while((x.ttype!=RIGHTBRACKET&&(x.ttype!=LEFTRIGHT||q)||AMnestingDepth==0)&&x!=null&&x.output!="");if(x.ttype==RIGHTBRACKET||x.ttype==LEFTRIGHT){var v=g.childNodes.length;if(v>0&&g.childNodes[v-1].nodeName=="mrow"&&v>1&&g.childNodes[v-2].nodeName=="mo"&&g.childNodes[v-2].firstChild.nodeValue==","){var A=g.childNodes[v-1].lastChild.firstChild.nodeValue;if(A==")"||A=="]"){var c=g.childNodes[v-1].firstChild.firstChild.nodeValue;if(c=="("&&A==")"&&x.output!="}"||c=="["&&A=="]"){var d=[];var w=true;var l=g.childNodes.length;for(t=0;w&&t1){w=d[t].length==d[t-2].length}}if(w){var f,b,h,r,y=document.createDocumentFragment();for(t=0;t2){g.removeChild(g.firstChild);g.removeChild(g.firstChild)}y.appendChild(createMmlNode("mtr",f))}o=createMmlNode("mtable",y);if(typeof x.invisible=="boolean"&&x.invisible){o.setAttribute("columnalign","left")}g.replaceChild(o,g.firstChild)}}}}p=AMremoveCharsAndBlanks(p,x.input.length);if(typeof x.invisible!="boolean"||!x.invisible){o=createMmlNode("mo",document.createTextNode(x.output));g.appendChild(o)}}return[g,p]}function parseMath(c,b){var d,a;AMnestingDepth=0;d=b?LMparseExpr(c.replace(/^\s+/g,""),false,false)[0]:AMparseExpr(c.replace(/^\s+/g,""),false)[0];a=createMmlNode("mstyle",d);a.setAttribute("mathcolor",mathcolor);a.setAttribute("fontfamily",mathfontfamily);a.setAttribute("mathsize",mathfontsize);if(displaystyle){a.setAttribute("displaystyle","true")}a=createMmlNode("math",a);if(showasciiformulaonhover){a.setAttribute("title",c.replace(/\s+/g," "))}return a}function strarr2docFrag(a,d,g){var k=document.createDocumentFragment();var h=false;for(var f=0;f,\\|!:;'~]|\\.(?!(?:\x20|$))|"+k+l+a;var n=new RegExp("(^|\\s)((("+c+")\\s?)(("+c+g+")\\s?)+)([,.?]?(?=\\s|$))","g");m=m.replace(n," `$2`$7");var f=m.split(AMdelimiter1);var h=new RegExp("(^|\\s)([b-zB-HJ-Z+*<>]|"+b+k+a+")(\\s|\\n|$)","g");var d=new RegExp("(^|\\s)([a-z]|"+b+k+a+")([,.])","g");for(i=0;i1||k){if(!noMathML){a=strarr2docFrag(f,c.nodeType==8,b);var g=a.childNodes.length;c.parentNode.replaceChild(a,c);return g-1}else{return 0}}}}else{return 0}}else{if(c.nodeName!="math"){for(d=0;d",ttype:CONST},{input:"\\ne",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\neq",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\le",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leq",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\ge",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geq",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:CONST},{input:"\\ll",tag:"mo",output:"\u226A",ttype:CONST},{input:"\\gg",tag:"mo",output:"\u226B",ttype:CONST},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:CONST},{input:"\\prec",tag:"mo",output:"\u227A",ttype:CONST},{input:"\\succ",tag:"mo",output:"\u227B",ttype:CONST},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:CONST},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:CONST},{input:"\\subset",tag:"mo",output:"\u2282",ttype:CONST},{input:"\\supset",tag:"mo",output:"\u2283",ttype:CONST},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:CONST},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:CONST},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:CONST},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:CONST},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:CONST},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:CONST},{input:"\\sim",tag:"mo",output:"\u223C",ttype:CONST},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:CONST},{input:"\\approx",tag:"mo",output:"\u2248",ttype:CONST},{input:"\\cong",tag:"mo",output:"\u2245",ttype:CONST},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\in",tag:"mo",output:"\u2208",ttype:CONST},{input:"\\ni",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\owns",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\propto",tag:"mo",output:"\u221D",ttype:CONST},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:CONST},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:CONST},{input:"\\models",tag:"mo",output:"\u22A8",ttype:CONST},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\smile",tag:"mo",output:"\u2323",ttype:CONST},{input:"\\frown",tag:"mo",output:"\u2322",ttype:CONST},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:CONST},{input:"\\notin",tag:"mo",output:"\u2209",ttype:CONST},{input:"\\begin{eqnarray}",output:"X",ttype:MATRIX,invisible:true},{input:"\\begin{array}",output:"X",ttype:MATRIX,invisible:true},{input:"\\\\",output:"}&{",ttype:DEFINITION},{input:"\\end{eqnarray}",output:"}}",ttype:DEFINITION},{input:"\\end{array}",output:"}}",ttype:DEFINITION},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ieval:"2.2",ttype:BIG},{input:"\\Big",tag:"mo",output:"X",atval:"1.6",ieval:"2.6",ttype:BIG},{input:"\\bigg",tag:"mo",output:"X",atval:"2.2",ieval:"3.2",ttype:BIG},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ieval:"3.9",ttype:BIG},{input:"\\left",tag:"mo",output:"X",ttype:LEFTBRACKET},{input:"\\right",tag:"mo",output:"X",ttype:RIGHTBRACKET},{input:"{",output:"{",ttype:LEFTBRACKET,invisible:true},{input:"}",output:"}",ttype:RIGHTBRACKET,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:STRETCHY},{input:"[",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:STRETCHY},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:STRETCHY},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:STRETCHY},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:STRETCHY},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:STRETCHY},{input:"\\setminus",tag:"mo",output:"\\",ttype:CONST},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:SPACE},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:SPACE},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:SPACE},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:SPACE},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:SPACE},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:SPACE},{input:"\\prime",tag:"mo",output:"\u2032",ttype:CONST},{input:"'",tag:"mo",output:"\u02B9",ttype:CONST},{input:"''",tag:"mo",output:"\u02BA",ttype:CONST},{input:"'''",tag:"mo",output:"\u2034",ttype:CONST},{input:"''''",tag:"mo",output:"\u2057",ttype:CONST},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:CONST},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:CONST},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:CONST},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:CONST},{input:"\\forall",tag:"mo",output:"\u2200",ttype:CONST},{input:"\\exists",tag:"mo",output:"\u2203",ttype:CONST},{input:"\\Re",tag:"mo",output:"\u211C",ttype:CONST},{input:"\\Im",tag:"mo",output:"\u2111",ttype:CONST},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:CONST},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:CONST},{input:"\\ell",tag:"mo",output:"\u2113",ttype:CONST},{input:"\\wp",tag:"mo",output:"\u2118",ttype:CONST},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:CONST},{input:"\\infty",tag:"mo",output:"\u221E",ttype:CONST},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:DEFINITION},{input:"\\partial",tag:"mo",output:"\u2202",ttype:CONST},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:CONST},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:CONST},{input:"\\angle",tag:"mo",output:"\u2220",ttype:CONST},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:CONST},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:CONST},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\top",tag:"mo",output:"\u22A4",ttype:CONST},{input:"\\square",tag:"mo",output:"\u25AB",ttype:CONST},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:CONST},{input:"\\wr",tag:"mo",output:"\u2240",ttype:CONST},{input:"\\arccos",tag:"mi",output:"arccos",ttype:UNARY,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:UNARY,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:UNARY,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:UNARY,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:UNARY,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:UNARY,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:UNARY,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:UNARY,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:UNARY,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:UNARY,func:true},{input:"\\det",tag:"mi",output:"det",ttype:UNARY,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:UNARY,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:UNARY,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:UNARY,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:UNARY,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:UNDEROVER},{input:"\\ker",tag:"mi",output:"ker",ttype:UNARY,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:UNARY,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:UNDEROVER},{input:"\\liminf",tag:"mo",output:"liminf",ttype:UNDEROVER},{input:"\\limsup",tag:"mo",output:"limsup",ttype:UNDEROVER},{input:"\\ln",tag:"mi",output:"ln",ttype:UNARY,func:true},{input:"\\log",tag:"mi",output:"log",ttype:UNARY,func:true},{input:"\\max",tag:"mo",output:"max",ttype:UNDEROVER},{input:"\\min",tag:"mo",output:"min",ttype:UNDEROVER},{input:"\\Pr",tag:"mi",output:"Pr",ttype:UNARY,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:UNARY,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:UNARY,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:UNARY,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:UNDEROVER},{input:"\\tan",tag:"mi",output:"tan",ttype:UNARY,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:UNARY,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\to",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:CONST},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:CONST},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:CONST},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:CONST},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:CONST},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:CONST},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:CONST},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:DEFINITION},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:CONST},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:CONST},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:CONST},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\longleftarrow",tag:"mo",output:"\u2190",ttype:LONG},{input:"\\longrightarrow",tag:"mo",output:"\u2192",ttype:LONG},{input:"\\longleftrightarrow",tag:"mo",output:"\u2194",ttype:LONG},{input:"\\Longleftarrow",tag:"mo",output:"\u21D0",ttype:LONG},{input:"\\Longrightarrow",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\implies",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\Longleftrightarrow",tag:"mo",output:"\u21D4",ttype:LONG},{input:"\\longmapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:UNARY},{input:"\\root",tag:"mroot",output:"root",ttype:BINARY},{input:"\\frac",tag:"mfrac",output:"/",ttype:BINARY},{input:"\\stackrel",tag:"mover",output:"stackrel",ttype:BINARY},{input:"\\atop",tag:"mfrac",output:"",ttype:INFIX},{input:"\\choose",tag:"mfrac",output:"",ttype:INFIX},{input:"_",tag:"msub",output:"_",ttype:INFIX},{input:"^",tag:"msup",output:"^",ttype:INFIX},{input:"\\mathrm",tag:"mtext",output:"text",ttype:TEXT},{input:"\\mbox",tag:"mtext",output:"mbox",ttype:TEXT},{input:"\\acute",tag:"mover",output:"\u00B4",ttype:UNARY,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:UNARY,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:UNARY,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:UNARY,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:UNARY,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:UNARY,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:UNARY,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:UNARY,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:UNARY,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:UNARY,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:UNARY,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:UNARY,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:UNARY,acc:true},{input:"\\overbrace",tag:"mover",output:"\u23B4",ttype:UNARY,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\underbrace",tag:"munder",output:"\u23B5",ttype:UNARY,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:UNARY},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:UNARY},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:UNARY},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:UNARY},{input:"\\textrm",tag:"mstyle",output:"\\mathrm",ttype:DEFINITION},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:UNARY},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:UNARY,codes:AMbbb},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:UNARY,codes:AMcal},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:UNARY,codes:AMfrk}];var LMnames=[];function LMremoveCharsAndBlanks(c,d){var a;a=c.slice(d);for(var b=0;b=LMnames[a]}LMpreviousSymbol=LMcurrentSymbol;if(f!=""){LMcurrentSymbol=LMsymbols[d].ttype;return LMsymbols[d]}LMcurrentSymbol=CONST;a=1;l=h.slice(0,1);if("0"<=l&&l<="9"){m="mn"}else{m=(("A">l||l>"Z")&&("a">l||l>"z")?"mo":"mi")}return{input:l,tag:m,output:l,ttype:CONST}}var LMpreviousSymbol,LMcurrentSymbol;function LMparseSexpr(n){var t,m,d,a,r,o,l=document.createDocumentFragment();n=LMremoveCharsAndBlanks(n,0);t=LMgetSymbol(n);if(t==null||t.ttype==RIGHTBRACKET){return[null,n,null]}if(t.ttype==DEFINITION){n=t.output+LMremoveCharsAndBlanks(n,t.input.length);t=LMgetSymbol(n);if(t==null||t.ttype==RIGHTBRACKET){return[null,n,null]}}n=LMremoveCharsAndBlanks(n,t.input.length);switch(t.ttype){case SPACE:m=createMmlNode(t.tag);m.setAttribute(t.atname,t.atval);return[m,n,t.tag];case UNDEROVER:if(isIE){if(t.input.substr(0,4)=="\\big"){n="\\"+t.input.substr(4)+n;t=LMgetSymbol(n);t.ttype=UNDEROVER;n=LMremoveCharsAndBlanks(n,t.input.length)}}return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag];case CONST:var g=t.output;if(isIE){if(t.input=="'"){g="\u2032"}else{if(t.input=="''"){g="\u2033"}else{if(t.input=="'''"){g="\u2033\u2032"}else{if(t.input=="''''"){g="\u2033\u2033"}else{if(t.input=="\\square"){g="\u25A1"}else{if(t.input.substr(0,5)=="\\frac"){var b=t.input.substr(6,1);if(b=="5"||b=="6"){n=t.input.replace(/\\frac/,"\\frac ")+n;return[m,n,t.tag]}}}}}}}}m=createMmlNode(t.tag,document.createTextNode(g));return[m,n,t.tag];case LONG:m=createMmlNode(t.tag,document.createTextNode(t.output));m.setAttribute("minsize","1.5");m.setAttribute("maxsize","1.5");m=createMmlNode("mover",m);m.appendChild(createMmlNode("mspace"));return[m,n,t.tag];case STRETCHY:if(isIE&&t.input=="\\backslash"){t.output="\\"}m=createMmlNode(t.tag,document.createTextNode(t.output));if(t.input=="|"||t.input=="\\vert"||t.input=="\\|"||t.input=="\\Vert"){m.setAttribute("lspace","0em");m.setAttribute("rspace","0em")}m.setAttribute("maxsize",t.atval);if(t.rtag!=null){return[m,n,t.rtag]}else{return[m,n,t.tag]}case BIG:var f=t.atval;if(isIE){f=t.ieval}t=LMgetSymbol(n);if(t==null){return[null,n,null]}n=LMremoveCharsAndBlanks(n,t.input.length);m=createMmlNode(t.tag,document.createTextNode(t.output));if(isIE){var v=createMmlNode("mspace");v.setAttribute("height",f+"ex");m=createMmlNode("mrow",m);m.appendChild(v)}else{m.setAttribute("minsize",f);m.setAttribute("maxsize",f)}return[m,n,t.tag];case LEFTBRACKET:if(t.input=="\\left"){t=LMgetSymbol(n);if(t!=null){if(t.input=="."){t.invisible=true}n=LMremoveCharsAndBlanks(n,t.input.length)}}d=LMparseExpr(n,true,false);if(t==null||(typeof t.invisible=="boolean"&&t.invisible)){m=createMmlNode("mrow",d[0])}else{m=createMmlNode("mo",document.createTextNode(t.output));m=createMmlNode("mrow",m);m.appendChild(d[0])}return[m,d[1],d[2]];case MATRIX:if(t.input=="\\begin{array}"){var s="";t=LMgetSymbol(n);n=LMremoveCharsAndBlanks(n,0);if(t==null){s="l"}else{n=LMremoveCharsAndBlanks(n,t.input.length);if(t.input!="{"){s="l"}else{do{t=LMgetSymbol(n);if(t!=null){n=LMremoveCharsAndBlanks(n,t.input.length);if(t.input!="}"){s=s+t.input}}}while(t!=null&&t.input!=""&&t.input!="}")}}d=LMparseExpr("{"+n,true,true);m=createMmlNode("mtable",d[0]);s=s.replace(/l/g,"left ");s=s.replace(/r/g,"right ");s=s.replace(/c/g,"center ");m.setAttribute("columnalign",s);m.setAttribute("displaystyle","false");if(isIE){return[m,d[1],null]}var k=createMmlNode("mspace");k.setAttribute("width","0.167em");var p=createMmlNode("mspace");p.setAttribute("width","0.167em");var c=createMmlNode("mrow",k);c.appendChild(m);c.appendChild(p);return[c,d[1],null]}else{d=LMparseExpr("{"+n,true,true);m=createMmlNode("mtable",d[0]);if(isIE){m.setAttribute("columnspacing","0.25em")}else{m.setAttribute("columnspacing","0.167em")}m.setAttribute("columnalign","right center left");m.setAttribute("displaystyle","true");m=createMmlNode("mrow",m);return[m,d[1],null]}case TEXT:if(n.charAt(0)=="{"){r=n.indexOf("}")}else{r=0}if(r==-1){r=n.length}o=n.slice(1,r);if(o.charAt(0)==" "){m=createMmlNode("mspace");m.setAttribute("width","0.33em");l.appendChild(m)}l.appendChild(createMmlNode(t.tag,document.createTextNode(o)));if(o.charAt(o.length-1)==" "){m=createMmlNode("mspace");m.setAttribute("width","0.33em");l.appendChild(m)}n=LMremoveCharsAndBlanks(n,r+1);return[createMmlNode("mrow",l),n,null];case UNARY:d=LMparseSexpr(n);if(d[0]==null){return[createMmlNode(t.tag,document.createTextNode(t.output)),n]}if(typeof t.func=="boolean"&&t.func){o=n.charAt(0);if(o=="^"||o=="_"||o==","){return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag]}else{m=createMmlNode("mrow",createMmlNode(t.tag,document.createTextNode(t.output)));if(isIE){var v=createMmlNode("mspace");v.setAttribute("width","0.167em");m.appendChild(v)}m.appendChild(d[0]);return[m,d[1],t.tag]}}if(t.input=="\\sqrt"){if(isIE){var v=createMmlNode("mspace");v.setAttribute("height","1.2ex");v.setAttribute("width","0em");m=createMmlNode(t.tag,d[0]);m.appendChild(v);return[m,d[1],t.tag]}else{return[createMmlNode(t.tag,d[0]),d[1],t.tag]}}else{if(typeof t.acc=="boolean"&&t.acc){m=createMmlNode(t.tag,d[0]);var g=t.output;if(isIE){if(t.input=="\\hat"){g="\u0302"}else{if(t.input=="\\widehat"){g="\u005E"}else{if(t.input=="\\bar"){g="\u00AF"}else{if(t.input=="\\grave"){g="\u0300"}else{if(t.input=="\\tilde"){g="\u0303"}}}}}}var c=createMmlNode("mo",document.createTextNode(g));if(t.input=="\\vec"||t.input=="\\check"){c.setAttribute("maxsize","1.2")}if(isIE&&t.input=="\\bar"){c.setAttribute("maxsize","0.5")}if(t.input=="\\underbrace"||t.input=="\\underline"){c.setAttribute("accentunder","true")}else{c.setAttribute("accent","true")}m.appendChild(c);if(t.input=="\\overbrace"||t.input=="\\underbrace"){m.ttype=UNDEROVER}return[m,d[1],t.tag]}else{if(!isIE&&typeof t.codes!="undefined"){for(r=0;r64&&o.charCodeAt(q)<91){h=h+String.fromCharCode(t.codes[o.charCodeAt(q)-65])}else{h=h+o.charAt(q)}}if(d[0].nodeName=="mi"){d[0]=createMmlNode("mo").appendChild(document.createTextNode(h))}else{d[0].replaceChild(createMmlNode("mo").appendChild(document.createTextNode(h)),d[0].childNodes[r])}}}}m=createMmlNode(t.tag,d[0]);m.setAttribute(t.atname,t.atval);if(t.input=="\\scriptstyle"||t.input=="\\scriptscriptstyle"){m.setAttribute("displaystyle","false")}return[m,d[1],t.tag]}}case BINARY:d=LMparseSexpr(n);if(d[0]==null){return[createMmlNode("mo",document.createTextNode(t.input)),n,null]}a=LMparseSexpr(d[1]);if(a[0]==null){return[createMmlNode("mo",document.createTextNode(t.input)),n,null]}if(t.input=="\\root"||t.input=="\\stackrel"){l.appendChild(a[0])}l.appendChild(d[0]);if(t.input=="\\frac"){l.appendChild(a[0])}return[createMmlNode(t.tag,l),a[1],t.tag];case INFIX:n=LMremoveCharsAndBlanks(n,t.input.length);return[createMmlNode("mo",document.createTextNode(t.output)),n,t.tag];default:return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag]}}function LMparseIexpr(g){var f,d,b,c,h,k,j;g=LMremoveCharsAndBlanks(g,0);d=LMgetSymbol(g);h=LMparseSexpr(g);c=h[0];g=h[1];k=h[2];f=LMgetSymbol(g);if(f.ttype==INFIX){g=LMremoveCharsAndBlanks(g,f.input.length);h=LMparseSexpr(g);if(h[0]==null){h[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}g=h[1];k=h[2];if(f.input=="_"||f.input=="^"){b=LMgetSymbol(g);k=null;j=((d.ttype==UNDEROVER)||(c.ttype==UNDEROVER));if(f.input=="_"&&b.input=="^"){g=LMremoveCharsAndBlanks(g,b.input.length);var a=LMparseSexpr(g);g=a[1];k=a[2];c=createMmlNode((j?"munderover":"msubsup"),c);c.appendChild(h[0]);c.appendChild(a[0])}else{if(f.input=="_"){c=createMmlNode((j?"munder":"msub"),c);c.appendChild(h[0])}else{c=createMmlNode((j?"mover":"msup"),c);c.appendChild(h[0])}}c=createMmlNode("mrow",c)}else{c=createMmlNode(f.tag,c);if(f.input=="\\atop"||f.input=="\\choose"){c.setAttribute("linethickness","0ex")}c.appendChild(h[0]);if(f.input=="\\choose"){c=createMmlNode("mfenced",c)}}}return[c,g,k]}function LMparseExpr(o,p,v){var w,l,a,s,z,f=document.createDocumentFragment();do{o=LMremoveCharsAndBlanks(o,0);a=LMparseIexpr(o);l=a[0];o=a[1];z=a[2];w=LMgetSymbol(o);if(l!=undefined){if((z=="mn"||z=="mi")&&w!=null&&typeof w.func=="boolean"&&w.func){var y=createMmlNode("mspace");y.setAttribute("width","0.167em");l=createMmlNode("mrow",l);l.appendChild(y)}f.appendChild(l)}}while((w.ttype!=RIGHTBRACKET)&&w!=null&&w.output!="");z=null;if(w.ttype==RIGHTBRACKET){if(w.input=="\\right"){o=LMremoveCharsAndBlanks(o,w.input.length);w=LMgetSymbol(o);if(w!=null&&w.input=="."){w.invisible=true}if(w!=null){z=w.rtag}}if(w!=null){o=LMremoveCharsAndBlanks(o,w.input.length)}var t=f.childNodes.length;if(v&&t>0&&f.childNodes[t-1].nodeName=="mrow"&&t>1&&f.childNodes[t-2].nodeName=="mo"&&f.childNodes[t-2].firstChild.nodeValue=="&"){var c=[];var h=f.childNodes.length;for(s=0;v&&s2){f.removeChild(f.firstChild);f.removeChild(f.firstChild)}x.appendChild(createMmlNode("mtr",d))}return[x,o]}if(typeof w.invisible!="boolean"||!w.invisible){l=createMmlNode("mo",document.createTextNode(w.output));f.appendChild(l)}}return[f,o,z]}var tcnt=0,dcnt=0;function simpleLaTeXformatting(a){a=a.replace(/\$\$((.|\n)*?)\$\$/g,'

$\\displaystyle{$1}$

');a=a.replace(/\\begin{(theorem|lemma|proposition|corollary)}((.|\n)*?)\\end{\1}/g,function(d,c,b){tcnt++;return""+c.charAt(0).toUpperCase()+c.slice(1)+" "+tcnt+". "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+""});a=a.replace(/\\begin{(definition|example|remark|problem|exercise|conjecture|solution)}((.|\n)*?)\\end{\1}/g,function(d,c,b){dcnt++;return""+c.charAt(0).toUpperCase()+c.slice(1)+" "+dcnt+". "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")});a=a.replace(/\\begin{proof}((.|\n)*?)\\end{proof}/g,function(c,b){return"Proof: "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+" □"});a=a.replace(/\\emph{(.*?)}/g,"$1");a=a.replace(/\\textbf{(.*?)}/g,"$1");a=a.replace(/\\cite{(.*?)}/g,"[$1]");a=a.replace(/\\chapter{(.*?)}/g,"

$1

");a=a.replace(/\\section{(.*?)}(\s*<\/?(br|p)\s?\/?>)?/g,"

$1

");a=a.replace(/\\subsection{((.|\n)*?)}/g,"

$1

");a=a.replace(/\\begin{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
    ");a=a.replace(/\\item\s((.|\n)*?)(?=(\\item|\\end))/g,"
  • $1
  • ");a=a.replace(/\\end{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
");a=a.replace(/\\begin{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
    ");a=a.replace(/\\end{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
");a=a.replace(/\\item\[(.*?)]{(.*?)}/g,"
$1
$2
");a=a.replace(/\\begin{description}/g,"
");a=a.replace(/\\end{description}/g,"
");a=a.replace(/\\newline\b/g,"
");a=a.replace(/\\newpage\b/g,'
');a=a.replace(/\\par\b/g,"

 

");a=a.replace(/\\bigskip/g,'

 

');a=a.replace(/\\medskip/g,'

 

');a=a.replace(/\\smallskip/g,'

 

');a=a.replace(/\\begin{center}((.|\n)*?)\\end{center}/g,"
$1
");return a}function ASCIIandgraphformatting(a){a=a.replace(/(.*?)<\/sup>(\s|(\S))/gi,"^{$1} $3");a=a.replace(/(Proof:)/g,"$1");a=a.replace(/QED/g,"    □");a=a.replace(/(\\?end{?a?math}?)/ig,"$1");a=a.replace(/(\bamath\b|\\begin{a?math})/ig,"$1");a=a.replace(/([>\n])(Theorem|Lemma|Proposition|Corollary|Definition|Example|Remark|Problem|Exercise|Conjecture|Solution)(:|\W\W?(\w|\s|-|\.)*?\W?:)/g,"$1$2$3");a=a.replace(/
/gi,"\n")+"'/>
"});a=a.replace(/insertASCIIMathCalculator/g,'
');return a}function LMprocessNode(f){var d,a;try{a=f.innerHTML}catch(b){}var c=/amath\b/i.test(a);if((a==null||a.indexOf("$ ")!=-1||a.indexOf("$<")!=-1||a.indexOf("\\begin")!=-1||c||a.slice(-1)=="$"||a.indexOf("$\n")!=-1)&&!/edit-content|HTMLArea|wikiedit|wpTextbox1/.test(a)){if(!avoidinnerHTML&&translateLaTeXformatting){a=simpleLaTeXformatting(a)}if(a!=null&&c&&!avoidinnerHTML){a=ASCIIandgraphformatting(a)}a=a.replace(/%7E/g,"~");if(!avoidinnerHTML){f.innerHTML=a}processNodeR(f,false,true)}}var checkIfSVGavailable=true;var notifyIfNoSVG=true;var alertIfNoSVG=false;var noSVG=false;var defaultwidth=300;defaultheight=200;var defaultxmin=-5.5;defaultxmax=5.5;var defaultborder=0;border=defaultborder;var defaultstrokewidth="1";var defaultstroke="blue";var defaultstrokeopacity=1;var defaultstrokedasharray=null;var defaultfill="none";var defaultfillopacity=1;var defaultfontstyle="normal";var defaultfontfamily="times";var defaultfontsize="16";var defaultfontweight="normal";var defaultfontstroke="none";var defaultfontfill="none";var defaultmarker="none";var defaultendpoints="";var showcoordinates=true;var markerstrokewidth="1";var markerstroke="black";var markerfill="yellow";var markersize=4;var arrowfill=stroke;var dotradius=4;var ticklength=4;var axesstroke="black";var gridstroke="grey";var backgroundstyle="fill-opacity:1; fill:white";var singlelettersitalic=true;var picturepos=null;var xunitlength;var yunitlength;var origin=[0,0];var above="above";var below="below";var left="left";var right="right";var aboveleft="aboveleft";var aboveright="aboveright";var belowleft="belowleft";var belowright="belowright";var xmin,xmax,ymin,ymax,xscl,yscl,xgrid,ygrid,xtick,ytick,initialized;var strokewidth,strokedasharray,stroke,fill,strokeopacity,fillopacity;var fontstyle,fontfamily,fontsize,fontweight,fontstroke,fontfill;var marker,endpoints,dynamic={};var picture,svgpicture,doc,width,height;var isIE=document.createElementNS==null;var cpi="\u03C0",ctheta="\u03B8";var log=function(a){return ln(a)/ln(10)};var pi=Math.PI,e=Math.E,ln=Math.log,sqrt=Math.sqrt;var floor=Math.floor,ceil=Math.ceil,abs=Math.abs;var sin=Math.sin,cos=Math.cos,tan=Math.tan;var arcsin=Math.asin,arccos=Math.acos,arctan=Math.atan;var sec=function(a){return 1/Math.cos(a)};var csc=function(a){return 1/Math.sin(a)};var cot=function(a){return 1/Math.tan(a)};var arcsec=function(a){return arccos(1/a)};var arccsc=function(a){return arcsin(1/a)};var arccot=function(a){return arctan(1/a)};var sinh=function(a){return(Math.exp(a)-Math.exp(-a))/2};var cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};var tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};var sech=function(a){return 1/cosh(a)};var csch=function(a){return 1/sinh(a)};var coth=function(a){return 1/tanh(a)};var arcsinh=function(a){return ln(a+Math.sqrt(a*a+1))};var arccosh=function(a){return ln(a+Math.sqrt(a*a-1))};var arctanh=function(a){return ln((1+a)/(1-a))/2};var sech=function(a){return 1/cosh(a)};var csch=function(a){return 1/sinh(a)};var coth=function(a){return 1/tanh(a)};var arcsech=function(a){return arccosh(1/a)};var arccsch=function(a){return arcsinh(1/a)};var arccoth=function(a){return arctanh(1/a)};var sign=function(a){return(a==0?0:(a<0?-1:1))};function factorial(a,c){if(c==null){c=1}if(Math.abs(a-Math.round(a*1000000)/1000000)<1e-15){a=Math.round(a*1000000)/1000000}if(a-Math.floor(a)!=0){return NaN}for(var b=a-c;b>0;b-=c){a*=b}return(a<0?NaN:(a==0?1:a))}function C(a,b){var d=1;for(var c=0;c=xmax){alert("Picture requires at least two numbers: xmin < xmax")}else{if(a!=null&&(typeof c!="number"||typeof a!="number"||c>=a)){alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax")}else{if(width==null){width=picture.getAttribute("width");if(width==null||width==""){width=defaultwidth}}picture.setAttribute("width",width);if(height==null){height=picture.getAttribute("height");if(height==null||height==""){height=defaultheight}}picture.setAttribute("height",height);xunitlength=(width-2*border)/(xmax-xmin);yunitlength=xunitlength;if(ymin==null){origin=[-xmin*xunitlength+border,height/2];ymin=-(height-2*border)/(2*yunitlength);ymax=-ymin}else{if(ymax!=null){yunitlength=(height-2*border)/(ymax-ymin)}else{ymax=(height-2*border)/yunitlength+ymin}origin=[-xmin*xunitlength+border,-ymin*yunitlength+border]}if(isIE){if(picture.FULLSCREEN==undefined){setTimeout("drawPictures()",50);throw"wait"}svgpicture=picture.getSVGDocument().getElementById("root");if(svgpicture==null){setTimeout("drawPictures()",50);throw"wait"}svgpicture=picture.getSVGDocument().getElementById("root");while(svgpicture.childNodes.length>0){svgpicture.removeChild(svgpicture.lastChild)}svgpicture.setAttribute("width",width);svgpicture.setAttribute("height",height);svgpicture.setAttribute("name",picture.getAttribute("id"));doc=picture.getSVGDocument()}else{var b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("id",picture.getAttribute("id"));b.setAttribute("name",picture.getAttribute("id"));b.setAttribute("width",picture.getAttribute("width"));b.setAttribute("height",picture.getAttribute("height"));picturepos=findPos(picture);if(picture.parentNode!=null){picture.parentNode.replaceChild(b,picture)}else{svgpicture.parentNode.replaceChild(b,svgpicture)}svgpicture=b;doc=document}var g=document.getElementById(picture.getAttribute("id")+"mml");if(g!=null){while(g.childNodes.length>0){g.removeChild(g.lastChild)}}svgpicture.setAttribute("xunitlength",xunitlength);svgpicture.setAttribute("yunitlength",yunitlength);svgpicture.setAttribute("xmin",xmin);svgpicture.setAttribute("xmax",xmax);svgpicture.setAttribute("ymin",ymin);svgpicture.setAttribute("ymax",ymax);svgpicture.setAttribute("ox",origin[0]);svgpicture.setAttribute("oy",origin[1]);var d=myCreateElementSVG("rect");d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("width",width);d.setAttribute("height",height);d.setAttribute("style",backgroundstyle);svgpicture.appendChild(d);svgpicture.setAttribute("onmousemove","displayCoord(evt)");svgpicture.setAttribute("onmouseout","removeCoord(evt)");svgpicture.setAttribute("onclick","mClick(evt)");d=myCreateElementSVG("text");d.appendChild(doc.createTextNode(" "));d.setAttribute("id","coords");svgpicture.appendChild(d);d=myCreateElementSVG("text");d.appendChild(doc.createTextNode(" "));d.setAttribute("id","coords");svgpicture.appendChild(d);border=defaultborder}}}}function line(d,c,f,a){var b;if(f!=null){b=doc.getElementById(f)}if(b==null){b=myCreateElementSVG("path");b.setAttribute("id",f);svgpicture.appendChild(b)}b.setAttribute("d","M"+(d[0]*xunitlength+origin[0])+","+(height-d[1]*yunitlength-origin[1])+" "+(c[0]*xunitlength+origin[0])+","+(height-c[1]*yunitlength-origin[1]));b.setAttribute("stroke-width",strokewidth);if(strokedasharray!=null){b.setAttribute("stroke-dasharray",strokedasharray)}b.setAttribute("stroke",stroke);b.setAttribute("fill",fill);b.setAttribute("stroke-opacity",strokeopacity);b.setAttribute("fill-opacity",fillopacity);if(marker=="dot"||marker=="arrowdot"){ASdot(d,markersize,markerstroke,markerfill);if(marker=="arrowdot"){arrowhead(d,c)}ASdot(c,markersize,markerstroke,markerfill)}else{if(marker=="arrow"){arrowhead(d,c)}}if(a==null&&endpoints!=""){a=endpoints}if(a!=null){if(a.indexOf("<-")!=-1){arrowhead(c,d)}if(a.indexOf("o-")!=-1){dot(d,"open")}if(a.indexOf("*-")!=-1){dot(d,"closed")}if(a.indexOf("->")!=-1){arrowhead(d,c)}if(a.indexOf("-o")!=-1){dot(c,"open")}if(a.indexOf("-*")!=-1){dot(c,"closed")}}}function path(g,j,h,a){if(h==null){h=""}var f,b,d;if(j!=null){f=doc.getElementById(j)}if(f==null){f=myCreateElementSVG("path");f.setAttribute("id",j);svgpicture.appendChild(f)}if(typeof g=="string"){b=g}else{b="M";b+=(g[0][0]*xunitlength+origin[0])+","+(height-g[0][1]*yunitlength-origin[1])+" "+h;for(d=1;d")!=-1){arrowhead(g[g.length-2],g[g.length-1])}if(a.indexOf("-o")!=-1){dot(g[g.length-1],"open")}if(a.indexOf("-*")!=-1){dot(g[g.length-1],"closed")}}}function curve(b,c,a){path(b,c,"T",a)}function vector(b,a,c){line(b,a,c,"","->")}function circle(c,b,d){var a;if(d!=null){a=doc.getElementById(d)}if(a==null){a=myCreateElementSVG("circle");a.setAttribute("id",d);svgpicture.appendChild(a)}a.setAttribute("cx",c[0]*xunitlength+origin[0]);a.setAttribute("cy",height-c[1]*yunitlength-origin[1]);a.setAttribute("r",b*xunitlength);a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function loop(a,b,c){if(b==null){b=[1,0]}path([a,[a[0]+b[0],a[1]+b[1]],[a[0]-b[1],a[1]+b[0]],a],c,"C");if(marker=="arrow"||marker=="arrowdot"){arrowhead([a[0]+Math.cos(1.4)*b[0]-Math.sin(1.4)*b[1],a[1]+Math.sin(1.4)*b[0]+Math.cos(1.4)*b[1]],a)}}function arc(h,a,f,g,d){var c,b;if(g!=null){c=doc.getElementById(g)}if(d==null){d=0}if(f==null){b=[a[0]-h[0],a[1]-h[1]];f=Math.sqrt(b[0]*b[0]+b[1]*b[1])}if(c==null){c=myCreateElementSVG("path");c.setAttribute("id",g);svgpicture.appendChild(c)}c.setAttribute("d","M"+(h[0]*xunitlength+origin[0])+","+(height-h[1]*yunitlength-origin[1])+" A"+f*xunitlength+","+f*yunitlength+" 0 "+d+",0 "+(a[0]*xunitlength+origin[0])+","+(height-a[1]*yunitlength-origin[1]));c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke);c.setAttribute("fill",fill);c.setAttribute("stroke-opacity",strokeopacity);c.setAttribute("fill-opacity",fillopacity);if(marker=="arrow"||marker=="arrowdot"){u=[(a[1]-h[1])/4,(h[0]-a[0])/4];b=[(a[0]-h[0])/2,(a[1]-h[1])/2];b=[h[0]+b[0]+u[0],h[1]+b[1]+u[1]]}else{b=[h[0],h[1]]}if(marker=="dot"||marker=="arrowdot"){ASdot(h,markersize,markerstroke,markerfill);if(marker=="arrowdot"){arrowhead(b,a)}ASdot(a,markersize,markerstroke,markerfill)}else{if(marker=="arrow"){arrowhead(b,a)}}}function sector(c,g,a,f){var d=g[0]-c[0],b=g[1]-c[1];arc(g,a,Math.sqrt(d*d+b*b),f+"arc");path([a,c,g],f+"path")}function ellipse(c,d,b,f){var a;if(f!=null){a=doc.getElementById(f)}if(a==null){a=myCreateElementSVG("ellipse");a.setAttribute("id",f);svgpicture.appendChild(a)}a.setAttribute("cx",c[0]*xunitlength+origin[0]);a.setAttribute("cy",height-c[1]*yunitlength-origin[1]);a.setAttribute("rx",d*xunitlength);a.setAttribute("ry",b*yunitlength);a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function triangle(c,b,a,d){path([c,b,a,c],d)}function rect(f,c,g,d,b){var a;if(g!=null){a=doc.getElementById(g)}if(a==null){a=myCreateElementSVG("rect");a.setAttribute("id",g);svgpicture.appendChild(a)}a.setAttribute("x",f[0]*xunitlength+origin[0]);a.setAttribute("y",height-c[1]*yunitlength-origin[1]);a.setAttribute("width",(c[0]-f[0])*xunitlength);a.setAttribute("height",(c[1]-f[1])*yunitlength);if(d!=null){a.setAttribute("rx",d*xunitlength)}if(b!=null){a.setAttribute("ry",b*yunitlength)}a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function text(a,l,h,b,j){var f,c,m=0,k=fontsize/3,g=l.toString();if(/(`|\$)/.test(g)){f=document.getElementById(svgpicture.getAttribute("name")+"mml");if(f!=null){if(b!=null){c=document.getElementById(b)}if(c==null){c=createElementXHTML("div");c.setAttribute("id",b);c.style.position="absolute";f.appendChild(c)}while(c.childNodes.length>0){c.removeChild(c.lastChild)}c.appendChild(document.createTextNode(g));if(/`/.test(g)){AMprocessNode(c)}else{LMprocessNode(c)}m=-c.offsetWidth/2;k=-c.offsetHeight/2;if(h!=null){if(/above/.test(h)){k=-c.offsetHeight}if(/below/.test(h)){k=0}if(/right/.test(h)){m=0}if(/left/.test(h)){m=-c.offsetWidth}}c.style.left=""+(a[0]*xunitlength+origin[0]+m)+"px";c.style.top=""+(height-a[1]*yunitlength-origin[1]+k)+"px"}return a}var d="middle";if(h!=null){if(/above/.test(h)){k=-fontsize/2}if(/below/.test(h)){k=fontsize-0}if(/right/.test(h)){d="start";m=fontsize/4}if(/left/.test(h)){d="end";m=-fontsize/4}}if(b!=null){c=doc.getElementById(b)}if(c==null){c=myCreateElementSVG("text");c.setAttribute("id",b);svgpicture.appendChild(c);c.appendChild(doc.createTextNode(g))}while(c.childNodes.length>1){c.removeChild(c.lastChild)}c.lastChild.nodeValue="\xA0"+g+"\xA0";c.setAttribute("x",a[0]*xunitlength+origin[0]+m);c.setAttribute("y",height-a[1]*yunitlength-origin[1]+k);c.setAttribute("font-style",(j!=null?j:(g.search(/^[a-zA-Z]$/)!=-1?"italic":fontstyle)));c.setAttribute("font-family",fontfamily);c.setAttribute("font-size",fontsize);c.setAttribute("font-weight",fontweight);c.setAttribute("text-anchor",d);if(fontstroke!="none"){c.setAttribute("stroke",fontstroke)}if(fontfill!="none"){c.setAttribute("fill",fontfill)}return a}function mtext(a,j,d,f,g){var c="middle";var k=0;var h=fontsize/3;if(d!=null){if(d.slice(0,5)=="above"){h=-fontsize/2}if(d.slice(0,5)=="below"){h=fontsize-0}if(d.slice(0,5)=="right"||d.slice(5,10)=="right"){c="start";k=fontsize/2}if(d.slice(0,4)=="left"||d.slice(5,9)=="left"){c="end";k=-fontsize/2}}var b=this;if(this.nodeName=="svg"){b=myCreateElementSVG("text");this.appendChild(b);b.appendChild(doc.createTextNode(j))}b.lastChild.nodeValue=j;b.setAttribute("x",a[0]+k);b.setAttribute("y",a[1]+h);b.setAttribute("font-style",(f!=null?f:fontstyle));b.setAttribute("font-family",fontfamily);b.setAttribute("font-size",(g!=null?g:fontsize));b.setAttribute("font-weight",fontweight);b.setAttribute("text-anchor",c);if(fontstroke!="none"){b.setAttribute("stroke",fontstroke)}if(fontfill!="none"){b.setAttribute("fill",fontfill)}}function image(b,f,a,c,g){var d;if(g!=null){d=doc.getElementById(g)}if(d==null){d=myCreateElementSVG("image");d.setAttribute("id",g);svgpicture.appendChild(d)}d.setAttribute("x",f[0]*xunitlength+origin[0]);d.setAttribute("y",height-f[1]*yunitlength-origin[1]);d.setAttribute("width",a);d.setAttribute("height",c);d.setAttribute("xlink:href",b)}function ASdot(g,d,a,c){if(a==null){a=stroke}if(c==null){c=fill}var b=myCreateElementSVG("circle");b.setAttribute("cx",g[0]*xunitlength+origin[0]);b.setAttribute("cy",height-g[1]*yunitlength-origin[1]);b.setAttribute("r",d);b.setAttribute("stroke-width",strokewidth);b.setAttribute("stroke",a);b.setAttribute("fill",c);svgpicture.appendChild(b)}function dot(f,d,b,j,h){var c;var a=f[0]*xunitlength+origin[0];var g=height-f[1]*yunitlength-origin[1];if(h!=null){c=doc.getElementById(h)}if(d=="+"||d=="-"||d=="|"){if(c==null){c=myCreateElementSVG("path");c.setAttribute("id",h);svgpicture.appendChild(c)}if(d=="+"){c.setAttribute("d"," M "+(a-ticklength)+" "+g+" L "+(a+ticklength)+" "+g+" M "+a+" "+(g-ticklength)+" L "+a+" "+(g+ticklength));c.setAttribute("stroke-width",0.5);c.setAttribute("stroke",axesstroke)}else{if(d=="-"){c.setAttribute("d"," M "+(a-ticklength)+" "+g+" L "+(a+ticklength)+" "+g)}else{c.setAttribute("d"," M "+a+" "+(g-ticklength)+" L "+a+" "+(g+ticklength))}c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke)}}else{if(c==null){c=myCreateElementSVG("circle");c.setAttribute("id",h);svgpicture.appendChild(c)}c.setAttribute("cx",a);c.setAttribute("cy",g);c.setAttribute("r",dotradius);c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke);c.setAttribute("fill",(d=="open"?"white":(d=="closed"?stroke:markerfill)))}if(b!=null){text(f,b,(j==null?"below":j),(h==null?h:h+"label"))}}point=dot;function arrowhead(j,h){var a;var c=[j[0]*xunitlength+origin[0],height-j[1]*yunitlength-origin[1]];var b=[h[0]*xunitlength+origin[0],height-h[1]*yunitlength-origin[1]];var f=[b[0]-c[0],b[1]-c[1]];var k=Math.sqrt(f[0]*f[0]+f[1]*f[1]);if(k>1e-8){f=[f[0]/k,f[1]/k];a=[-f[1],f[0]];var g=myCreateElementSVG("path");g.setAttribute("d","M "+(b[0]-15*f[0]-4*a[0])+" "+(b[1]-15*f[1]-4*a[1])+" L "+(b[0]-3*f[0])+" "+(b[1]-3*f[1])+" L "+(b[0]-15*f[0]+4*a[0])+" "+(b[1]-15*f[1]+4*a[1])+" z");g.setAttribute("stroke-width",markerstrokewidth);g.setAttribute("stroke",stroke);g.setAttribute("fill",stroke);g.setAttribute("stroke-opacity",strokeopacity);g.setAttribute("fill-opacity",fillopacity);svgpicture.appendChild(g)}}function chopZ(b){var a=b.indexOf(".");if(a==-1){return b}for(var c=b.length-1;c>a&&b.charAt(c)=="0";c--){}if(c==a){c--}return b.slice(0,c+1)}function grid(b,a){axes(b,a,null,b,a)}function noaxes(){if(!initialized){initPicture()}}function axes(dx,dy,labels,gdx,gdy){var x,y,ldx,ldy,lx,ly,lxp,lyp,pnode,st;if(!initialized){initPicture()}if(typeof dx=="string"){labels=dx;dx=null}if(typeof dy=="string"){gdx=dy;dy=null}if(xscl!=null){dx=xscl;gdx=xscl;labels=dx}if(yscl!=null){dy=yscl;gdy=yscl}if(xtick!=null){dx=xtick}if(ytick!=null){dy=ytick}dx=(dx==null?xunitlength:dx*xunitlength);dy=(dy==null?dx:dy*yunitlength);fontsize=Math.min(dx/2,dy/2,16);ticklength=fontsize/4;if(xgrid!=null){gdx=xgrid}if(ygrid!=null){gdy=ygrid}if(gdx!=null){gdx=(typeof gdx=="string"?dx:gdx*xunitlength);gdy=(gdy==null?dy:gdy*yunitlength);pnode=myCreateElementSVG("path");st="";for(x=origin[0];x0;x=x-gdx){st+=" M"+x+",0 "+x+","+height}for(y=height-origin[1];y0;y=y-gdy){st+=" M0,"+y+" "+width+","+y}pnode.setAttribute("d",st);pnode.setAttribute("stroke-width",0.5);pnode.setAttribute("stroke",gridstroke);pnode.setAttribute("fill",fill);svgpicture.appendChild(pnode)}pnode=myCreateElementSVG("path");st="M0,"+(height-origin[1])+" "+width+","+(height-origin[1])+" M"+origin[0]+",0 "+origin[0]+","+height;for(x=origin[0]+dx;x0;x=x-dx){st+=" M"+x+","+(height-origin[1]+ticklength)+" "+x+","+(height-origin[1]-ticklength)}for(y=height-origin[1]+dy;y0;y=y-dy){st+=" M"+(origin[0]+ticklength)+","+y+" "+(origin[0]-ticklength)+","+y}if(labels!=null){with(Math){ldx=dx/xunitlength;ldy=dy/yunitlength;lx=(xmin>0||xmax<0?xmin:0);ly=(ymin>0||ymax<0?ymin:0);lxp=(ly==0?"below":"above");lyp=(lx==0?"left":"right");var ddx=floor(1.1-log(ldx)/log(10))+1;var ddy=floor(1.1-log(ldy)/log(10))+1;for(x=ldx;x<=xmax;x=x+ldx){text([x,ly],chopZ(x.toFixed(ddx)),lxp)}for(x=-ldx;xmin<=x;x=x-ldx){text([x,ly],chopZ(x.toFixed(ddx)),lxp)}for(y=ldy;y<=ymax;y=y+ldy){text([lx,y],chopZ(y.toFixed(ddy)),lyp)}for(y=-ldy;ymin<=y;y=y-ldy){text([lx,y],chopZ(y.toFixed(ddy)),lyp)}}}fontsize=defaultfontsize;pnode.setAttribute("d",st);pnode.setAttribute("stroke-width",0.5);pnode.setAttribute("stroke",axesstroke);pnode.setAttribute("fill",fill);pnode.setAttribute("stroke-opacity",strokeopacity);pnode.setAttribute("fill-opacity",fillopacity);svgpicture.appendChild(pnode)}function mathjs(c){c=c.replace(/\s/g,"");if(c.indexOf("^-1")!=-1){c=c.replace(/sin\^-1/g,"arcsin");c=c.replace(/cos\^-1/g,"arccos");c=c.replace(/tan\^-1/g,"arctan");c=c.replace(/sec\^-1/g,"arcsec");c=c.replace(/csc\^-1/g,"arccsc");c=c.replace(/cot\^-1/g,"arccot");c=c.replace(/sinh\^-1/g,"arcsinh");c=c.replace(/cosh\^-1/g,"arccosh");c=c.replace(/tanh\^-1/g,"arctanh");c=c.replace(/sech\^-1/g,"arcsech");c=c.replace(/csch\^-1/g,"arccsch");c=c.replace(/coth\^-1/g,"arccoth")}c=c.replace(/^e$/g,"(Math.E)");c=c.replace(/^e([^a-zA-Z])/g,"(Math.E)$1");c=c.replace(/([^a-zA-Z])e/g,"$1(Math.E)");c=c.replace(/([0-9])([\(a-zA-Z])/g,"$1*$2");c=c.replace(/\)([\(0-9a-zA-Z])/g,")*$1");var d,b,a,f,g;while((d=c.indexOf("^"))!=-1){if(d==0){return"Error: missing argument"}b=d-1;f=c.charAt(b);if(f>="0"&&f<="9"){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}if(f=="."){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}}}else{if(f==")"){g=1;b--;while(b>=0&&g>0){f=c.charAt(b);if(f=="("){g--}else{if(f==")"){g++}}b--}while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){b--;while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{return"Error: incorrect syntax in "+c+" at position "+b}}}if(d==c.length-1){return"Error: missing argument"}a=d+1;f=c.charAt(a);if(f>="0"&&f<="9"||f=="-"){a++;while(a="0"&&f<="9"){a++}if(f=="."){a++;while(a="0"&&f<="9"){a++}}}else{if(f=="("){g=1;a++;while(a0){f=c.charAt(a);if(f=="("){g++}else{if(f==")"){g--}}a++}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){a++;while(a="a"&&f<="z"||f>="A"&&f<="Z"){a++}}else{return"Error: incorrect syntax in "+c+" at position "+a}}}c=c.slice(0,b+1)+"Math.pow("+c.slice(b+1,d)+","+c.slice(d+1,a)+")"+c.slice(a)}while((d=c.indexOf("!"))!=-1){if(d==0){return"Error: missing argument"}b=d-1;f=c.charAt(b);if(f>="0"&&f<="9"){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}if(f=="."){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}}}else{if(f==")"){g=1;b--;while(b>=0&&g>0){f=c.charAt(b);if(f=="("){g--}else{if(f==")"){g++}}b--}while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){b--;while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{return"Error: incorrect syntax in "+c+" at position "+b}}}c=c.slice(0,b+1)+"factorial("+c.slice(b+1,d)+")"+c.slice(d+1)}return c}function plot(fun,x_min,x_max,points,id,endpts){var pth=[];var f=function(x){return x},g=fun;var name=null;if(typeof fun=="string"){eval("g = function(x){ with(Math) return "+mathjs(fun)+" }")}else{if(typeof fun=="object"){eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }");eval("g = function(t){ with(Math) return "+mathjs(fun[1])+" }")}}if(typeof x_min=="string"){name=x_min;x_min=xmin}else{name=id}var min=(x_min==null?xmin:x_min);var max=(x_max==null?xmax:x_max);var inc=max-min-0.000001*(max-min);inc=(points==null?inc/200:inc/points);var gt;for(var t=min;t<=max;t+=inc){gt=g(t);if(!(isNaN(gt)||Math.abs(gt)=="Infinity")){pth[pth.length]=[f(t),gt]}}path(pth,name,null,endpts);return pth}function slopefield(fun,dx,dy){var g=fun;if(typeof fun=="string"){eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }")}var gxy,x,y,u,v,dz;if(dx==null){dx=1}if(dy==null){dy=1}dz=Math.sqrt(dx*dx+dy*dy)/6;var x_min=Math.ceil(xmin/dx);var y_min=Math.ceil(ymin/dy);for(x=x_min;x<=xmax;x+=dx){for(y=y_min;y<=ymax;y+=dy){gxy=g(x,y);if(!isNaN(gxy)){if(Math.abs(gxy)=="Infinity"){u=0;v=dz}else{u=dz/Math.sqrt(1+gxy*gxy);v=gxy*u}line([x-u,y-v],[x+u,y+v])}}}}function show_props(c){var b="";for(var a=0;a\nResult:     \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
';function generic(){if(!init()){return}if(translateOnLoad){var b=document.getElementById("processasciimathinmoodle");if(b!=null){dsvglocation=b.className}if(b!=null||!checkforprocessasciimathinmoodle){translate();if(!noSVG&&translateASCIIsvg){drawPictures()}}var a=getElementsByClass(document,"div","ASCIIMathCalculator");if(!noMathML&&a.length>0){initASCIIMathCalculators(a)}}}if(typeof window.addEventListener!="undefined"){window.addEventListener("load",generic,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",generic,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",generic)}else{if(typeof window.onload=="function"){var existing=onload;window.onload=function(){existing();generic()}}else{window.onload=generic}}}}; +var mathcolor="blue";var mathfontsize="1em";var mathfontfamily="serif";var automathrecognize=false;var checkForMathML=true;var notifyIfNoMathML=true;var alertIfNoMathML=false;var translateOnLoad=true;var translateLaTeX=true;var translateLaTeXformatting=true;var translateASCIIMath=true;var translateASCIIsvg=true;var avoidinnerHTML=false;var displaystyle=true;var showasciiformulaonhover=true;var decimalsign=".";var AMdelimiter1="`",AMescape1="\\\\`";var AMdocumentId="wikitext";var checkforprocessasciimathinmoodle=false;var dsvglocation="";var isIE=document.createElementNS==null;var noMathML=false,translated=false;if(isIE){document.write('');document.write('')}function setStylesheet(a){var c="AMMLcustomStyleSheet";var b=document.getElementById(c);if(document.createStyleSheet){if(b){b.parentNode.removeChild(b)}document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," ")}else{if(b){b.replaceChild(document.createTextNode(a),b.firstChild)}else{b=document.createElement("style");b.type="text/css";b.id=c;b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)}}}setStylesheet("#AMMLcloseDiv {font-size:0.8em; padding-top:1em; color:#014}\n#AMMLwarningBox {position:absolute; width:100%; top:0; left:0; z-index:200; text-align:center; font-size:1em; font-weight:bold; padding:0.5em 0 0.5em 0; color:#ffc; background:#c30}");function init(){var b,a=new Array();if(document.getElementById==null){alert("This webpage requires a recent browser such as Mozilla Firefox/Netscape 7+ or Internet Explorer 6+ with MathPlayer and Adobe SVGviewer");return null}if(checkForMathML&&(b=checkMathML())){a.push(b)}if(checkIfSVGavailable&&(b=checkSVG())){a.push(b)}if(a.length>0){displayWarnings(a)}if(!noMathML){initSymbols()}return true}function checkMathML(){if(navigator.appName.slice(0,8)=="Netscape"){if(navigator.appVersion.slice(0,1)>="5"){noMathML=null}else{noMathML=true}}else{if(navigator.appName.slice(0,9)=="Microsoft"){try{var c=new ActiveXObject("MathPlayer.Factory.1");noMathML=null}catch(a){noMathML=true}}else{if(navigator.appName.slice(0,5)=="Opera"){if(navigator.appVersion.slice(0,3)>="9.5"){noMathML=null}else{noMathML=true}}}}if(noMathML&¬ifyIfNoMathML){var b="To view the ASCIIMathML notation use Internet Explorer + MathPlayer or Mozilla Firefox 2.0 or later.";if(alertIfNoMathML){alert(b)}else{return b}}}function hideWarning(){var a=document.getElementsByTagName("body")[0];a.removeChild(document.getElementById("AMMLwarningBox"));a.onclick=null}function displayWarnings(b){var c,g,f=createElementXHTML("div");var a=document.getElementsByTagName("body")[0];a.onclick=hideWarning;f.id="AMMLwarningBox";for(c=0;c=",tag:"mo",output:"\u2265",tex:"ge",ttype:CONST},{input:"geq",tag:"mo",output:"\u2265",tex:null,ttype:CONST},{input:"-<",tag:"mo",output:"\u227A",tex:"prec",ttype:CONST},{input:"-lt",tag:"mo",output:"\u227A",tex:null,ttype:CONST},{input:">-",tag:"mo",output:"\u227B",tex:"succ",ttype:CONST},{input:"-<=",tag:"mo",output:"\u2AAF",tex:"preceq",ttype:CONST},{input:">-=",tag:"mo",output:"\u2AB0",tex:"succeq",ttype:CONST},{input:"in",tag:"mo",output:"\u2208",tex:null,ttype:CONST},{input:"!in",tag:"mo",output:"\u2209",tex:"notin",ttype:CONST},{input:"sub",tag:"mo",output:"\u2282",tex:"subset",ttype:CONST},{input:"sup",tag:"mo",output:"\u2283",tex:"supset",ttype:CONST},{input:"sube",tag:"mo",output:"\u2286",tex:"subseteq",ttype:CONST},{input:"supe",tag:"mo",output:"\u2287",tex:"supseteq",ttype:CONST},{input:"-=",tag:"mo",output:"\u2261",tex:"equiv",ttype:CONST},{input:"~=",tag:"mo",output:"\u2245",tex:"cong",ttype:CONST},{input:"~~",tag:"mo",output:"\u2248",tex:"approx",ttype:CONST},{input:"prop",tag:"mo",output:"\u221D",tex:"propto",ttype:CONST},{input:"and",tag:"mtext",output:"and",tex:null,ttype:SPACE},{input:"or",tag:"mtext",output:"or",tex:null,ttype:SPACE},{input:"not",tag:"mo",output:"\u00AC",tex:"neg",ttype:CONST},{input:"=>",tag:"mo",output:"\u21D2",tex:"implies",ttype:CONST},{input:"if",tag:"mo",output:"if",tex:null,ttype:SPACE},{input:"<=>",tag:"mo",output:"\u21D4",tex:"iff",ttype:CONST},{input:"AA",tag:"mo",output:"\u2200",tex:"forall",ttype:CONST},{input:"EE",tag:"mo",output:"\u2203",tex:"exists",ttype:CONST},{input:"_|_",tag:"mo",output:"\u22A5",tex:"bot",ttype:CONST},{input:"TT",tag:"mo",output:"\u22A4",tex:"top",ttype:CONST},{input:"|--",tag:"mo",output:"\u22A2",tex:"vdash",ttype:CONST},{input:"|==",tag:"mo",output:"\u22A8",tex:"models",ttype:CONST},{input:"(",tag:"mo",output:"(",tex:null,ttype:LEFTBRACKET},{input:")",tag:"mo",output:")",tex:null,ttype:RIGHTBRACKET},{input:"[",tag:"mo",output:"[",tex:null,ttype:LEFTBRACKET},{input:"]",tag:"mo",output:"]",tex:null,ttype:RIGHTBRACKET},{input:"{",tag:"mo",output:"{",tex:null,ttype:LEFTBRACKET},{input:"}",tag:"mo",output:"}",tex:null,ttype:RIGHTBRACKET},{input:"|",tag:"mo",output:"|",tex:null,ttype:LEFTRIGHT},{input:"(:",tag:"mo",output:"\u2329",tex:"langle",ttype:LEFTBRACKET},{input:":)",tag:"mo",output:"\u232A",tex:"rangle",ttype:RIGHTBRACKET},{input:"<<",tag:"mo",output:"\u2329",tex:null,ttype:LEFTBRACKET},{input:">>",tag:"mo",output:"\u232A",tex:null,ttype:RIGHTBRACKET},{input:"{:",tag:"mo",output:"{:",tex:null,ttype:LEFTBRACKET,invisible:true},{input:":}",tag:"mo",output:":}",tex:null,ttype:RIGHTBRACKET,invisible:true},{input:"int",tag:"mo",output:"\u222B",tex:null,ttype:CONST},{input:"dx",tag:"mi",output:"{:d x:}",tex:null,ttype:DEFINITION},{input:"dy",tag:"mi",output:"{:d y:}",tex:null,ttype:DEFINITION},{input:"dz",tag:"mi",output:"{:d z:}",tex:null,ttype:DEFINITION},{input:"dt",tag:"mi",output:"{:d t:}",tex:null,ttype:DEFINITION},{input:"oint",tag:"mo",output:"\u222E",tex:null,ttype:CONST},{input:"del",tag:"mo",output:"\u2202",tex:"partial",ttype:CONST},{input:"grad",tag:"mo",output:"\u2207",tex:"nabla",ttype:CONST},{input:"+-",tag:"mo",output:"\u00B1",tex:"pm",ttype:CONST},{input:"O/",tag:"mo",output:"\u2205",tex:"emptyset",ttype:CONST},{input:"oo",tag:"mo",output:"\u221E",tex:"infty",ttype:CONST},{input:"aleph",tag:"mo",output:"\u2135",tex:null,ttype:CONST},{input:"...",tag:"mo",output:"...",tex:"ldots",ttype:CONST},{input:":.",tag:"mo",output:"\u2234",tex:"therefore",ttype:CONST},{input:"/_",tag:"mo",output:"\u2220",tex:"angle",ttype:CONST},{input:"\\ ",tag:"mo",output:"\u00A0",tex:null,ttype:CONST},{input:"quad",tag:"mo",output:"\u00A0\u00A0",tex:null,ttype:CONST},{input:"qquad",tag:"mo",output:"\u00A0\u00A0\u00A0\u00A0",tex:null,ttype:CONST},{input:"cdots",tag:"mo",output:"\u22EF",tex:null,ttype:CONST},{input:"vdots",tag:"mo",output:"\u22EE",tex:null,ttype:CONST},{input:"ddots",tag:"mo",output:"\u22F1",tex:null,ttype:CONST},{input:"diamond",tag:"mo",output:"\u22C4",tex:null,ttype:CONST},{input:"square",tag:"mo",output:"\u25A1",tex:null,ttype:CONST},{input:"|__",tag:"mo",output:"\u230A",tex:"lfloor",ttype:CONST},{input:"__|",tag:"mo",output:"\u230B",tex:"rfloor",ttype:CONST},{input:"|~",tag:"mo",output:"\u2308",tex:"lceiling",ttype:CONST},{input:"~|",tag:"mo",output:"\u2309",tex:"rceiling",ttype:CONST},{input:"CC",tag:"mo",output:"\u2102",tex:null,ttype:CONST},{input:"NN",tag:"mo",output:"\u2115",tex:null,ttype:CONST},{input:"QQ",tag:"mo",output:"\u211A",tex:null,ttype:CONST},{input:"RR",tag:"mo",output:"\u211D",tex:null,ttype:CONST},{input:"ZZ",tag:"mo",output:"\u2124",tex:null,ttype:CONST},{input:"f",tag:"mi",output:"f",tex:null,ttype:UNARY,func:true},{input:"g",tag:"mi",output:"g",tex:null,ttype:UNARY,func:true},{input:"lim",tag:"mo",output:"lim",tex:null,ttype:UNDEROVER},{input:"Lim",tag:"mo",output:"Lim",tex:null,ttype:UNDEROVER},{input:"sin",tag:"mo",output:"sin",tex:null,ttype:UNARY,func:true},{input:"cos",tag:"mo",output:"cos",tex:null,ttype:UNARY,func:true},{input:"tan",tag:"mo",output:"tan",tex:null,ttype:UNARY,func:true},{input:"sinh",tag:"mo",output:"sinh",tex:null,ttype:UNARY,func:true},{input:"cosh",tag:"mo",output:"cosh",tex:null,ttype:UNARY,func:true},{input:"tanh",tag:"mo",output:"tanh",tex:null,ttype:UNARY,func:true},{input:"cot",tag:"mo",output:"cot",tex:null,ttype:UNARY,func:true},{input:"sec",tag:"mo",output:"sec",tex:null,ttype:UNARY,func:true},{input:"csc",tag:"mo",output:"csc",tex:null,ttype:UNARY,func:true},{input:"log",tag:"mo",output:"log",tex:null,ttype:UNARY,func:true},{input:"ln",tag:"mo",output:"ln",tex:null,ttype:UNARY,func:true},{input:"det",tag:"mo",output:"det",tex:null,ttype:UNARY,func:true},{input:"dim",tag:"mo",output:"dim",tex:null,ttype:CONST},{input:"mod",tag:"mo",output:"mod",tex:null,ttype:CONST},{input:"gcd",tag:"mo",output:"gcd",tex:null,ttype:UNARY,func:true},{input:"lcm",tag:"mo",output:"lcm",tex:null,ttype:UNARY,func:true},{input:"lub",tag:"mo",output:"lub",tex:null,ttype:CONST},{input:"glb",tag:"mo",output:"glb",tex:null,ttype:CONST},{input:"min",tag:"mo",output:"min",tex:null,ttype:UNDEROVER},{input:"max",tag:"mo",output:"max",tex:null,ttype:UNDEROVER},{input:"uarr",tag:"mo",output:"\u2191",tex:"uparrow",ttype:CONST},{input:"darr",tag:"mo",output:"\u2193",tex:"downarrow",ttype:CONST},{input:"rarr",tag:"mo",output:"\u2192",tex:"rightarrow",ttype:CONST},{input:"->",tag:"mo",output:"\u2192",tex:"to",ttype:CONST},{input:">->",tag:"mo",output:"\u21A3",tex:"rightarrowtail",ttype:CONST},{input:"->>",tag:"mo",output:"\u21A0",tex:"twoheadrightarrow",ttype:CONST},{input:">->>",tag:"mo",output:"\u2916",tex:"twoheadrightarrowtail",ttype:CONST},{input:"|->",tag:"mo",output:"\u21A6",tex:"mapsto",ttype:CONST},{input:"larr",tag:"mo",output:"\u2190",tex:"leftarrow",ttype:CONST},{input:"harr",tag:"mo",output:"\u2194",tex:"leftrightarrow",ttype:CONST},{input:"rArr",tag:"mo",output:"\u21D2",tex:"Rightarrow",ttype:CONST},{input:"lArr",tag:"mo",output:"\u21D0",tex:"Leftarrow",ttype:CONST},{input:"hArr",tag:"mo",output:"\u21D4",tex:"Leftrightarrow",ttype:CONST},{input:"sqrt",tag:"msqrt",output:"sqrt",tex:null,ttype:UNARY},{input:"root",tag:"mroot",output:"root",tex:null,ttype:BINARY},{input:"frac",tag:"mfrac",output:"/",tex:null,ttype:BINARY},{input:"/",tag:"mfrac",output:"/",tex:null,ttype:INFIX},{input:"stackrel",tag:"mover",output:"stackrel",tex:null,ttype:BINARY},{input:"_",tag:"msub",output:"_",tex:null,ttype:INFIX},{input:"^",tag:"msup",output:"^",tex:null,ttype:INFIX},{input:"hat",tag:"mover",output:"\u005E",tex:null,ttype:UNARY,acc:true},{input:"bar",tag:"mover",output:"\u00AF",tex:"overline",ttype:UNARY,acc:true},{input:"vec",tag:"mover",output:"\u2192",tex:null,ttype:UNARY,acc:true},{input:"dot",tag:"mover",output:".",tex:null,ttype:UNARY,acc:true},{input:"ddot",tag:"mover",output:"..",tex:null,ttype:UNARY,acc:true},{input:"ul",tag:"munder",output:"\u0332",tex:"underline",ttype:UNARY,acc:true},{input:"text",tag:"mtext",output:"text",tex:null,ttype:TEXT},{input:"mbox",tag:"mtext",output:"mbox",tex:null,ttype:TEXT},AMquote,{input:"bb",tag:"mstyle",atname:"fontweight",atval:"bold",output:"bb",tex:null,ttype:UNARY},{input:"mathbf",tag:"mstyle",atname:"fontweight",atval:"bold",output:"mathbf",tex:null,ttype:UNARY},{input:"sf",tag:"mstyle",atname:"fontfamily",atval:"sans-serif",output:"sf",tex:null,ttype:UNARY},{input:"mathsf",tag:"mstyle",atname:"fontfamily",atval:"sans-serif",output:"mathsf",tex:null,ttype:UNARY},{input:"bbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",output:"bbb",tex:null,ttype:UNARY,codes:AMbbb},{input:"mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",output:"mathbb",tex:null,ttype:UNARY,codes:AMbbb},{input:"cc",tag:"mstyle",atname:"mathvariant",atval:"script",output:"cc",tex:null,ttype:UNARY,codes:AMcal},{input:"mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",output:"mathcal",tex:null,ttype:UNARY,codes:AMcal},{input:"tt",tag:"mstyle",atname:"fontfamily",atval:"monospace",output:"tt",tex:null,ttype:UNARY},{input:"mathtt",tag:"mstyle",atname:"fontfamily",atval:"monospace",output:"mathtt",tex:null,ttype:UNARY},{input:"fr",tag:"mstyle",atname:"mathvariant",atval:"fraktur",output:"fr",tex:null,ttype:UNARY,codes:AMfrk},{input:"mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",output:"mathfrak",tex:null,ttype:UNARY,codes:AMfrk}];function compareNames(b,a){if(b.input>a.input){return 1}else{return -1}}var AMnames=[];function initSymbols(){var b=[],a;for(a=0;a>1;if(b[a]=AMnames[a]}AMpreviousSymbol=AMcurrentSymbol;if(f!=""){AMcurrentSymbol=AMsymbols[d].ttype;return AMsymbols[d]}AMcurrentSymbol=CONST;a=1;m=h.slice(0,1);var l=true;while("0"<=m&&m<="9"&&a<=h.length){m=h.slice(a,a+1);a++}if(m==decimalsign){m=h.slice(a,a+1);if("0"<=m&&m<="9"){l=false;a++;while("0"<=m&&m<="9"&&a<=h.length){m=h.slice(a,a+1);a++}}}if((l&&a>1)||a>2){m=h.slice(0,a-1);n="mn"}else{a=2;m=h.slice(0,1);n=(("A">m||m>"Z")&&("a">m||m>"z")?"mo":"mi")}if(m=="-"&&AMpreviousSymbol==INFIX){AMcurrentSymbol=INFIX;return{input:m,tag:n,output:m,ttype:UNARY,func:true}}return{input:m,tag:n,output:m,ttype:CONST}}function AMremoveBrackets(b){var a;if(b.nodeName=="mrow"){a=b.firstChild.firstChild.nodeValue;if(a=="("||a=="["||a=="{"){b.removeChild(b.firstChild)}}if(b.nodeName=="mrow"){a=b.lastChild.firstChild.nodeValue;if(a==")"||a=="]"||a=="}"){b.removeChild(b.lastChild)}}}var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;function AMparseSexpr(h){var d,b,k,f,m,g=document.createDocumentFragment();h=AMremoveCharsAndBlanks(h,0);d=AMgetSymbol(h);if(d==null||d.ttype==RIGHTBRACKET&&AMnestingDepth>0){return[null,h]}if(d.ttype==DEFINITION){h=d.output+AMremoveCharsAndBlanks(h,d.input.length);d=AMgetSymbol(h)}switch(d.ttype){case UNDEROVER:case CONST:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode(d.tag,document.createTextNode(d.output)),h];case LEFTBRACKET:AMnestingDepth++;h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseExpr(h,true);AMnestingDepth--;if(typeof d.invisible=="boolean"&&d.invisible){b=createMmlNode("mrow",k[0])}else{b=createMmlNode("mo",document.createTextNode(d.output));b=createMmlNode("mrow",b);b.appendChild(k[0])}return[b,k[1]];case TEXT:if(d!=AMquote){h=AMremoveCharsAndBlanks(h,d.input.length)}if(h.charAt(0)=="{"){f=h.indexOf("}")}else{if(h.charAt(0)=="("){f=h.indexOf(")")}else{if(h.charAt(0)=="["){f=h.indexOf("]")}else{if(d==AMquote){f=h.slice(1).indexOf('"')+1}else{f=0}}}}if(f==-1){f=h.length}m=h.slice(1,f);if(m.charAt(0)==" "){b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b)}g.appendChild(createMmlNode(d.tag,document.createTextNode(m)));if(m.charAt(m.length-1)==" "){b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b)}h=AMremoveCharsAndBlanks(h,f+1);return[createMmlNode("mrow",g),h];case UNARY:h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseSexpr(h);if(k[0]==null){return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}if(typeof d.func=="boolean"&&d.func){m=h.charAt(0);if(m=="^"||m=="_"||m=="/"||m=="|"||m==","){return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}else{b=createMmlNode("mrow",createMmlNode(d.tag,document.createTextNode(d.output)));b.appendChild(k[0]);return[b,k[1]]}}AMremoveBrackets(k[0]);if(d.input=="sqrt"){return[createMmlNode(d.tag,k[0]),k[1]]}else{if(typeof d.acc=="boolean"&&d.acc){b=createMmlNode(d.tag,k[0]);b.appendChild(createMmlNode("mo",document.createTextNode(d.output)));return[b,k[1]]}else{if(!isIE&&typeof d.codes!="undefined"){for(f=0;f64&&m.charCodeAt(c)<91){l=l+String.fromCharCode(d.codes[m.charCodeAt(c)-65])}else{l=l+m.charAt(c)}}if(k[0].nodeName=="mi"){k[0]=createMmlNode("mo").appendChild(document.createTextNode(l))}else{k[0].replaceChild(createMmlNode("mo").appendChild(document.createTextNode(l)),k[0].childNodes[f])}}}}b=createMmlNode(d.tag,k[0]);b.setAttribute(d.atname,d.atval);return[b,k[1]]}}case BINARY:h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseSexpr(h);if(k[0]==null){return[createMmlNode("mo",document.createTextNode(d.input)),h]}AMremoveBrackets(k[0]);var a=AMparseSexpr(k[1]);if(a[0]==null){return[createMmlNode("mo",document.createTextNode(d.input)),h]}AMremoveBrackets(a[0]);if(d.input=="root"||d.input=="stackrel"){g.appendChild(a[0])}g.appendChild(k[0]);if(d.input=="frac"){g.appendChild(a[0])}return[createMmlNode(d.tag,g),a[1]];case INFIX:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode("mo",document.createTextNode(d.output)),h];case SPACE:h=AMremoveCharsAndBlanks(h,d.input.length);b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b);g.appendChild(createMmlNode(d.tag,document.createTextNode(d.output)));b=createMmlNode("mspace");b.setAttribute("width","1ex");g.appendChild(b);return[createMmlNode("mrow",g),h];case LEFTRIGHT:AMnestingDepth++;h=AMremoveCharsAndBlanks(h,d.input.length);k=AMparseExpr(h,false);AMnestingDepth--;var m="";if(k[0].lastChild!=null){m=k[0].lastChild.firstChild.nodeValue}if(m=="|"){b=createMmlNode("mo",document.createTextNode(d.output));b=createMmlNode("mrow",b);b.appendChild(k[0]);return[b,k[1]]}else{b=createMmlNode("mo",document.createTextNode("\u2223"));b=createMmlNode("mrow",b);return[b,h]}default:h=AMremoveCharsAndBlanks(h,d.input.length);return[createMmlNode(d.tag,document.createTextNode(d.output)),h]}}function AMparseIexpr(h){var a,j,g,d,f,b;h=AMremoveCharsAndBlanks(h,0);j=AMgetSymbol(h);f=AMparseSexpr(h);d=f[0];h=f[1];a=AMgetSymbol(h);if(a.ttype==INFIX&&a.input!="/"){h=AMremoveCharsAndBlanks(h,a.input.length);f=AMparseSexpr(h);if(f[0]==null){f[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}else{AMremoveBrackets(f[0])}h=f[1];if(a.input=="_"){g=AMgetSymbol(h);b=(j.ttype==UNDEROVER);if(g.input=="^"){h=AMremoveCharsAndBlanks(h,g.input.length);var c=AMparseSexpr(h);AMremoveBrackets(c[0]);h=c[1];d=createMmlNode((b?"munderover":"msubsup"),d);d.appendChild(f[0]);d.appendChild(c[0]);d=createMmlNode("mrow",d)}else{d=createMmlNode((b?"munder":"msub"),d);d.appendChild(f[0])}}else{d=createMmlNode(a.tag,d);d.appendChild(f[0])}}return[d,h]}function AMparseExpr(p,q){var x,o,a,t,z=[],g=document.createDocumentFragment();do{p=AMremoveCharsAndBlanks(p,0);a=AMparseIexpr(p);o=a[0];p=a[1];x=AMgetSymbol(p);if(x.ttype==INFIX&&x.input=="/"){p=AMremoveCharsAndBlanks(p,x.input.length);a=AMparseIexpr(p);if(a[0]==null){a[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}else{AMremoveBrackets(a[0])}p=a[1];AMremoveBrackets(o);o=createMmlNode(x.tag,o);o.appendChild(a[0]);g.appendChild(o);x=AMgetSymbol(p)}else{if(o!=undefined){g.appendChild(o)}}}while((x.ttype!=RIGHTBRACKET&&(x.ttype!=LEFTRIGHT||q)||AMnestingDepth==0)&&x!=null&&x.output!="");if(x.ttype==RIGHTBRACKET||x.ttype==LEFTRIGHT){var v=g.childNodes.length;if(v>0&&g.childNodes[v-1].nodeName=="mrow"&&v>1&&g.childNodes[v-2].nodeName=="mo"&&g.childNodes[v-2].firstChild.nodeValue==","){var A=g.childNodes[v-1].lastChild.firstChild.nodeValue;if(A==")"||A=="]"){var c=g.childNodes[v-1].firstChild.firstChild.nodeValue;if(c=="("&&A==")"&&x.output!="}"||c=="["&&A=="]"){var d=[];var w=true;var l=g.childNodes.length;for(t=0;w&&t1){w=d[t].length==d[t-2].length}}if(w){var f,b,h,r,y=document.createDocumentFragment();for(t=0;t2){g.removeChild(g.firstChild);g.removeChild(g.firstChild)}y.appendChild(createMmlNode("mtr",f))}o=createMmlNode("mtable",y);if(typeof x.invisible=="boolean"&&x.invisible){o.setAttribute("columnalign","left")}g.replaceChild(o,g.firstChild)}}}}p=AMremoveCharsAndBlanks(p,x.input.length);if(typeof x.invisible!="boolean"||!x.invisible){o=createMmlNode("mo",document.createTextNode(x.output));g.appendChild(o)}}return[g,p]}function parseMath(c,b){var d,a;AMnestingDepth=0;d=b?LMparseExpr(c.replace(/^\s+/g,""),false,false)[0]:AMparseExpr(c.replace(/^\s+/g,""),false)[0];a=createMmlNode("mstyle",d);a.setAttribute("mathcolor",mathcolor);a.setAttribute("fontfamily",mathfontfamily);a.setAttribute("mathsize",mathfontsize);if(displaystyle){a.setAttribute("displaystyle","true")}a=createMmlNode("math",a);if(showasciiformulaonhover){a.setAttribute("title",c.replace(/\s+/g," "))}return a}function strarr2docFrag(a,d,g){var k=document.createDocumentFragment();var h=false;for(var f=0;f,\\|!:;'~]|\\.(?!(?:\x20|$))|"+k+l+a;var n=new RegExp("(^|\\s)((("+c+")\\s?)(("+c+g+")\\s?)+)([,.?]?(?=\\s|$))","g");m=m.replace(n," `$2`$7");var f=m.split(AMdelimiter1);var h=new RegExp("(^|\\s)([b-zB-HJ-Z+*<>]|"+b+k+a+")(\\s|\\n|$)","g");var d=new RegExp("(^|\\s)([a-z]|"+b+k+a+")([,.])","g");for(i=0;i1||k){if(!noMathML){a=strarr2docFrag(f,c.nodeType==8,b);var g=a.childNodes.length;c.parentNode.replaceChild(a,c);return g-1}else{return 0}}}}else{return 0}}else{if(c.nodeName!="math"){for(d=0;d",ttype:CONST},{input:"\\ne",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\neq",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\le",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leq",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\ge",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geq",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:CONST},{input:"\\ll",tag:"mo",output:"\u226A",ttype:CONST},{input:"\\gg",tag:"mo",output:"\u226B",ttype:CONST},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:CONST},{input:"\\prec",tag:"mo",output:"\u227A",ttype:CONST},{input:"\\succ",tag:"mo",output:"\u227B",ttype:CONST},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:CONST},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:CONST},{input:"\\subset",tag:"mo",output:"\u2282",ttype:CONST},{input:"\\supset",tag:"mo",output:"\u2283",ttype:CONST},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:CONST},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:CONST},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:CONST},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:CONST},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:CONST},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:CONST},{input:"\\sim",tag:"mo",output:"\u223C",ttype:CONST},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:CONST},{input:"\\approx",tag:"mo",output:"\u2248",ttype:CONST},{input:"\\cong",tag:"mo",output:"\u2245",ttype:CONST},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\in",tag:"mo",output:"\u2208",ttype:CONST},{input:"\\ni",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\owns",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\propto",tag:"mo",output:"\u221D",ttype:CONST},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:CONST},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:CONST},{input:"\\models",tag:"mo",output:"\u22A8",ttype:CONST},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\smile",tag:"mo",output:"\u2323",ttype:CONST},{input:"\\frown",tag:"mo",output:"\u2322",ttype:CONST},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:CONST},{input:"\\notin",tag:"mo",output:"\u2209",ttype:CONST},{input:"\\begin{eqnarray}",output:"X",ttype:MATRIX,invisible:true},{input:"\\begin{array}",output:"X",ttype:MATRIX,invisible:true},{input:"\\\\",output:"}&{",ttype:DEFINITION},{input:"\\end{eqnarray}",output:"}}",ttype:DEFINITION},{input:"\\end{array}",output:"}}",ttype:DEFINITION},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ieval:"2.2",ttype:BIG},{input:"\\Big",tag:"mo",output:"X",atval:"1.6",ieval:"2.6",ttype:BIG},{input:"\\bigg",tag:"mo",output:"X",atval:"2.2",ieval:"3.2",ttype:BIG},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ieval:"3.9",ttype:BIG},{input:"\\left",tag:"mo",output:"X",ttype:LEFTBRACKET},{input:"\\right",tag:"mo",output:"X",ttype:RIGHTBRACKET},{input:"{",output:"{",ttype:LEFTBRACKET,invisible:true},{input:"}",output:"}",ttype:RIGHTBRACKET,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:STRETCHY},{input:"[",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:STRETCHY},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:STRETCHY},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:STRETCHY},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:STRETCHY},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:STRETCHY},{input:"\\setminus",tag:"mo",output:"\\",ttype:CONST},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:SPACE},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:SPACE},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:SPACE},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:SPACE},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:SPACE},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:SPACE},{input:"\\prime",tag:"mo",output:"\u2032",ttype:CONST},{input:"'",tag:"mo",output:"\u02B9",ttype:CONST},{input:"''",tag:"mo",output:"\u02BA",ttype:CONST},{input:"'''",tag:"mo",output:"\u2034",ttype:CONST},{input:"''''",tag:"mo",output:"\u2057",ttype:CONST},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:CONST},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:CONST},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:CONST},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:CONST},{input:"\\forall",tag:"mo",output:"\u2200",ttype:CONST},{input:"\\exists",tag:"mo",output:"\u2203",ttype:CONST},{input:"\\Re",tag:"mo",output:"\u211C",ttype:CONST},{input:"\\Im",tag:"mo",output:"\u2111",ttype:CONST},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:CONST},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:CONST},{input:"\\ell",tag:"mo",output:"\u2113",ttype:CONST},{input:"\\wp",tag:"mo",output:"\u2118",ttype:CONST},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:CONST},{input:"\\infty",tag:"mo",output:"\u221E",ttype:CONST},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:DEFINITION},{input:"\\partial",tag:"mo",output:"\u2202",ttype:CONST},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:CONST},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:CONST},{input:"\\angle",tag:"mo",output:"\u2220",ttype:CONST},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:CONST},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:CONST},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\top",tag:"mo",output:"\u22A4",ttype:CONST},{input:"\\square",tag:"mo",output:"\u25AB",ttype:CONST},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:CONST},{input:"\\wr",tag:"mo",output:"\u2240",ttype:CONST},{input:"\\arccos",tag:"mi",output:"arccos",ttype:UNARY,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:UNARY,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:UNARY,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:UNARY,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:UNARY,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:UNARY,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:UNARY,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:UNARY,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:UNARY,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:UNARY,func:true},{input:"\\det",tag:"mi",output:"det",ttype:UNARY,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:UNARY,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:UNARY,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:UNARY,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:UNARY,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:UNDEROVER},{input:"\\ker",tag:"mi",output:"ker",ttype:UNARY,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:UNARY,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:UNDEROVER},{input:"\\liminf",tag:"mo",output:"liminf",ttype:UNDEROVER},{input:"\\limsup",tag:"mo",output:"limsup",ttype:UNDEROVER},{input:"\\ln",tag:"mi",output:"ln",ttype:UNARY,func:true},{input:"\\log",tag:"mi",output:"log",ttype:UNARY,func:true},{input:"\\max",tag:"mo",output:"max",ttype:UNDEROVER},{input:"\\min",tag:"mo",output:"min",ttype:UNDEROVER},{input:"\\Pr",tag:"mi",output:"Pr",ttype:UNARY,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:UNARY,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:UNARY,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:UNARY,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:UNDEROVER},{input:"\\tan",tag:"mi",output:"tan",ttype:UNARY,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:UNARY,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\to",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:CONST},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:CONST},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:CONST},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:CONST},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:CONST},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:CONST},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:CONST},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:DEFINITION},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:CONST},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:CONST},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:CONST},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\longleftarrow",tag:"mo",output:"\u2190",ttype:LONG},{input:"\\longrightarrow",tag:"mo",output:"\u2192",ttype:LONG},{input:"\\longleftrightarrow",tag:"mo",output:"\u2194",ttype:LONG},{input:"\\Longleftarrow",tag:"mo",output:"\u21D0",ttype:LONG},{input:"\\Longrightarrow",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\implies",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\Longleftrightarrow",tag:"mo",output:"\u21D4",ttype:LONG},{input:"\\longmapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:UNARY},{input:"\\root",tag:"mroot",output:"root",ttype:BINARY},{input:"\\frac",tag:"mfrac",output:"/",ttype:BINARY},{input:"\\stackrel",tag:"mover",output:"stackrel",ttype:BINARY},{input:"\\atop",tag:"mfrac",output:"",ttype:INFIX},{input:"\\choose",tag:"mfrac",output:"",ttype:INFIX},{input:"_",tag:"msub",output:"_",ttype:INFIX},{input:"^",tag:"msup",output:"^",ttype:INFIX},{input:"\\mathrm",tag:"mtext",output:"text",ttype:TEXT},{input:"\\mbox",tag:"mtext",output:"mbox",ttype:TEXT},{input:"\\acute",tag:"mover",output:"\u00B4",ttype:UNARY,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:UNARY,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:UNARY,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:UNARY,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:UNARY,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:UNARY,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:UNARY,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:UNARY,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:UNARY,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:UNARY,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:UNARY,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:UNARY,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:UNARY,acc:true},{input:"\\overbrace",tag:"mover",output:"\u23B4",ttype:UNARY,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\underbrace",tag:"munder",output:"\u23B5",ttype:UNARY,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:UNARY},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:UNARY},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:UNARY},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:UNARY},{input:"\\textrm",tag:"mstyle",output:"\\mathrm",ttype:DEFINITION},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:UNARY},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:UNARY,codes:AMbbb},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:UNARY,codes:AMcal},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:UNARY,codes:AMfrk}];var LMnames=[];function LMremoveCharsAndBlanks(c,d){var a;a=c.slice(d);for(var b=0;b=LMnames[a]}LMpreviousSymbol=LMcurrentSymbol;if(f!=""){LMcurrentSymbol=LMsymbols[d].ttype;return LMsymbols[d]}LMcurrentSymbol=CONST;a=1;l=h.slice(0,1);if("0"<=l&&l<="9"){m="mn"}else{m=(("A">l||l>"Z")&&("a">l||l>"z")?"mo":"mi")}return{input:l,tag:m,output:l,ttype:CONST}}var LMpreviousSymbol,LMcurrentSymbol;function LMparseSexpr(n){var t,m,d,a,r,o,l=document.createDocumentFragment();n=LMremoveCharsAndBlanks(n,0);t=LMgetSymbol(n);if(t==null||t.ttype==RIGHTBRACKET){return[null,n,null]}if(t.ttype==DEFINITION){n=t.output+LMremoveCharsAndBlanks(n,t.input.length);t=LMgetSymbol(n);if(t==null||t.ttype==RIGHTBRACKET){return[null,n,null]}}n=LMremoveCharsAndBlanks(n,t.input.length);switch(t.ttype){case SPACE:m=createMmlNode(t.tag);m.setAttribute(t.atname,t.atval);return[m,n,t.tag];case UNDEROVER:if(isIE){if(t.input.substr(0,4)=="\\big"){n="\\"+t.input.substr(4)+n;t=LMgetSymbol(n);t.ttype=UNDEROVER;n=LMremoveCharsAndBlanks(n,t.input.length)}}return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag];case CONST:var g=t.output;if(isIE){if(t.input=="'"){g="\u2032"}else{if(t.input=="''"){g="\u2033"}else{if(t.input=="'''"){g="\u2033\u2032"}else{if(t.input=="''''"){g="\u2033\u2033"}else{if(t.input=="\\square"){g="\u25A1"}else{if(t.input.substr(0,5)=="\\frac"){var b=t.input.substr(6,1);if(b=="5"||b=="6"){n=t.input.replace(/\\frac/,"\\frac ")+n;return[m,n,t.tag]}}}}}}}}m=createMmlNode(t.tag,document.createTextNode(g));return[m,n,t.tag];case LONG:m=createMmlNode(t.tag,document.createTextNode(t.output));m.setAttribute("minsize","1.5");m.setAttribute("maxsize","1.5");m=createMmlNode("mover",m);m.appendChild(createMmlNode("mspace"));return[m,n,t.tag];case STRETCHY:if(isIE&&t.input=="\\backslash"){t.output="\\"}m=createMmlNode(t.tag,document.createTextNode(t.output));if(t.input=="|"||t.input=="\\vert"||t.input=="\\|"||t.input=="\\Vert"){m.setAttribute("lspace","0em");m.setAttribute("rspace","0em")}m.setAttribute("maxsize",t.atval);if(t.rtag!=null){return[m,n,t.rtag]}else{return[m,n,t.tag]}case BIG:var f=t.atval;if(isIE){f=t.ieval}t=LMgetSymbol(n);if(t==null){return[null,n,null]}n=LMremoveCharsAndBlanks(n,t.input.length);m=createMmlNode(t.tag,document.createTextNode(t.output));if(isIE){var v=createMmlNode("mspace");v.setAttribute("height",f+"ex");m=createMmlNode("mrow",m);m.appendChild(v)}else{m.setAttribute("minsize",f);m.setAttribute("maxsize",f)}return[m,n,t.tag];case LEFTBRACKET:if(t.input=="\\left"){t=LMgetSymbol(n);if(t!=null){if(t.input=="."){t.invisible=true}n=LMremoveCharsAndBlanks(n,t.input.length)}}d=LMparseExpr(n,true,false);if(t==null||(typeof t.invisible=="boolean"&&t.invisible)){m=createMmlNode("mrow",d[0])}else{m=createMmlNode("mo",document.createTextNode(t.output));m=createMmlNode("mrow",m);m.appendChild(d[0])}return[m,d[1],d[2]];case MATRIX:if(t.input=="\\begin{array}"){var s="";t=LMgetSymbol(n);n=LMremoveCharsAndBlanks(n,0);if(t==null){s="l"}else{n=LMremoveCharsAndBlanks(n,t.input.length);if(t.input!="{"){s="l"}else{do{t=LMgetSymbol(n);if(t!=null){n=LMremoveCharsAndBlanks(n,t.input.length);if(t.input!="}"){s=s+t.input}}}while(t!=null&&t.input!=""&&t.input!="}")}}d=LMparseExpr("{"+n,true,true);m=createMmlNode("mtable",d[0]);s=s.replace(/l/g,"left ");s=s.replace(/r/g,"right ");s=s.replace(/c/g,"center ");m.setAttribute("columnalign",s);m.setAttribute("displaystyle","false");if(isIE){return[m,d[1],null]}var k=createMmlNode("mspace");k.setAttribute("width","0.167em");var p=createMmlNode("mspace");p.setAttribute("width","0.167em");var c=createMmlNode("mrow",k);c.appendChild(m);c.appendChild(p);return[c,d[1],null]}else{d=LMparseExpr("{"+n,true,true);m=createMmlNode("mtable",d[0]);if(isIE){m.setAttribute("columnspacing","0.25em")}else{m.setAttribute("columnspacing","0.167em")}m.setAttribute("columnalign","right center left");m.setAttribute("displaystyle","true");m=createMmlNode("mrow",m);return[m,d[1],null]}case TEXT:if(n.charAt(0)=="{"){r=n.indexOf("}")}else{r=0}if(r==-1){r=n.length}o=n.slice(1,r);if(o.charAt(0)==" "){m=createMmlNode("mspace");m.setAttribute("width","0.33em");l.appendChild(m)}l.appendChild(createMmlNode(t.tag,document.createTextNode(o)));if(o.charAt(o.length-1)==" "){m=createMmlNode("mspace");m.setAttribute("width","0.33em");l.appendChild(m)}n=LMremoveCharsAndBlanks(n,r+1);return[createMmlNode("mrow",l),n,null];case UNARY:d=LMparseSexpr(n);if(d[0]==null){return[createMmlNode(t.tag,document.createTextNode(t.output)),n]}if(typeof t.func=="boolean"&&t.func){o=n.charAt(0);if(o=="^"||o=="_"||o==","){return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag]}else{m=createMmlNode("mrow",createMmlNode(t.tag,document.createTextNode(t.output)));if(isIE){var v=createMmlNode("mspace");v.setAttribute("width","0.167em");m.appendChild(v)}m.appendChild(d[0]);return[m,d[1],t.tag]}}if(t.input=="\\sqrt"){if(isIE){var v=createMmlNode("mspace");v.setAttribute("height","1.2ex");v.setAttribute("width","0em");m=createMmlNode(t.tag,d[0]);m.appendChild(v);return[m,d[1],t.tag]}else{return[createMmlNode(t.tag,d[0]),d[1],t.tag]}}else{if(typeof t.acc=="boolean"&&t.acc){m=createMmlNode(t.tag,d[0]);var g=t.output;if(isIE){if(t.input=="\\hat"){g="\u0302"}else{if(t.input=="\\widehat"){g="\u005E"}else{if(t.input=="\\bar"){g="\u00AF"}else{if(t.input=="\\grave"){g="\u0300"}else{if(t.input=="\\tilde"){g="\u0303"}}}}}}var c=createMmlNode("mo",document.createTextNode(g));if(t.input=="\\vec"||t.input=="\\check"){c.setAttribute("maxsize","1.2")}if(isIE&&t.input=="\\bar"){c.setAttribute("maxsize","0.5")}if(t.input=="\\underbrace"||t.input=="\\underline"){c.setAttribute("accentunder","true")}else{c.setAttribute("accent","true")}m.appendChild(c);if(t.input=="\\overbrace"||t.input=="\\underbrace"){m.ttype=UNDEROVER}return[m,d[1],t.tag]}else{if(!isIE&&typeof t.codes!="undefined"){for(r=0;r64&&o.charCodeAt(q)<91){h=h+String.fromCharCode(t.codes[o.charCodeAt(q)-65])}else{h=h+o.charAt(q)}}if(d[0].nodeName=="mi"){d[0]=createMmlNode("mo").appendChild(document.createTextNode(h))}else{d[0].replaceChild(createMmlNode("mo").appendChild(document.createTextNode(h)),d[0].childNodes[r])}}}}m=createMmlNode(t.tag,d[0]);m.setAttribute(t.atname,t.atval);if(t.input=="\\scriptstyle"||t.input=="\\scriptscriptstyle"){m.setAttribute("displaystyle","false")}return[m,d[1],t.tag]}}case BINARY:d=LMparseSexpr(n);if(d[0]==null){return[createMmlNode("mo",document.createTextNode(t.input)),n,null]}a=LMparseSexpr(d[1]);if(a[0]==null){return[createMmlNode("mo",document.createTextNode(t.input)),n,null]}if(t.input=="\\root"||t.input=="\\stackrel"){l.appendChild(a[0])}l.appendChild(d[0]);if(t.input=="\\frac"){l.appendChild(a[0])}return[createMmlNode(t.tag,l),a[1],t.tag];case INFIX:n=LMremoveCharsAndBlanks(n,t.input.length);return[createMmlNode("mo",document.createTextNode(t.output)),n,t.tag];default:return[createMmlNode(t.tag,document.createTextNode(t.output)),n,t.tag]}}function LMparseIexpr(g){var f,d,b,c,h,k,j;g=LMremoveCharsAndBlanks(g,0);d=LMgetSymbol(g);h=LMparseSexpr(g);c=h[0];g=h[1];k=h[2];f=LMgetSymbol(g);if(f.ttype==INFIX){g=LMremoveCharsAndBlanks(g,f.input.length);h=LMparseSexpr(g);if(h[0]==null){h[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}g=h[1];k=h[2];if(f.input=="_"||f.input=="^"){b=LMgetSymbol(g);k=null;j=((d.ttype==UNDEROVER)||(c.ttype==UNDEROVER));if(f.input=="_"&&b.input=="^"){g=LMremoveCharsAndBlanks(g,b.input.length);var a=LMparseSexpr(g);g=a[1];k=a[2];c=createMmlNode((j?"munderover":"msubsup"),c);c.appendChild(h[0]);c.appendChild(a[0])}else{if(f.input=="_"){c=createMmlNode((j?"munder":"msub"),c);c.appendChild(h[0])}else{c=createMmlNode((j?"mover":"msup"),c);c.appendChild(h[0])}}c=createMmlNode("mrow",c)}else{c=createMmlNode(f.tag,c);if(f.input=="\\atop"||f.input=="\\choose"){c.setAttribute("linethickness","0ex")}c.appendChild(h[0]);if(f.input=="\\choose"){c=createMmlNode("mfenced",c)}}}return[c,g,k]}function LMparseExpr(o,p,v){var w,l,a,s,z,f=document.createDocumentFragment();do{o=LMremoveCharsAndBlanks(o,0);a=LMparseIexpr(o);l=a[0];o=a[1];z=a[2];w=LMgetSymbol(o);if(l!=undefined){if((z=="mn"||z=="mi")&&w!=null&&typeof w.func=="boolean"&&w.func){var y=createMmlNode("mspace");y.setAttribute("width","0.167em");l=createMmlNode("mrow",l);l.appendChild(y)}f.appendChild(l)}}while((w.ttype!=RIGHTBRACKET)&&w!=null&&w.output!="");z=null;if(w.ttype==RIGHTBRACKET){if(w.input=="\\right"){o=LMremoveCharsAndBlanks(o,w.input.length);w=LMgetSymbol(o);if(w!=null&&w.input=="."){w.invisible=true}if(w!=null){z=w.rtag}}if(w!=null){o=LMremoveCharsAndBlanks(o,w.input.length)}var t=f.childNodes.length;if(v&&t>0&&f.childNodes[t-1].nodeName=="mrow"&&t>1&&f.childNodes[t-2].nodeName=="mo"&&f.childNodes[t-2].firstChild.nodeValue=="&"){var c=[];var h=f.childNodes.length;for(s=0;v&&s2){f.removeChild(f.firstChild);f.removeChild(f.firstChild)}x.appendChild(createMmlNode("mtr",d))}return[x,o]}if(typeof w.invisible!="boolean"||!w.invisible){l=createMmlNode("mo",document.createTextNode(w.output));f.appendChild(l)}}return[f,o,z]}var tcnt=0,dcnt=0;function simpleLaTeXformatting(a){a=a.replace(/\$\$((.|\n)*?)\$\$/g,'

$\\displaystyle{$1}$

');a=a.replace(/\\begin{(theorem|lemma|proposition|corollary)}((.|\n)*?)\\end{\1}/g,function(d,c,b){tcnt++;return""+c.charAt(0).toUpperCase()+c.slice(1)+" "+tcnt+". "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+""});a=a.replace(/\\begin{(definition|example|remark|problem|exercise|conjecture|solution)}((.|\n)*?)\\end{\1}/g,function(d,c,b){dcnt++;return""+c.charAt(0).toUpperCase()+c.slice(1)+" "+dcnt+". "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")});a=a.replace(/\\begin{proof}((.|\n)*?)\\end{proof}/g,function(c,b){return"Proof: "+b.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+" □"});a=a.replace(/\\emph{(.*?)}/g,"$1");a=a.replace(/\\textbf{(.*?)}/g,"$1");a=a.replace(/\\cite{(.*?)}/g,"[$1]");a=a.replace(/\\chapter{(.*?)}/g,"

$1

");a=a.replace(/\\section{(.*?)}(\s*<\/?(br|p)\s?\/?>)?/g,"

$1

");a=a.replace(/\\subsection{((.|\n)*?)}/g,"

$1

");a=a.replace(/\\begin{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
    ");a=a.replace(/\\item\s((.|\n)*?)(?=(\\item|\\end))/g,"
  • $1
  • ");a=a.replace(/\\end{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
");a=a.replace(/\\begin{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
    ");a=a.replace(/\\end{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
");a=a.replace(/\\item\[(.*?)]{(.*?)}/g,"
$1
$2
");a=a.replace(/\\begin{description}/g,"
");a=a.replace(/\\end{description}/g,"
");a=a.replace(/\\newline\b/g,"
");a=a.replace(/\\newpage\b/g,'
');a=a.replace(/\\par\b/g,"

 

");a=a.replace(/\\bigskip/g,'

 

');a=a.replace(/\\medskip/g,'

 

');a=a.replace(/\\smallskip/g,'

 

');a=a.replace(/\\begin{center}((.|\n)*?)\\end{center}/g,"
$1
");return a}function ASCIIandgraphformatting(a){a=a.replace(/(.*?)<\/sup>(\s|(\S))/gi,"^{$1} $3");a=a.replace(/(Proof:)/g,"$1");a=a.replace(/QED/g,"    □");a=a.replace(/(\\?end{?a?math}?)/ig,"$1");a=a.replace(/(\bamath\b|\\begin{a?math})/ig,"$1");a=a.replace(/([>\n])(Theorem|Lemma|Proposition|Corollary|Definition|Example|Remark|Problem|Exercise|Conjecture|Solution)(:|\W\W?(\w|\s|-|\.)*?\W?:)/g,"$1$2$3");a=a.replace(/
/gi,"\n")+"'/>
"});a=a.replace(/insertASCIIMathCalculator/g,'
');return a}function LMprocessNode(f){var d,a;try{a=f.innerHTML}catch(b){}if((a==null||a.indexOf("$ ")!=-1||a.indexOf("$<")!=-1||a.indexOf("\\begin")!=-1||a.slice(-1)=="$"||a.indexOf("$\n")!=-1)&&!/edit-content|HTMLArea|wikiedit|wpTextbox1/.test(a)){if(!avoidinnerHTML&&translateLaTeXformatting){a=simpleLaTeXformatting(a)}a=a.replace(/%7E/g,"~");if(!avoidinnerHTML){f.innerHTML=a}processNodeR(f,false,true)}}var checkIfSVGavailable=true;var notifyIfNoSVG=true;var alertIfNoSVG=false;var noSVG=false;var defaultwidth=300;defaultheight=200;var defaultxmin=-5.5;defaultxmax=5.5;var defaultborder=0;border=defaultborder;var defaultstrokewidth="1";var defaultstroke="blue";var defaultstrokeopacity=1;var defaultstrokedasharray=null;var defaultfill="none";var defaultfillopacity=1;var defaultfontstyle="normal";var defaultfontfamily="times";var defaultfontsize="16";var defaultfontweight="normal";var defaultfontstroke="none";var defaultfontfill="none";var defaultmarker="none";var defaultendpoints="";var showcoordinates=true;var markerstrokewidth="1";var markerstroke="black";var markerfill="yellow";var markersize=4;var arrowfill=stroke;var dotradius=4;var ticklength=4;var axesstroke="black";var gridstroke="grey";var backgroundstyle="fill-opacity:1; fill:white";var singlelettersitalic=true;var picturepos=null;var xunitlength;var yunitlength;var origin=[0,0];var above="above";var below="below";var left="left";var right="right";var aboveleft="aboveleft";var aboveright="aboveright";var belowleft="belowleft";var belowright="belowright";var xmin,xmax,ymin,ymax,xscl,yscl,xgrid,ygrid,xtick,ytick,initialized;var strokewidth,strokedasharray,stroke,fill,strokeopacity,fillopacity;var fontstyle,fontfamily,fontsize,fontweight,fontstroke,fontfill;var marker,endpoints,dynamic={};var picture,svgpicture,doc,width,height;var isIE=document.createElementNS==null;var cpi="\u03C0",ctheta="\u03B8";var log=function(a){return ln(a)/ln(10)};var pi=Math.PI,e=Math.E,ln=Math.log,sqrt=Math.sqrt;var floor=Math.floor,ceil=Math.ceil,abs=Math.abs;var sin=Math.sin,cos=Math.cos,tan=Math.tan;var arcsin=Math.asin,arccos=Math.acos,arctan=Math.atan;var sec=function(a){return 1/Math.cos(a)};var csc=function(a){return 1/Math.sin(a)};var cot=function(a){return 1/Math.tan(a)};var arcsec=function(a){return arccos(1/a)};var arccsc=function(a){return arcsin(1/a)};var arccot=function(a){return arctan(1/a)};var sinh=function(a){return(Math.exp(a)-Math.exp(-a))/2};var cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};var tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};var sech=function(a){return 1/cosh(a)};var csch=function(a){return 1/sinh(a)};var coth=function(a){return 1/tanh(a)};var arcsinh=function(a){return ln(a+Math.sqrt(a*a+1))};var arccosh=function(a){return ln(a+Math.sqrt(a*a-1))};var arctanh=function(a){return ln((1+a)/(1-a))/2};var sech=function(a){return 1/cosh(a)};var csch=function(a){return 1/sinh(a)};var coth=function(a){return 1/tanh(a)};var arcsech=function(a){return arccosh(1/a)};var arccsch=function(a){return arcsinh(1/a)};var arccoth=function(a){return arctanh(1/a)};var sign=function(a){return(a==0?0:(a<0?-1:1))};function factorial(a,c){if(c==null){c=1}if(Math.abs(a-Math.round(a*1000000)/1000000)<1e-15){a=Math.round(a*1000000)/1000000}if(a-Math.floor(a)!=0){return NaN}for(var b=a-c;b>0;b-=c){a*=b}return(a<0?NaN:(a==0?1:a))}function C(a,b){var d=1;for(var c=0;c=xmax){alert("Picture requires at least two numbers: xmin < xmax")}else{if(a!=null&&(typeof c!="number"||typeof a!="number"||c>=a)){alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax")}else{if(width==null){width=picture.getAttribute("width");if(width==null||width==""){width=defaultwidth}}picture.setAttribute("width",width);if(height==null){height=picture.getAttribute("height");if(height==null||height==""){height=defaultheight}}picture.setAttribute("height",height);xunitlength=(width-2*border)/(xmax-xmin);yunitlength=xunitlength;if(ymin==null){origin=[-xmin*xunitlength+border,height/2];ymin=-(height-2*border)/(2*yunitlength);ymax=-ymin}else{if(ymax!=null){yunitlength=(height-2*border)/(ymax-ymin)}else{ymax=(height-2*border)/yunitlength+ymin}origin=[-xmin*xunitlength+border,-ymin*yunitlength+border]}if(isIE){if(picture.FULLSCREEN==undefined){setTimeout("drawPictures()",50);throw"wait"}svgpicture=picture.getSVGDocument().getElementById("root");if(svgpicture==null){setTimeout("drawPictures()",50);throw"wait"}svgpicture=picture.getSVGDocument().getElementById("root");while(svgpicture.childNodes.length>0){svgpicture.removeChild(svgpicture.lastChild)}svgpicture.setAttribute("width",width);svgpicture.setAttribute("height",height);svgpicture.setAttribute("name",picture.getAttribute("id"));doc=picture.getSVGDocument()}else{var b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("id",picture.getAttribute("id"));b.setAttribute("name",picture.getAttribute("id"));b.setAttribute("width",picture.getAttribute("width"));b.setAttribute("height",picture.getAttribute("height"));picturepos=findPos(picture);if(picture.parentNode!=null){picture.parentNode.replaceChild(b,picture)}else{svgpicture.parentNode.replaceChild(b,svgpicture)}svgpicture=b;doc=document}var g=document.getElementById(picture.getAttribute("id")+"mml");if(g!=null){while(g.childNodes.length>0){g.removeChild(g.lastChild)}}svgpicture.setAttribute("xunitlength",xunitlength);svgpicture.setAttribute("yunitlength",yunitlength);svgpicture.setAttribute("xmin",xmin);svgpicture.setAttribute("xmax",xmax);svgpicture.setAttribute("ymin",ymin);svgpicture.setAttribute("ymax",ymax);svgpicture.setAttribute("ox",origin[0]);svgpicture.setAttribute("oy",origin[1]);var d=myCreateElementSVG("rect");d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("width",width);d.setAttribute("height",height);d.setAttribute("style",backgroundstyle);svgpicture.appendChild(d);svgpicture.setAttribute("onmousemove","displayCoord(evt)");svgpicture.setAttribute("onmouseout","removeCoord(evt)");svgpicture.setAttribute("onclick","mClick(evt)");d=myCreateElementSVG("text");d.appendChild(doc.createTextNode(" "));d.setAttribute("id","coords");svgpicture.appendChild(d);d=myCreateElementSVG("text");d.appendChild(doc.createTextNode(" "));d.setAttribute("id","coords");svgpicture.appendChild(d);border=defaultborder}}}}function line(d,c,f,a){var b;if(f!=null){b=doc.getElementById(f)}if(b==null){b=myCreateElementSVG("path");b.setAttribute("id",f);svgpicture.appendChild(b)}b.setAttribute("d","M"+(d[0]*xunitlength+origin[0])+","+(height-d[1]*yunitlength-origin[1])+" "+(c[0]*xunitlength+origin[0])+","+(height-c[1]*yunitlength-origin[1]));b.setAttribute("stroke-width",strokewidth);if(strokedasharray!=null){b.setAttribute("stroke-dasharray",strokedasharray)}b.setAttribute("stroke",stroke);b.setAttribute("fill",fill);b.setAttribute("stroke-opacity",strokeopacity);b.setAttribute("fill-opacity",fillopacity);if(marker=="dot"||marker=="arrowdot"){ASdot(d,markersize,markerstroke,markerfill);if(marker=="arrowdot"){arrowhead(d,c)}ASdot(c,markersize,markerstroke,markerfill)}else{if(marker=="arrow"){arrowhead(d,c)}}if(a==null&&endpoints!=""){a=endpoints}if(a!=null){if(a.indexOf("<-")!=-1){arrowhead(c,d)}if(a.indexOf("o-")!=-1){dot(d,"open")}if(a.indexOf("*-")!=-1){dot(d,"closed")}if(a.indexOf("->")!=-1){arrowhead(d,c)}if(a.indexOf("-o")!=-1){dot(c,"open")}if(a.indexOf("-*")!=-1){dot(c,"closed")}}}function path(g,j,h,a){if(h==null){h=""}var f,b,d;if(j!=null){f=doc.getElementById(j)}if(f==null){f=myCreateElementSVG("path");f.setAttribute("id",j);svgpicture.appendChild(f)}if(typeof g=="string"){b=g}else{b="M";b+=(g[0][0]*xunitlength+origin[0])+","+(height-g[0][1]*yunitlength-origin[1])+" "+h;for(d=1;d")!=-1){arrowhead(g[g.length-2],g[g.length-1])}if(a.indexOf("-o")!=-1){dot(g[g.length-1],"open")}if(a.indexOf("-*")!=-1){dot(g[g.length-1],"closed")}}}function curve(b,c,a){path(b,c,"T",a)}function vector(b,a,c){line(b,a,c,"","->")}function circle(c,b,d){var a;if(d!=null){a=doc.getElementById(d)}if(a==null){a=myCreateElementSVG("circle");a.setAttribute("id",d);svgpicture.appendChild(a)}a.setAttribute("cx",c[0]*xunitlength+origin[0]);a.setAttribute("cy",height-c[1]*yunitlength-origin[1]);a.setAttribute("r",b*xunitlength);a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function loop(a,b,c){if(b==null){b=[1,0]}path([a,[a[0]+b[0],a[1]+b[1]],[a[0]-b[1],a[1]+b[0]],a],c,"C");if(marker=="arrow"||marker=="arrowdot"){arrowhead([a[0]+Math.cos(1.4)*b[0]-Math.sin(1.4)*b[1],a[1]+Math.sin(1.4)*b[0]+Math.cos(1.4)*b[1]],a)}}function arc(h,a,f,g,d){var c,b;if(g!=null){c=doc.getElementById(g)}if(d==null){d=0}if(f==null){b=[a[0]-h[0],a[1]-h[1]];f=Math.sqrt(b[0]*b[0]+b[1]*b[1])}if(c==null){c=myCreateElementSVG("path");c.setAttribute("id",g);svgpicture.appendChild(c)}c.setAttribute("d","M"+(h[0]*xunitlength+origin[0])+","+(height-h[1]*yunitlength-origin[1])+" A"+f*xunitlength+","+f*yunitlength+" 0 "+d+",0 "+(a[0]*xunitlength+origin[0])+","+(height-a[1]*yunitlength-origin[1]));c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke);c.setAttribute("fill",fill);c.setAttribute("stroke-opacity",strokeopacity);c.setAttribute("fill-opacity",fillopacity);if(marker=="arrow"||marker=="arrowdot"){u=[(a[1]-h[1])/4,(h[0]-a[0])/4];b=[(a[0]-h[0])/2,(a[1]-h[1])/2];b=[h[0]+b[0]+u[0],h[1]+b[1]+u[1]]}else{b=[h[0],h[1]]}if(marker=="dot"||marker=="arrowdot"){ASdot(h,markersize,markerstroke,markerfill);if(marker=="arrowdot"){arrowhead(b,a)}ASdot(a,markersize,markerstroke,markerfill)}else{if(marker=="arrow"){arrowhead(b,a)}}}function sector(c,g,a,f){var d=g[0]-c[0],b=g[1]-c[1];arc(g,a,Math.sqrt(d*d+b*b),f+"arc");path([a,c,g],f+"path")}function ellipse(c,d,b,f){var a;if(f!=null){a=doc.getElementById(f)}if(a==null){a=myCreateElementSVG("ellipse");a.setAttribute("id",f);svgpicture.appendChild(a)}a.setAttribute("cx",c[0]*xunitlength+origin[0]);a.setAttribute("cy",height-c[1]*yunitlength-origin[1]);a.setAttribute("rx",d*xunitlength);a.setAttribute("ry",b*yunitlength);a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function triangle(c,b,a,d){path([c,b,a,c],d)}function rect(f,c,g,d,b){var a;if(g!=null){a=doc.getElementById(g)}if(a==null){a=myCreateElementSVG("rect");a.setAttribute("id",g);svgpicture.appendChild(a)}a.setAttribute("x",f[0]*xunitlength+origin[0]);a.setAttribute("y",height-c[1]*yunitlength-origin[1]);a.setAttribute("width",(c[0]-f[0])*xunitlength);a.setAttribute("height",(c[1]-f[1])*yunitlength);if(d!=null){a.setAttribute("rx",d*xunitlength)}if(b!=null){a.setAttribute("ry",b*yunitlength)}a.setAttribute("stroke-width",strokewidth);a.setAttribute("stroke",stroke);a.setAttribute("fill",fill);a.setAttribute("stroke-opacity",strokeopacity);a.setAttribute("fill-opacity",fillopacity)}function text(a,l,h,b,j){var f,c,m=0,k=fontsize/3,g=l.toString();if(/(`|\$)/.test(g)){f=document.getElementById(svgpicture.getAttribute("name")+"mml");if(f!=null){if(b!=null){c=document.getElementById(b)}if(c==null){c=createElementXHTML("div");c.setAttribute("id",b);c.style.position="absolute";f.appendChild(c)}while(c.childNodes.length>0){c.removeChild(c.lastChild)}c.appendChild(document.createTextNode(g));if(/`/.test(g)){AMprocessNode(c)}else{LMprocessNode(c)}m=-c.offsetWidth/2;k=-c.offsetHeight/2;if(h!=null){if(/above/.test(h)){k=-c.offsetHeight}if(/below/.test(h)){k=0}if(/right/.test(h)){m=0}if(/left/.test(h)){m=-c.offsetWidth}}c.style.left=""+(a[0]*xunitlength+origin[0]+m)+"px";c.style.top=""+(height-a[1]*yunitlength-origin[1]+k)+"px"}return a}var d="middle";if(h!=null){if(/above/.test(h)){k=-fontsize/2}if(/below/.test(h)){k=fontsize-0}if(/right/.test(h)){d="start";m=fontsize/4}if(/left/.test(h)){d="end";m=-fontsize/4}}if(b!=null){c=doc.getElementById(b)}if(c==null){c=myCreateElementSVG("text");c.setAttribute("id",b);svgpicture.appendChild(c);c.appendChild(doc.createTextNode(g))}while(c.childNodes.length>1){c.removeChild(c.lastChild)}c.lastChild.nodeValue="\xA0"+g+"\xA0";c.setAttribute("x",a[0]*xunitlength+origin[0]+m);c.setAttribute("y",height-a[1]*yunitlength-origin[1]+k);c.setAttribute("font-style",(j!=null?j:(g.search(/^[a-zA-Z]$/)!=-1?"italic":fontstyle)));c.setAttribute("font-family",fontfamily);c.setAttribute("font-size",fontsize);c.setAttribute("font-weight",fontweight);c.setAttribute("text-anchor",d);if(fontstroke!="none"){c.setAttribute("stroke",fontstroke)}if(fontfill!="none"){c.setAttribute("fill",fontfill)}return a}function mtext(a,j,d,f,g){var c="middle";var k=0;var h=fontsize/3;if(d!=null){if(d.slice(0,5)=="above"){h=-fontsize/2}if(d.slice(0,5)=="below"){h=fontsize-0}if(d.slice(0,5)=="right"||d.slice(5,10)=="right"){c="start";k=fontsize/2}if(d.slice(0,4)=="left"||d.slice(5,9)=="left"){c="end";k=-fontsize/2}}var b=this;if(this.nodeName=="svg"){b=myCreateElementSVG("text");this.appendChild(b);b.appendChild(doc.createTextNode(j))}b.lastChild.nodeValue=j;b.setAttribute("x",a[0]+k);b.setAttribute("y",a[1]+h);b.setAttribute("font-style",(f!=null?f:fontstyle));b.setAttribute("font-family",fontfamily);b.setAttribute("font-size",(g!=null?g:fontsize));b.setAttribute("font-weight",fontweight);b.setAttribute("text-anchor",c);if(fontstroke!="none"){b.setAttribute("stroke",fontstroke)}if(fontfill!="none"){b.setAttribute("fill",fontfill)}}function image(b,f,a,c,g){var d;if(g!=null){d=doc.getElementById(g)}if(d==null){d=myCreateElementSVG("image");d.setAttribute("id",g);svgpicture.appendChild(d)}d.setAttribute("x",f[0]*xunitlength+origin[0]);d.setAttribute("y",height-f[1]*yunitlength-origin[1]);d.setAttribute("width",a);d.setAttribute("height",c);d.setAttribute("xlink:href",b)}function ASdot(g,d,a,c){if(a==null){a=stroke}if(c==null){c=fill}var b=myCreateElementSVG("circle");b.setAttribute("cx",g[0]*xunitlength+origin[0]);b.setAttribute("cy",height-g[1]*yunitlength-origin[1]);b.setAttribute("r",d);b.setAttribute("stroke-width",strokewidth);b.setAttribute("stroke",a);b.setAttribute("fill",c);svgpicture.appendChild(b)}function dot(f,d,b,j,h){var c;var a=f[0]*xunitlength+origin[0];var g=height-f[1]*yunitlength-origin[1];if(h!=null){c=doc.getElementById(h)}if(d=="+"||d=="-"||d=="|"){if(c==null){c=myCreateElementSVG("path");c.setAttribute("id",h);svgpicture.appendChild(c)}if(d=="+"){c.setAttribute("d"," M "+(a-ticklength)+" "+g+" L "+(a+ticklength)+" "+g+" M "+a+" "+(g-ticklength)+" L "+a+" "+(g+ticklength));c.setAttribute("stroke-width",0.5);c.setAttribute("stroke",axesstroke)}else{if(d=="-"){c.setAttribute("d"," M "+(a-ticklength)+" "+g+" L "+(a+ticklength)+" "+g)}else{c.setAttribute("d"," M "+a+" "+(g-ticklength)+" L "+a+" "+(g+ticklength))}c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke)}}else{if(c==null){c=myCreateElementSVG("circle");c.setAttribute("id",h);svgpicture.appendChild(c)}c.setAttribute("cx",a);c.setAttribute("cy",g);c.setAttribute("r",dotradius);c.setAttribute("stroke-width",strokewidth);c.setAttribute("stroke",stroke);c.setAttribute("fill",(d=="open"?"white":(d=="closed"?stroke:markerfill)))}if(b!=null){text(f,b,(j==null?"below":j),(h==null?h:h+"label"))}}point=dot;function arrowhead(j,h){var a;var c=[j[0]*xunitlength+origin[0],height-j[1]*yunitlength-origin[1]];var b=[h[0]*xunitlength+origin[0],height-h[1]*yunitlength-origin[1]];var f=[b[0]-c[0],b[1]-c[1]];var k=Math.sqrt(f[0]*f[0]+f[1]*f[1]);if(k>1e-8){f=[f[0]/k,f[1]/k];a=[-f[1],f[0]];var g=myCreateElementSVG("path");g.setAttribute("d","M "+(b[0]-15*f[0]-4*a[0])+" "+(b[1]-15*f[1]-4*a[1])+" L "+(b[0]-3*f[0])+" "+(b[1]-3*f[1])+" L "+(b[0]-15*f[0]+4*a[0])+" "+(b[1]-15*f[1]+4*a[1])+" z");g.setAttribute("stroke-width",markerstrokewidth);g.setAttribute("stroke",stroke);g.setAttribute("fill",stroke);g.setAttribute("stroke-opacity",strokeopacity);g.setAttribute("fill-opacity",fillopacity);svgpicture.appendChild(g)}}function chopZ(b){var a=b.indexOf(".");if(a==-1){return b}for(var c=b.length-1;c>a&&b.charAt(c)=="0";c--){}if(c==a){c--}return b.slice(0,c+1)}function grid(b,a){axes(b,a,null,b,a)}function noaxes(){if(!initialized){initPicture()}}function axes(dx,dy,labels,gdx,gdy){var x,y,ldx,ldy,lx,ly,lxp,lyp,pnode,st;if(!initialized){initPicture()}if(typeof dx=="string"){labels=dx;dx=null}if(typeof dy=="string"){gdx=dy;dy=null}if(xscl!=null){dx=xscl;gdx=xscl;labels=dx}if(yscl!=null){dy=yscl;gdy=yscl}if(xtick!=null){dx=xtick}if(ytick!=null){dy=ytick}dx=(dx==null?xunitlength:dx*xunitlength);dy=(dy==null?dx:dy*yunitlength);fontsize=Math.min(dx/2,dy/2,16);ticklength=fontsize/4;if(xgrid!=null){gdx=xgrid}if(ygrid!=null){gdy=ygrid}if(gdx!=null){gdx=(typeof gdx=="string"?dx:gdx*xunitlength);gdy=(gdy==null?dy:gdy*yunitlength);pnode=myCreateElementSVG("path");st="";for(x=origin[0];x0;x=x-gdx){st+=" M"+x+",0 "+x+","+height}for(y=height-origin[1];y0;y=y-gdy){st+=" M0,"+y+" "+width+","+y}pnode.setAttribute("d",st);pnode.setAttribute("stroke-width",0.5);pnode.setAttribute("stroke",gridstroke);pnode.setAttribute("fill",fill);svgpicture.appendChild(pnode)}pnode=myCreateElementSVG("path");st="M0,"+(height-origin[1])+" "+width+","+(height-origin[1])+" M"+origin[0]+",0 "+origin[0]+","+height;for(x=origin[0]+dx;x0;x=x-dx){st+=" M"+x+","+(height-origin[1]+ticklength)+" "+x+","+(height-origin[1]-ticklength)}for(y=height-origin[1]+dy;y0;y=y-dy){st+=" M"+(origin[0]+ticklength)+","+y+" "+(origin[0]-ticklength)+","+y}if(labels!=null){with(Math){ldx=dx/xunitlength;ldy=dy/yunitlength;lx=(xmin>0||xmax<0?xmin:0);ly=(ymin>0||ymax<0?ymin:0);lxp=(ly==0?"below":"above");lyp=(lx==0?"left":"right");var ddx=floor(1.1-log(ldx)/log(10))+1;var ddy=floor(1.1-log(ldy)/log(10))+1;for(x=ldx;x<=xmax;x=x+ldx){text([x,ly],chopZ(x.toFixed(ddx)),lxp)}for(x=-ldx;xmin<=x;x=x-ldx){text([x,ly],chopZ(x.toFixed(ddx)),lxp)}for(y=ldy;y<=ymax;y=y+ldy){text([lx,y],chopZ(y.toFixed(ddy)),lyp)}for(y=-ldy;ymin<=y;y=y-ldy){text([lx,y],chopZ(y.toFixed(ddy)),lyp)}}}fontsize=defaultfontsize;pnode.setAttribute("d",st);pnode.setAttribute("stroke-width",0.5);pnode.setAttribute("stroke",axesstroke);pnode.setAttribute("fill",fill);pnode.setAttribute("stroke-opacity",strokeopacity);pnode.setAttribute("fill-opacity",fillopacity);svgpicture.appendChild(pnode)}function mathjs(c){c=c.replace(/\s/g,"");if(c.indexOf("^-1")!=-1){c=c.replace(/sin\^-1/g,"arcsin");c=c.replace(/cos\^-1/g,"arccos");c=c.replace(/tan\^-1/g,"arctan");c=c.replace(/sec\^-1/g,"arcsec");c=c.replace(/csc\^-1/g,"arccsc");c=c.replace(/cot\^-1/g,"arccot");c=c.replace(/sinh\^-1/g,"arcsinh");c=c.replace(/cosh\^-1/g,"arccosh");c=c.replace(/tanh\^-1/g,"arctanh");c=c.replace(/sech\^-1/g,"arcsech");c=c.replace(/csch\^-1/g,"arccsch");c=c.replace(/coth\^-1/g,"arccoth")}c=c.replace(/^e$/g,"(Math.E)");c=c.replace(/^e([^a-zA-Z])/g,"(Math.E)$1");c=c.replace(/([^a-zA-Z])e/g,"$1(Math.E)");c=c.replace(/([0-9])([\(a-zA-Z])/g,"$1*$2");c=c.replace(/\)([\(0-9a-zA-Z])/g,")*$1");var d,b,a,f,g;while((d=c.indexOf("^"))!=-1){if(d==0){return"Error: missing argument"}b=d-1;f=c.charAt(b);if(f>="0"&&f<="9"){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}if(f=="."){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}}}else{if(f==")"){g=1;b--;while(b>=0&&g>0){f=c.charAt(b);if(f=="("){g--}else{if(f==")"){g++}}b--}while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){b--;while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{return"Error: incorrect syntax in "+c+" at position "+b}}}if(d==c.length-1){return"Error: missing argument"}a=d+1;f=c.charAt(a);if(f>="0"&&f<="9"||f=="-"){a++;while(a="0"&&f<="9"){a++}if(f=="."){a++;while(a="0"&&f<="9"){a++}}}else{if(f=="("){g=1;a++;while(a0){f=c.charAt(a);if(f=="("){g++}else{if(f==")"){g--}}a++}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){a++;while(a="a"&&f<="z"||f>="A"&&f<="Z"){a++}}else{return"Error: incorrect syntax in "+c+" at position "+a}}}c=c.slice(0,b+1)+"Math.pow("+c.slice(b+1,d)+","+c.slice(d+1,a)+")"+c.slice(a)}while((d=c.indexOf("!"))!=-1){if(d==0){return"Error: missing argument"}b=d-1;f=c.charAt(b);if(f>="0"&&f<="9"){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}if(f=="."){b--;while(b>=0&&(f=c.charAt(b))>="0"&&f<="9"){b--}}}else{if(f==")"){g=1;b--;while(b>=0&&g>0){f=c.charAt(b);if(f=="("){g--}else{if(f==")"){g++}}b--}while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{if(f>="a"&&f<="z"||f>="A"&&f<="Z"){b--;while(b>=0&&(f=c.charAt(b))>="a"&&f<="z"||f>="A"&&f<="Z"){b--}}else{return"Error: incorrect syntax in "+c+" at position "+b}}}c=c.slice(0,b+1)+"factorial("+c.slice(b+1,d)+")"+c.slice(d+1)}return c}function plot(fun,x_min,x_max,points,id,endpts){var pth=[];var f=function(x){return x},g=fun;var name=null;if(typeof fun=="string"){eval("g = function(x){ with(Math) return "+mathjs(fun)+" }")}else{if(typeof fun=="object"){eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }");eval("g = function(t){ with(Math) return "+mathjs(fun[1])+" }")}}if(typeof x_min=="string"){name=x_min;x_min=xmin}else{name=id}var min=(x_min==null?xmin:x_min);var max=(x_max==null?xmax:x_max);var inc=max-min-0.000001*(max-min);inc=(points==null?inc/200:inc/points);var gt;for(var t=min;t<=max;t+=inc){gt=g(t);if(!(isNaN(gt)||Math.abs(gt)=="Infinity")){pth[pth.length]=[f(t),gt]}}path(pth,name,null,endpts);return pth}function slopefield(fun,dx,dy){var g=fun;if(typeof fun=="string"){eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }")}var gxy,x,y,u,v,dz;if(dx==null){dx=1}if(dy==null){dy=1}dz=Math.sqrt(dx*dx+dy*dy)/6;var x_min=Math.ceil(xmin/dx);var y_min=Math.ceil(ymin/dy);for(x=x_min;x<=xmax;x+=dx){for(y=y_min;y<=ymax;y+=dy){gxy=g(x,y);if(!isNaN(gxy)){if(Math.abs(gxy)=="Infinity"){u=0;v=dz}else{u=dz/Math.sqrt(1+gxy*gxy);v=gxy*u}line([x-u,y-v],[x+u,y+v])}}}}function show_props(c){var b="";for(var a=0;a\nResult:     \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
';function generic(){if(!init()){return}if(translateOnLoad){var b=document.getElementById("processasciimathinmoodle");if(b!=null){dsvglocation=b.className}if(b!=null||!checkforprocessasciimathinmoodle){translate();if(!noSVG&&translateASCIIsvg){drawPictures()}}var a=getElementsByClass(document,"div","ASCIIMathCalculator");if(!noMathML&&a.length>0){initASCIIMathCalculators(a)}}}if(typeof window.addEventListener!="undefined"){window.addEventListener("load",generic,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",generic,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",generic)}else{if(typeof window.onload=="function"){var existing=onload;window.onload=function(){existing();generic()}}else{window.onload=generic}}}};