<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
|''Type:''|file|
|''URL:''|http://tw.lewcid.org/|
|''Workspace:''|(default)|

This tiddler was automatically created to record the details of this server
Met with Julian and his postdoc Martin Madera.

Ref: Unicellular Ca2+ Signaling 'Toolkit' at the Origin of Metazoa - Xinjiang Cai

Need to start working out what the toolkit really consists of and write down all the domains/proteins/families involved. Looked like all EF-Hands are important. Above reference has some nice stuff on the toolkit being present in eukaryotes before they formed multicellularity (sponges). 
Met with Alistair, was excited by the paper from Martin, looks like I need to focus a bit on the findings from that paper, maybe work out how the sequence numbers are related to the other parts of the toolkit I specify from the MB review paper. Alistair is off for a week as well as Julian today, so need to get some stuff ready to look at (first draft of the toolkit in more informatics form). Meeting in 10 days Monday 6th July?
/***
|''Name:''|BibTeXPlugin|
|''Description:''|Very incomplete BibTeX implementation to work with bibliographic references|
|''Author:''|Paulo Soares|
|''Version:''|1.2.1|
|''Date:''|2009-04-30|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Overrides''|Story.prototype.refreshTiddler|
|''Documentation:''|[[BibTeXPlugin Documentation|BibTeXPluginDoc]]|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.5.0|
***/
//{{{
if(!version.extensions.BibTeXPlugin) { //# ensure that the plugin is only installed once
version.extensions.BibTeXPlugin = {installed: true};

(function($) {
config.macros.cite = {
  noReference: "(??)",
  refreshTiddler: Story.prototype.refreshTiddler
};

config.macros.cite.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
  if(params.length==0) return;
  var entry = params[0];
  var args = paramString.parseParams(null,null,true);
  var title = getParam(args,"bibliography",null);
  if(title) {
    this.biblioTiddler = title;
  } else {title = this.biblioTiddler;}
  title = getParam(args,"thisBibliography",title);
  var format = getParam(args,"format",null);
  if(format) {
    this.format = format;
  } else {format = this.format;}
  if(format) {
    this.format = format;
  } else {format = this.format;}
  format = getParam(args,"thisFormat",format);
  var argsArray = paramString.readMacroParams();
  var showAll = ($.inArray('showAll',argsArray) > -1);
  if(title && store.tiddlerExists(title)) var text = config.macros.bibliography.extractEntry(title, entry);
  if(text) {
    this.entries.push(entry);
    var bib = config.macros.bibliography.processEntry(text, showAll);
    var citation = format.replace("$", bib[0]);
    citation = citation.replace("#", bib[1]);
    wikify(citation, place);
  } else {
    wikify(this.noReference, place);
  }
}

Story.prototype.refreshTiddler = function(title,template,force){
  config.macros.cite.biblioTiddler = null;
  config.macros.cite.format = "$ (#)";
  config.macros.cite.entries = [];
  var tiddler = config.macros.cite.refreshTiddler.apply(this,arguments);
  return tiddler;
}

config.macros.bibliography = {};

config.macros.bibliography.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	var title = (config.macros.cite.biblioTiddler) ? config.macros.cite.biblioTiddler : params[0];
	if(!title || !store.tiddlerExists(title)) return;
        var argsArray = paramString.readMacroParams();
	var showAll = ($.inArray('showAll',argsArray) > -1);
	var i, entry, entryText, start, bib, prefix;
	var entries = [];
	if(showAll) {
		entryText = this.extractAllEntries(title);
		for(i=0; i<entryText.length; i++) {
			entries[entries.length] = this.processEntry(entryText[i], true)[2];
		}
	} else {
		for(i=0; i<config.macros.cite.entries.length; i++){
			entryText = this.extractEntry(title, config.macros.cite.entries[i]);
			if(entryText) {
				bib = this.processEntry(entryText, true);
				if(entries.indexOf(bib[2])==-1) entries[entries.length] = bib[2];
			}
		}
	}
	entries.sort();
	for (i=0; i < entries.length; i++) {
		prefix = (i>0) ? "\n\n" : "";
		wikify(prefix + entries[i] , place);
	}
	return true;
}

config.macros.bibliography.processNames = function(names, showAll) {
	var i, authors = names.split(" and ");
	var entry = authors[0];
	var numAuthors = authors.length;
	var fullEntry = entry;
	if (numAuthors==2) {
		entry += " and " + authors[1];
		fullEntry = entry;
	}
	if (numAuthors>2) {
		fullEntry = entry;
		for (i=1; i < numAuthors; i++) {
			if (i==numAuthors-1) {fullEntry += " and "} else {fullEntry += ", "};
			fullEntry += authors[i];
		}
		if(showAll) {entry = fullEntry;} else {entry += " et al.";}
	}
	return [entry,fullEntry];
}

config.macros.bibliography.processEntry = function(text,showAll) {
	var type = text.substring(text.indexOf("@")+1,text.indexOf("{"));
	var authors = this.processNames(text.extract("author"), showAll);
	var fullEntry = authors[1] + " ("+text.extract("year")+").";
	var url = text.extract("url");
	var title = (url) ? "[[" + text.extract("title") + "|" + url + "]]" : text.extract("title") ;
	switch(type.toLowerCase()) {
		case "article":
			fullEntry += " " + title + ". //" + text.extract("journal") + "// \'\'" + text.extract("volume") + "\'\', " + text.extract("pages").replace(/-+/,"—") + ".";
			break;
		case "book":
			fullEntry += " //" + title + "//. "  + text.extract("publisher") + ".";
			break;
		case "inproceedings":
			fullEntry += " " + title + ". In " + this.processNames(text.extract("editor"),true)[1] + " (Eds.), //" + text.extract("booktitle") + "//, " + text.extract("pages").replace(/-+/,"—") + ". " + text.extract("publisher") + ".";
			break;
		case "incollection":
			fullEntry += " " + title + ". In " + this.processNames(text.extract("editor"),true)[1] + " (Eds.), //" + text.extract("booktitle") + "//, " + text.extract("pages").replace(/-+/,"—") + ". " + text.extract("publisher") + ".";
			break;
		case "techreport":
			fullEntry += " " + title + ". Technical report, " + text.extract("institution") + ".";
			break;
		case "manual":
			fullEntry += " //" + title + "//. " + text.extract("organization") + ".";
			break;
		case "unpublished":
			fullEntry += " " + title + ". Unpublished.";
			break;
	}
	return [authors[0], text.extract("year"), fullEntry];
}

config.macros.bibliography.extractEntry = function(title,entry) {
	var parseText = store.getTiddlerText(title);
	var pos = parseText.indexOf(entry);
	if(pos==-1) return null;
	var previousText=parseText.substring(0,pos);
	var start = previousText.lastIndexOf("@",pos);
	var end = parseText.indexOf("@",pos);
	var entryText = ((end==-1) ? parseText.substring(start) : parseText.substring(start,end));
	return entryText;
}

config.macros.bibliography.extractAllEntries = function(title) {
	var parseText = store.getTiddlerText(title);
        var entries = parseText.split("@");
        entries.shift();
	return entries;
}

config.macros.bibliography.extractField = function(fieldDescr) {
        var i, pos = 0;
        do{
	      i = this.toLowerCase().indexOf(fieldDescr, pos);
              if(i == -1) {return "";}
              if(this.charAt(i-1).match(/\w/)==null){
                  break;
              } else {pos = i+1;}
        } while(true);
//	if (i != -1) {
		i += fieldDescr.length;
		i += 1 + (this.substring(i,this.length)).indexOf("=");
		if (i != -1) {
			var contExtr = true;
			var fieldDelim = ""
			var fieldText = "";
			var nestedPar = 0;
			while (i<this.length && contExtr) {
				if (fieldDelim == "") {
					if (this.charAt(i) == "\"" || this.charAt(i) == "\'" || this.charAt(i)=="\`") {
						fieldDelim = this.charAt(i);
					} else if (this.charAt(i) == "\{") {
						fieldDelim = "\}";
					} else if (this.charAt(i) != " " && this.charAt(i) != "\t" && this.charAt(i) != "\n") {
						fieldDelim = ",";
						i--;
					}
				} else {
					if (this.charAt(i) == "\{" && fieldDelim == "\}") {
						nestedPar++;
						fieldText += this.charAt(i);
					} else if (this.charAt(i) == fieldDelim) {
						if (nestedPar == 0) {
							contExtr = false;
						} else {
							nestedPar--;
							fieldText += this.charAt(i);
						}
					} else {
						fieldText += this.charAt(i);
					}
				}
				i++;
			}
			return fieldText;
		} else {
			return "";
		}
//	} else {
//		return "";
//	}
}

String.prototype.extract = config.macros.bibliography.extractField;

config.shadowTiddlers.BibTeXPluginDoc="The documentation is available [[here.|http://www.math.ist.utl.pt/~psoares/addons.html#BibTeXPluginDoc]]";
})(jQuery)
}
//}}}
@article{weiss2009hts,
  title={{The Human Thalamic Somatic Sensory Nucleus [Ventral Caudal (Vc)] Shows Neuronal Mechanoreceptor-Like Responses to Optimal Stimuli for Peripheral Mechanoreceptors}},
  author={Weiss, N. and Ohara, S. and Johnson, KO and Lenz, FA},
  journal={Journal of Neurophysiology},
  volume={101},
  number={2},
  pages={1033},
  year={2009},
  publisher={Am Physiological Soc}
}
@article{ohara2004mrh,
  title={{Microstimulation in the region of the human thalamic principal somatic sensory nucleus evokes sensations like those of mechanical stimulation and movement}},
  author={Ohara, S. and Weiss, N. and Lenz, F.A.},
  journal={Journal of neurophysiology},
  volume={91},
  number={2},
  pages={736--745},
  year={2004},
  publisher={Am Physiological Soc}
}
@conference{edin2006bia,
  title={{A bio-inspired approach for the design and characterization of a tactile sensory system for a cybernetic prosthetic hand}},
  author={Edin, BB and Beccai, L. and Ascari, L. and Roccella, S. and Cabibihan, JJ and Carrozza, MC},
  booktitle={Proceedings of the IEEE international conference on robotics and automation},
  pages={1354--1358},
  year={2006}
}
@conference{pfeiffer1999sma,
  title={{Shape memory alloy actuated robot prostheses: initial experiments}},
  author={Pfeiffer, C. and DeLaurentis, K. and Mavroidis, C.},
  booktitle={IEEE International Conference on Robotics and Automation},
  pages={2385--2391},
  year={1999},
  organization={Institute of Electrical Engineers Inc. (IEEE)}
}
@conference{delaurentis2000dsm,
  title={{Development of a shape memory alloy actuated robotic hand}},
  author={DeLaurentis, KJ and Mavroidis, C. and Pfeiffer, C.},
  booktitle={Proc. of the ACTUATOR 2000 Conference},
  pages={281--285},
  year={2000}
}
@article{bundhoo2008sma,
  title={{A shape memory alloy-based tendon-driven actuation system for biomimetic artificial fingers, part I: design and evaluation}},
  author={Bundhoo, V. and Haslam, E. and Birch, B. and Park, E.J.},
  journal={Robotica},
  volume={27},
  number={01},
  pages={131--146},
  year={2008},
  publisher={Cambridge Univ Press}
}



@article{eutick1978dht,
  title={{Dependence of the higher termite, Nasutitermes exitiosus and the lower termite, Coptotermes lacteus on their gut flora}},
  author={Eutick, ML and Veivers, P. and O'Brien, RW and Slaytor, M.},
  journal={J. Insect Physiol},
  volume={24},
  pages={363--368},
  year={1978}
}
@misc{lilburn2001nfs,
  title={{Nitrogen Fixation by Symbiotic and Free-Living Spirochetes}},
  author={Lilburn, TG and Kim, KS and Ostrom, NE and Byzek, KR and Leadbetter, JR and Breznak, JA},
  journal={Science},
  volume={292},
  number={5526},
  pages={2495--2498},
  year={2001}
}
@article{paster1996pny,
  title={{Phylogeny of not-yet-cultured spirochetes from termite guts}},
  author={Paster, BJ and Dewhirst, FE and Cooke, SM and Fussing, V. and Poulsen, LK and Breznak, JA},
  journal={Applied and Environmental Microbiology},
  volume={62},
  number={2},
  pages={347--352},
  year={1996},
  publisher={Am Soc Microbiol}
}
@misc{breznak2002pda,
  title={{Phylogenetic Diversity and Physiology of Termite Gut Spirochetes 1}},
  author={Breznak, J.A.},
  journal={Integrative and Comparative Biology},
  volume={42},
  number={2},
  pages={313--318},
  year={2002},
  publisher={Soc Integ Comp Biol}
}
@misc{pdil2006,
  title = {Pests and Disease Imagery Library: Mastotermes darwiniensis},
  author = {Walker, K.},
  URL = {http://www.padil.gov.au/viewPestDiagnosticImages.aspx?id=708},
  year = {updated Dec 2006}
}
@misc{mix2002,
  title = {M. paradoxa imagery.},
  author = {Soulia, D.},
  URL = {http://www.humboldt-foundation.de/kosmos/titel/2002_009.htm},
  year = {updated 2002}
}
@article{vila1997maa,
  title={{Multiple and Ancient Origins of the Domestic Dog}},
  author={Vila, C. and Savolainen, P. and Maldonado, J.E. and Amorim, I.R. and Rice, J.E. and Honeycutt, R.L. and Crandall, K.A. and Lundeberg, J. and Wayne, R.K.},
  journal={Science},
  volume={276},
  number={5319},
  pages={1687},
  year={1997},
  publisher={AAAS}
}
@article{cohn2007wwb,
  title={{How Wild Wolves Became Domestic Dogs}},
  author={Cohn, J.},
  year={2007},
  publisher={American Institute of Biological Sciences}
}
@article{mueller2005eai,
  title={{The Evolution of Agriculture in Insects}},
  author={Mueller, U.G. and Gerardo, N.M. and Aanen, D.K. and Six, D.L. and Schultz, T.R. and others},
  journal={Annual Review of Ecology, Evolution and Systematics},
  volume={36},
  pages={563--595},
  year={2005},
  publisher={Annual Reviews}
}
@article{mueller2008bia,
  title={{A breakthrough innovation in animal evolution}},
  author={Mueller, U.G. and Rabeling, C.},
  journal={Proceedings of the National Academy of Sciences},
  volume={105},
  number={14},
  pages={5287},
  year={2008},
  publisher={National Acad Sciences}
}
@article{schultz2008cme,
  title={{From the Cover: Major evolutionary transitions in ant agriculture}},
  author={Schultz, T.R. and Brady, S.G.},
  journal={Proceedings of the National Academy of Sciences},
  volume={105},
  number={14},
  pages={5435},
  year={2008},
  publisher={National Acad Sciences}
}
@article{konig2007fat,
  title={{The flagellates of the australian termite Mastotermes darwiniensis: Identification of their symbiotic bacteria and cellulases}},
  author={K{\"O}NIG, H. and FR{\"O}HLICH, J. and LI, LI and WENZEL, M. and BERCHTOLD, M. and DR{\"O}GE, S. and BREUNIG, A. and PFEIFFER, P. and RADEK, R. and BRUGEROLLE, G.},
  journal={Symbiosis(Philadelphia, PA)},
  volume={44},
  number={1-3},
  pages={51--65},
  year={2007},
  publisher={Balaban}
}
@article{konig2006bec,
  title={{Bacterial ectosymbionts which confer motility: Mixotricha paradoxa from the intestine of the Australian termite Mastotermes darwiniensis}},
  author={K{\"o}nig, H. and Li, L. and Wenzel, M. and Fr{\"o}hlich, J.},
  journal={Prog. Mol. Subcell. Biol},
  volume={41},
  pages={77--96},
  year={2006},
  publisher={Springer}
}
@article{goodisman2006par,
  title={{Population and reproductive structure in the giant northern termite, Mastotermes darwiniensis}},
  author={Goodisman, M.A.D.},
  year={2006}
}
@article{radek2007esf,
  title={{Ectobiotic spirochetes of flagellates from the termite Mastotermes darwiniensis: Attachment and cyst formation}},
  author={Radek, R. and Nitsch, G.},
  journal={European Journal of Protistology},
  volume={43},
  number={4},
  pages={281--294},
  year={2007},
  publisher={Elsevier}
}
@article{cleveland1964fsf,
  title={{The Fine Structure of the Flagellate Mixotricha paradoxa and Its Associated Micro-Organisms}},
  author={Cleveland, LR and Grimstone, AV},
  journal={Proceedings of the Royal Society of London. Series B, Biological Sciences},
  volume={159},
  number={977},
  pages={668--686},
  year={1964}
}
@article{wenzel2003ieb,
  title={{Identification of the ectosymbiotic bacteria of Mixotricha paradoxa involved in movement symbiosis}},
  author={Wenzel, M. and Radek, R. and Brugerolle, G. and K{\"o}nig, H.},
  journal={European Journal of Protistology},
  volume={39},
  number={1},
  pages={11--23},
  year={2003},
  publisher={Elsevier}
}
@article{sutherland1933mpa,
  title={{Memoirs: Protozoa from Australian Termites}},
  author={SUTHERLAND, J.L.},
  journal={Journal of Cell Science},
  volume={2},
  number={301},
  pages={145},
  year={1933},
  publisher={Co Biol}
}
@article{kreft1998bsi,
  title={{BacSim, a simulator for individual-based modelling of bacterial colony growth}},
  author={Kreft, JU and Booth, G. and Wimpenny, JW},
  journal={Microbiology},
  volume={144},
  number={12},
  pages={3275--3287},
  year={1998},
  publisher={Soc General Microbiol}
}
@article{ladley2005rlc,
  title={{The role of logistic constraints in termite construction of chambers and tunnels}},
  author={Ladley, D. and Bullock, S.},
  journal={Journal of Theoretical Biology},
  volume={234},
  number={4},
  pages={551--564},
  year={2005},
  publisher={Elsevier}
}
@article{bandi1995eis,
  title={{The Establishment of Intracellular Symbiosis in an Ancestor of Cockroaches and Termites}},
  author={Bandi, C. and Sironi, M. and Damiani, G. and Magrassi, L. and Nalepa, C.A. and Laudani, U. and Sacchi, L.},
  journal={Proceedings of the Royal Society B: Biological Sciences},
  volume={259},
  number={1356},
  pages={293--299},
  year={1995},
  publisher={The Royal Society}
}
@article{wier2002sap,
  title={{Spirochete and protist symbionts of a termite (Mastotermes electrodominicus) in Miocene amber}},
  author={Wier, A. and Dolan, M. and Grimaldi, D. and Guerrero, R. and Wagensberg, J. and Margulis, L.},
  journal={Proceedings of the National Academy of Sciences},
  pages={22643899},
  year={2002},
  publisher={National Acad Sciences}
}
@article{peters1998stq,
  title={{Subterranean termites in Queensland}},
  author={Peters, BC and King, J. and Wylie, FR},
  journal={Queensland Forestry Research Institute, Timber Note},
  year={1998}
}
@article{watson1977crl,
  title={{CASTE RATIOS IN A LONG-ESTABLISHED, NEOTENIC-HEADED LABORATORY COLONY OF MASTOTERMES DARWINIENSIS FROGGATT (ISOPTERA)}},
  author={Watson, JAL and Barrett, RA and Abbey, H.M.},
  journal={Australian Journal of Entomology},
  volume={16},
  number={4},
  pages={469--470},
  year={1977},
  publisher={Blackwell Synergy}
}
@article{watson1975psc,
  title={{Preliminary studies on the control of neotenic formation inMastotermes Darwiniensis Froggatt (Isoptera)}},
  author={Watson, J.A.L. and Metcalf, E.C. and Sewell, J.J.},
  journal={Insectes Sociaux},
  volume={22},
  number={4},
  pages={415--426},
  year={1975},
  publisher={Springer}
}
@article{spragg1974urt,
  title={{The use of a radioactive tracer to study the nesting system ofMastotermes darwiniensis Froggatt}},
  author={Spragg, W.T. and Fox, R.E.},
  journal={Insectes Sociaux},
  volume={21},
  number={3},
  pages={309--316},
  year={1974},
  publisher={Springer}
}
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
Probability & Graph Theory - 50 exam 48 hw  C
Mathematical Modelling - B
Information Theory - C
Protein Structure - 75%
Global Climate Change - 78%
Scientific Computing - C
Exabyte Informatics - B
Neuroscience - B
Communications Theory - 68%

To Do
Philosophy

Unknowns
Nonlinear Dynamics - ? (probably an F :( )
Nonlinear Control Theory - ? hopefully a C or B
Biology - ? B or an A maybe
Chemistry - ?
Computational Pattern Analysis - ?

/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FullScreenPlugin|
|Version|1.1|
|Requires|~TW2.x|
!Description:
Toggle between viewing tiddlers fullscreen and normally. Very handy for when you need more viewing space.

!Demo:
Click the ↕ button in the toolbar for this tiddler. Click it again to turn off fullscreen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.

!History:
*25-07-06: ver 1.1
*20-07-06: ver 1.0

!Code
***/
//{{{
var lewcidFullScreen = false;

config.commands.fullscreen =
{
            text:" ↕ ",
            tooltip:"Fullscreen mode"
};

config.commands.fullscreen.handler = function (event,src,title)
{
            if (lewcidFullScreen == false)
               {
                lewcidFullScreen = true;
                setStylesheet('#sidebar, .header, #mainMenu{display:none;} #displayArea{margin:0em 0 0 0 !important;}',"lewcidFullScreenStyle");
               }
            else
               {
                lewcidFullScreen = false;
                setStylesheet(' ',"lewcidFullScreenStyle");
               }
}

config.macros.fullscreen={};
config.macros.fullscreen.handler =  function(place,macroName,params,wikifier,paramString,tiddler)
{
        var label = params[0]||" ↕ ";
        var tooltip = params[1]||"Fullscreen mode";
        createTiddlyButton(place,label,tooltip,config.commands.fullscreen.handler);
}

var lewcid_fullscreen_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler =function(title,animate,slowly)
{
           lewcid_fullscreen_closeTiddler.apply(this,arguments);
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}


Slider.prototype.lewcidStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{
           this.lewcidStop();
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}
//}}}
Home stuff
[[ToDo]]
[[Calendar]]
[[Course Marks]]
<!--{{{-->
<!--[if IE]>
<html xmlns:m="http://www.w3.org/1998/Math/MathML">
<object id="mathplayer" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"></object>
<?import namespace="m" implementation="#mathplayer"?>
<![endif]-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
/***
|''Name:''|MathSVGPlugin|
|''Description:''|This plugin translates a subset of the LaTeX math notation to MathML with a customisable  image fallback when MathML is not supported. It also provides an easy way to produce mathematical SVG graphics with dynamical features and animation.|
|''Version:''|1.0|
|''Date:''|2009-03-20|
|''Source:''|http://www.math.ist.utl.pt/~psoares/mathsvg.html|
|''Author:''|Paulo Soares|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licences/lgpl.html]]|
|''~CoreVersion:''|2.5.0|
!Original copyright notice
{{{
ASCIIMathML.js
==============
Version 2.1 Oct 8, 2008, (c) Peter Jipsen http://www.chapman.edu/~jipsen
This version extends ASCIIMathML.js with LaTeXMathML.js and ASCIIsvg.js.
Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js
If you use it on a webpage, please send the URL to jipsen@chapman.edu

The LaTeXMathML modifications were made by Douglas Woodall, June 2006.
(for details see header on the LaTeXMathML part in middle of file)
Extensive clean-up and improvements by Paulo Soares, Oct 2007.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 
(at http://www.gnu.org/licences/lgpl.html) for more details.
}}}
!~MathSVG code (minified)
***/
//{{{
Math.sec=function(a){return 1/Math.cos(a)};Math.csc=function(a){return 1/Math.sin(a)};Math.cot=function(a){return 1/Math.tan(a)};Math.asec=function(a){return Math.acos(1/a)};Math.acsc=function(a){return Math.asin(1/a)};Math.acot=function(a){return Math.atan(1/a)};Math.sinh=function(a){return(Math.exp(a)-Math.exp(-a))/2};Math.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};Math.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};Math.sech=function(a){return 1/Math.cosh(a)};Math.csch=function(a){return 1/Math.sinh(a)};Math.coth=function(a){return 1/Math.tanh(a)};Math.asinh=function(a){return Math.log(a+Math.sqrt(a*a+1))};Math.acosh=function(a){return Math.log(a+Math.sqrt(a*a-1))};Math.atanh=function(a){return Math.log((1+a)/(1-a))/2};Math.sech=function(a){return 1/Math.cosh(a)};Math.csch=function(a){return 1/Math.sinh(a)};Math.coth=function(a){return 1/Math.tanh(a)};Math.asech=function(a){return Math.acosh(1/a)};Math.acsch=function(a){return Math.asinh(1/a)};Math.acoth=function(a){return Math.atanh(1/a)};Math.sign=function(a){return(a===0?0:(a<0?-1:1))};Math.step=function(a){return(a<0?0:1)};Math.root=function(a,b){return Math.pow(a,1/b)};Math.factorial=function(b){if(b===0){return 1}if(b<0){if((b%1)===0){return}if(b>-1){return Math.factorial(b+1)/(b+1)}return -Math.PI/(Math.factorial(-1-b)*Math.sin(Math.PI*b))}var a=b;if((b%1)===0){while(b>1){b=b-1;a=a*b}}else{a=Math.exp((b+0.5)*Math.log(b+1)-b-b*(0.1121105+b*0.08106103)/(1.452342+b*(2.410858+b)))}return a};Math.Gamma=function(a){return Math.factorial(a-1)};Math.Beta=function(a,b){return Math.Gamma(a)*Math.Gamma(b)/Math.Gamma(a+b)};Math.C=function(a,b){var c=1/((a+1)*Math.Beta(b+1,a-b+1));return c};Math.truncate=function(a,c){var b=c||0;return Math.floor(a*Math.pow(10,b))/Math.pow(10,b)};Math.randomString=function(b,d){var c,e="";var a=b.length-1;for(c=0;c<d;c++){e+=b.substr(Math.runif(0,a),1)}return e};Math.runif=function(d,c,f){var e=f||0;return Math.truncate((c+Math.pow(10,-e)-d)*Math.random()+d,e)};Math.rnormal=function(a,b){a=a||0;b=b||1;var d=0,c=0;while(d*c===0){d=Math.random();c=Math.random()}return b*(Math.sqrt(-2*Math.log(d))*Math.cos(2*Math.PI*c))+a};Math.range=function(e,a,d){if((a-e)*d<=0){return}var c,b=[];for(c=e;c<=a;c+=d){b[b.length]=c}return b};var MSVG=function(m){var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var t=["\uD835\uDC9C","\u212C","\uD835\uDC9E","\uD835\uDC9F","\u2130","\u2131","\uD835\uDCA2","\u210B","\u2110","\uD835\uDCA5","\uD835\uDCA6","\u2112","\u2133","\uD835\uDCA9","\uD835\uDCAA","\uD835\uDCAB","\uD835\uDCAC","\u211B","\uD835\uDCAE","\uD835\uDCAF","\uD835\uDCB0","\uD835\uDCB1","\uD835\uDCB2","\uD835\uDCB3","\uD835\uDCB4","\uD835\uDCB5","\uD835\uDCB6","\uD835\uDCB7","\uD835\uDCB8","\uD835\uDCB9","\u212F","\uD835\uDCBB","\u210A","\uD835\uDCBD","\uD835\uDCBE","\uD835\uDCBF","\uD835\uDCC0","\uD835\uDCC1","\uD835\uDCC2","\uD835\uDCC3","\u2134","\uD835\uDCC5","\uD835\uDCC6","\uD835\uDCC7","\uD835\uDCC8","\uD835\uDCC9","\uD835\uDCCA","\uD835\uDCCB","\uD835\uDCCC","\uD835\uDCCD","\uD835\uDCCE","\uD835\uDCCF"];var C=["\uD835\uDD04","\uD835\uDD05","\u212D","\uD835\uDD07","\uD835\uDD08","\uD835\uDD09","\uD835\uDD0A","\u210C","\u2111","\uD835\uDD0D","\uD835\uDD0E","\uD835\uDD0F","\uD835\uDD10","\uD835\uDD11","\uD835\uDD12","\uD835\uDD13","\uD835\uDD14","\u211C","\uD835\uDD16","\uD835\uDD17","\uD835\uDD18","\uD835\uDD19","\uD835\uDD1A","\uD835\uDD1B","\uD835\uDD1C","\u2128","\uD835\uDD1E","\uD835\uDD1F","\uD835\uDD20","\uD835\uDD21","\uD835\uDD22","\uD835\uDD23","\uD835\uDD24","\uD835\uDD25","\uD835\uDD26","\uD835\uDD27","\uD835\uDD28","\uD835\uDD29","\uD835\uDD2A","\uD835\uDD2B","\uD835\uDD2C","\uD835\uDD2D","\uD835\uDD2E","\uD835\uDD2F","\uD835\uDD30","\uD835\uDD31","\uD835\uDD32","\uD835\uDD33","\uD835\uDD34","\uD835\uDD35","\uD835\uDD36","\uD835\uDD37"];var s=["\uD835\uDD38","\uD835\uDD39","\u2102","\uD835\uDD3B","\uD835\uDD3C","\uD835\uDD3D","\uD835\uDD3E","\u210D","\uD835\uDD40","\uD835\uDD41","\uD835\uDD42","\uD835\uDD43","\uD835\uDD44","\u2115","\uD835\uDD46","\u2119","\u211A","\u211D","\uD835\uDD4A","\uD835\uDD4B","\uD835\uDD4C","\uD835\uDD4D","\uD835\uDD4E","\uD835\uDD4F","\uD835\uDD50","\u2124","\uD835\uDD52","\uD835\uDD53","\uD835\uDD54","\uD835\uDD55","\uD835\uDD56","\uD835\uDD57","\uD835\uDD58","\uD835\uDD59","\uD835\uDD5A","\uD835\uDD5B","\uD835\uDD5C","\uD835\uDD5D","\uD835\uDD5E","\uD835\uDD5F","\uD835\uDD60","\uD835\uDD61","\uD835\uDD62","\uD835\uDD63","\uD835\uDD64","\uD835\uDD65","\uD835\uDD66","\uD835\uDD67","\uD835\uDD68","\uD835\uDD69","\uD835\uDD6A","\uD835\uDD6B"];var z=0,b=1,d=2,p=3,x=4,e=5,q=6,r=7,o=8,f=9,B=10,A=11,c=12,j=13,l=14;var a=[{input:"\\varepsilon",tag:"mi",output:"\u025B",ttype:z},{input:"\\varsigma",tag:"mi",output:"\u03C2",ttype:z},{input:"\\vartheta",tag:"mi",output:"\u03D1",ttype:z},{input:"\\varphi",tag:"mi",output:"\u03D5",ttype:z},{input:"\\varpi",tag:"mi",output:"\u03D6",ttype:z},{input:"\\varrho",tag:"mi",output:"\u03F1",ttype:z},{input:"\\alpha",tag:"mi",output:"\u03B1",ttype:z},{input:"\\beta",tag:"mi",output:"\u03B2",ttype:z},{input:"\\gamma",tag:"mi",output:"\u03B3",ttype:z},{input:"\\delta",tag:"mi",output:"\u03B4",ttype:z},{input:"\\epsilon",tag:"mi",output:"\u03B5",ttype:z},{input:"\\zeta",tag:"mi",output:"\u03B6",ttype:z},{input:"\\eta",tag:"mi",output:"\u03B7",ttype:z},{input:"\\theta",tag:"mi",output:"\u03B8",ttype:z},{input:"\\iota",tag:"mi",output:"\u03B9",ttype:z},{input:"\\kappa",tag:"mi",output:"\u03BA",ttype:z},{input:"\\lambda",tag:"mi",output:"\u03BB",ttype:z},{input:"\\mu",tag:"mi",output:"\u03BC",ttype:z},{input:"\\nu",tag:"mi",output:"\u03BD",ttype:z},{input:"\\xi",tag:"mi",output:"\u03BE",ttype:z},{input:"\\omicron",tag:"mi",output:"\u03BF",ttype:z},{input:"\\pi",tag:"mi",output:"\u03C0",ttype:z},{input:"\\rho",tag:"mi",output:"\u03C1",ttype:z},{input:"\\sigma",tag:"mi",output:"\u03C3",ttype:z},{input:"\\tau",tag:"mi",output:"\u03C4",ttype:z},{input:"\\upsilon",tag:"mi",output:"\u03C5",ttype:z},{input:"\\phi",tag:"mi",output:"\u03C6",ttype:z},{input:"\\chi",tag:"mi",output:"\u03C7",ttype:z},{input:"\\psi",tag:"mi",output:"\u03C8",ttype:z},{input:"\\omega",tag:"mi",output:"\u03C9",ttype:z},{input:"\\Alpha",tag:"mo",output:"\u0391",ttype:z},{input:"\\Beta",tag:"mo",output:"\u0392",ttype:z},{input:"\\Gamma",tag:"mo",output:"\u0393",ttype:z},{input:"\\Delta",tag:"mo",output:"\u0394",ttype:z},{input:"\\Epsilon",tag:"mo",output:"\u0395",ttype:z},{input:"\\Zeta",tag:"mo",output:"\u0396",ttype:z},{input:"\\Eta",tag:"mo",output:"\u0397",ttype:z},{input:"\\Theta",tag:"mo",output:"\u0398",ttype:z},{input:"\\Iota",tag:"mo",output:"\u0399",ttype:z},{input:"\\Kappa",tag:"mo",output:"\u039A",ttype:z},{input:"\\Lambda",tag:"mo",output:"\u039B",ttype:z},{input:"\\Mu",tag:"mo",output:"\u039C",ttype:z},{input:"\\Nu",tag:"mo",output:"\u039D",ttype:z},{input:"\\Xi",tag:"mo",output:"\u039E",ttype:z},{input:"\\Omicron",tag:"mo",output:"\u039F",ttype:z},{input:"\\Pi",tag:"mo",output:"\u03A0",ttype:z},{input:"\\Rho",tag:"mo",output:"\u03A1",ttype:z},{input:"\\Sigma",tag:"mo",output:"\u03A3",ttype:z},{input:"\\Tau",tag:"mo",output:"\u03A4",ttype:z},{input:"\\Upsilon",tag:"mo",output:"\u03A5",ttype:z},{input:"\\Phi",tag:"mo",output:"\u03A6",ttype:z},{input:"\\Chi",tag:"mo",output:"\u03A7",ttype:z},{input:"\\Psi",tag:"mo",output:"\u03A8",ttype:z},{input:"\\Omega",tag:"mo",output:"\u03A9",ttype:z},{input:"\\frac12",tag:"mo",output:"\u00BD",ttype:z},{input:"\\frac14",tag:"mo",output:"\u00BC",ttype:z},{input:"\\frac34",tag:"mo",output:"\u00BE",ttype:z},{input:"\\frac13",tag:"mo",output:"\u2153",ttype:z},{input:"\\frac23",tag:"mo",output:"\u2154",ttype:z},{input:"\\frac15",tag:"mo",output:"\u2155",ttype:z},{input:"\\frac25",tag:"mo",output:"\u2156",ttype:z},{input:"\\frac35",tag:"mo",output:"\u2157",ttype:z},{input:"\\frac45",tag:"mo",output:"\u2158",ttype:z},{input:"\\frac16",tag:"mo",output:"\u2159",ttype:z},{input:"\\frac56",tag:"mo",output:"\u215A",ttype:z},{input:"\\frac18",tag:"mo",output:"\u215B",ttype:z},{input:"\\frac38",tag:"mo",output:"\u215C",ttype:z},{input:"\\frac58",tag:"mo",output:"\u215D",ttype:z},{input:"\\frac78",tag:"mo",output:"\u215E",ttype:z},{input:"\\pm",tag:"mo",output:"\u00B1",ttype:z},{input:"\\mp",tag:"mo",output:"\u2213",ttype:z},{input:"\\triangleleft",tag:"mo",output:"\u22B2",ttype:z},{input:"\\triangleright",tag:"mo",output:"\u22B3",ttype:z},{input:"\\cdot",tag:"mo",output:"\u22C5",ttype:z},{input:"\\star",tag:"mo",output:"\u22C6",ttype:z},{input:"\\ast",tag:"mo",output:"\u002A",ttype:z},{input:"\\times",tag:"mo",output:"\u00D7",ttype:z},{input:"\\div",tag:"mo",output:"\u00F7",ttype:z},{input:"\\circ",tag:"mo",output:"\u2218",ttype:z},{input:"\\bullet",tag:"mo",output:"\u2022",ttype:z},{input:"\\oplus",tag:"mo",output:"\u2295",ttype:z},{input:"\\ominus",tag:"mo",output:"\u2296",ttype:z},{input:"\\otimes",tag:"mo",output:"\u2297",ttype:z},{input:"\\bigcirc",tag:"mo",output:"\u25CB",ttype:z},{input:"\\oslash",tag:"mo",output:"\u2298",ttype:z},{input:"\\odot",tag:"mo",output:"\u2299",ttype:z},{input:"\\land",tag:"mo",output:"\u2227",ttype:z},{input:"\\wedge",tag:"mo",output:"\u2227",ttype:z},{input:"\\lor",tag:"mo",output:"\u2228",ttype:z},{input:"\\vee",tag:"mo",output:"\u2228",ttype:z},{input:"\\cap",tag:"mo",output:"\u2229",ttype:z},{input:"\\cup",tag:"mo",output:"\u222A",ttype:z},{input:"\\sqcap",tag:"mo",output:"\u2293",ttype:z},{input:"\\sqcup",tag:"mo",output:"\u2294",ttype:z},{input:"\\uplus",tag:"mo",output:"\u228E",ttype:z},{input:"\\amalg",tag:"mo",output:"\u2210",ttype:z},{input:"\\bigtriangleup",tag:"mo",output:"\u25B3",ttype:z},{input:"\\bigtriangledown",tag:"mo",output:"\u25BD",ttype:z},{input:"\\dag",tag:"mo",output:"\u2020",ttype:z},{input:"\\dagger",tag:"mo",output:"\u2020",ttype:z},{input:"\\ddag",tag:"mo",output:"\u2021",ttype:z},{input:"\\ddagger",tag:"mo",output:"\u2021",ttype:z},{input:"\\lhd",tag:"mo",output:"\u22B2",ttype:z},{input:"\\rhd",tag:"mo",output:"\u22B3",ttype:z},{input:"\\unlhd",tag:"mo",output:"\u22B4",ttype:z},{input:"\\unrhd",tag:"mo",output:"\u22B5",ttype:z},{input:"\\sum",tag:"mo",output:"\u2211",ttype:r},{input:"\\prod",tag:"mo",output:"\u220F",ttype:r},{input:"\\bigcap",tag:"mo",output:"\u22C2",ttype:r},{input:"\\bigcup",tag:"mo",output:"\u22C3",ttype:r},{input:"\\bigwedge",tag:"mo",output:"\u22C0",ttype:r},{input:"\\bigvee",tag:"mo",output:"\u22C1",ttype:r},{input:"\\bigsqcap",tag:"mo",output:"\u2A05",ttype:r},{input:"\\bigsqcup",tag:"mo",output:"\u2A06",ttype:r},{input:"\\coprod",tag:"mo",output:"\u2210",ttype:r},{input:"\\bigoplus",tag:"mo",output:"\u2A01",ttype:r},{input:"\\bigotimes",tag:"mo",output:"\u2A02",ttype:r},{input:"\\bigodot",tag:"mo",output:"\u2A00",ttype:r},{input:"\\biguplus",tag:"mo",output:"\u2A04",ttype:r},{input:"\\int",tag:"mo",output:"\u222B",ttype:z},{input:"\\oint",tag:"mo",output:"\u222E",ttype:z},{input:":=",tag:"mo",output:":=",ttype:z},{input:"\\lt",tag:"mo",output:"<",ttype:z},{input:"\\gt",tag:"mo",output:">",ttype:z},{input:"\\ne",tag:"mo",output:"\u2260",ttype:z},{input:"\\neq",tag:"mo",output:"\u2260",ttype:z},{input:"\\le",tag:"mo",output:"\u2264",ttype:z},{input:"\\leq",tag:"mo",output:"\u2264",ttype:z},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:z},{input:"\\ge",tag:"mo",output:"\u2265",ttype:z},{input:"\\geq",tag:"mo",output:"\u2265",ttype:z},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:z},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:z},{input:"\\ll",tag:"mo",output:"\u226A",ttype:z},{input:"\\gg",tag:"mo",output:"\u226B",ttype:z},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:z},{input:"\\prec",tag:"mo",output:"\u227A",ttype:z},{input:"\\succ",tag:"mo",output:"\u227B",ttype:z},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:z},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:z},{input:"\\subset",tag:"mo",output:"\u2282",ttype:z},{input:"\\supset",tag:"mo",output:"\u2283",ttype:z},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:z},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:z},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:z},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:z},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:z},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:z},{input:"\\sim",tag:"mo",output:"\u223C",ttype:z},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:z},{input:"\\approx",tag:"mo",output:"\u2248",ttype:z},{input:"\\cong",tag:"mo",output:"\u2245",ttype:z},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:z},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:z},{input:"\\in",tag:"mo",output:"\u2208",ttype:z},{input:"\\ni",tag:"mo",output:"\u220B",ttype:z},{input:"\\owns",tag:"mo",output:"\u220B",ttype:z},{input:"\\propto",tag:"mo",output:"\u221D",ttype:z},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:z},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:z},{input:"\\models",tag:"mo",output:"\u22A8",ttype:z},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:z},{input:"\\smile",tag:"mo",output:"\u2323",ttype:z},{input:"\\frown",tag:"mo",output:"\u2322",ttype:z},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:z},{input:"\\notin",tag:"mo",output:"\u2209",ttype:z},{input:"\\begin{eqnarray}",output:"X",ttype:l,invisible:true},{input:"\\begin{array}",output:"X",ttype:l,invisible:true},{input:"\\\\",output:"}&{",ttype:o},{input:"\\end{eqnarray}",output:"}}",ttype:o},{input:"\\end{array}",output:"}}",ttype:o},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ttype:A},{input:"\\Big",tag:"mo",output:"X",atval:"1.6",ttype:A},{input:"\\bigg",tag:"mo",output:"X",atval:"2.2",ttype:A},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ttype:A},{input:"\\left",tag:"mo",output:"X",ttype:x},{input:"\\right",tag:"mo",output:"X",ttype:e},{input:"{",output:"{",ttype:x,invisible:true},{input:"}",output:"}",ttype:e,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:j},{input:"[",tag:"mo",output:"[",atval:"1",ttype:j},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:j},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:j},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:j},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:j},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:j},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:j},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:j},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:j},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:j},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:j},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:j},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:j},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:j},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:j},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:j},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:j},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:j},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:j},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:j},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:j},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:j},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:j},{input:"\\setminus",tag:"mo",output:"\\",ttype:z},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:q},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:q},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:q},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:q},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:q},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:q},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:q},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:q},{input:"\\prime",tag:"mo",output:"\u2032",ttype:z},{input:"'",tag:"mo",output:"\u02B9",ttype:z},{input:"''",tag:"mo",output:"\u02BA",ttype:z},{input:"'''",tag:"mo",output:"\u2034",ttype:z},{input:"''''",tag:"mo",output:"\u2057",ttype:z},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:z},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:z},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:z},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:z},{input:"\\forall",tag:"mo",output:"\u2200",ttype:z},{input:"\\exists",tag:"mo",output:"\u2203",ttype:z},{input:"\\Re",tag:"mo",output:"\u211C",ttype:z},{input:"\\Im",tag:"mo",output:"\u2111",ttype:z},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:z},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:z},{input:"\\ell",tag:"mo",output:"\u2113",ttype:z},{input:"\\wp",tag:"mo",output:"\u2118",ttype:z},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:z},{input:"\\infty",tag:"mo",output:"\u221E",ttype:z},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:o},{input:"\\partial",tag:"mo",output:"\u2202",ttype:z},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:z},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:z},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:z},{input:"\\angle",tag:"mo",output:"\u2220",ttype:z},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:z},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:z},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:z},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:z},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:z},{input:"\\top",tag:"mo",output:"\u22A4",ttype:z},{input:"\\square",tag:"mo",output:"\u25AB",ttype:z},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:z},{input:"\\wr",tag:"mo",output:"\u2240",ttype:z},{input:"\\arccos",tag:"mi",output:"arccos",ttype:b,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:b,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:b,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:b,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:b,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:b,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:b,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:b,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:b,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:b,func:true},{input:"\\det",tag:"mi",output:"det",ttype:b,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:b,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:b,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:b,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:b,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:r},{input:"\\ker",tag:"mi",output:"ker",ttype:b,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:b,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:r},{input:"\\liminf",tag:"mo",output:"liminf",ttype:r},{input:"\\limsup",tag:"mo",output:"limsup",ttype:r},{input:"\\ln",tag:"mi",output:"ln",ttype:b,func:true},{input:"\\log",tag:"mi",output:"log",ttype:b,func:true},{input:"\\max",tag:"mo",output:"max",ttype:r},{input:"\\min",tag:"mo",output:"min",ttype:r},{input:"\\Pr",tag:"mi",output:"Pr",ttype:b,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:b,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:b,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:b,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:r},{input:"\\tan",tag:"mi",output:"tan",ttype:b,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:b,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:z},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:z},{input:"\\to",tag:"mo",output:"\u2192",ttype:z},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:z},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:z},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:z},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:z},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:z},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:z},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:z},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:z},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:o},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:z},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:z},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:z},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:z},{input:"\\longleftarrow",tag:"mo",output:"\u2190",ttype:c},{input:"\\longrightarrow",tag:"mo",output:"\u2192",ttype:c},{input:"\\longleftrightarrow",tag:"mo",output:"\u2194",ttype:c},{input:"\\Longleftarrow",tag:"mo",output:"\u21D0",ttype:c},{input:"\\Longrightarrow",tag:"mo",output:"\u21D2",ttype:c},{input:"\\implies",tag:"mo",output:"\u21D2",ttype:c},{input:"\\Longleftrightarrow",tag:"mo",output:"\u21D4",ttype:c},{input:"\\longmapsto",tag:"mo",output:"\u21A6",ttype:z},{input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:b},{input:"\\root",tag:"mroot",output:"root",ttype:d},{input:"\\frac",tag:"mfrac",output:"/",ttype:d},{input:"\\stackrel",tag:"mover",output:"stackrel",ttype:d},{input:"\\atop",tag:"mfrac",output:"",ttype:p},{input:"\\choose",tag:"mfrac",output:"",ttype:p},{input:"_",tag:"msub",output:"_",ttype:p},{input:"^",tag:"msup",output:"^",ttype:p},{input:"\\mbox",tag:"mtext",output:"mbox",ttype:B},{input:"\\acute",tag:"mover",output:"\u00B4",ttype:b,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:b,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:b,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:b,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:b,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:b,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:b,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:b,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:b,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:b,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:b,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:b,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:b,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:b,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:b,acc:true},{input:"\\overbrace",tag:"mover",output:"\u23B4",ttype:b,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:b,acc:true},{input:"\\underbrace",tag:"munder",output:"\u23B5",ttype:b,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:b,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:b},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:b},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:b},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:b},{input:"\\mathrm",tag:"mtext",output:"text",ttype:B},{input:"\\textrm",tag:"mtext",output:"text",ttype:B},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:b,codes:h},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:b,codes:h},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:b},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:b},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:b},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:b},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:b},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:b,codes:s},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:b,codes:t},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:b,codes:C}];var u=[];function n(){if(m.browser.mozilla||m.browser.opera){return true}else{if(m.browser.msie){try{var H=new ActiveXObject("MathPlayer.Factory.1");return true}catch(G){return false}}}return false}function F(G,H){if(G.input>H.input){return 1}else{return -1}}function w(){var G=a.length;a.sort(F);for(var H=0;H<G;H++){u[H]=a[H].input}}function y(G,H){return m.trim(G.slice(H))}function D(H,K,L){if(L===0){var J,G;L=-1;J=H.length;while(L+1<J){G=(L+J)>>1;if(H[G]<K){L=G}else{J=G}}return J}else{for(var I=L;I<H.length&&H[I]<K;I++){}}return I}function v(N){var G=0;var H=0;var J;var P;var O;var K="";var M=true;var L=N.length;for(var I=1;I<=L&&M;I++){P=N.slice(0,I);H=G;G=D(u,P,H);if(G<u.length&&N.slice(0,u[G].length)==u[G]){K=u[G];J=G;I=K.length}M=G<u.length&&N.slice(0,u[G].length)>=u[G]}if(K!==""){return a[J]}G=1;P=N.slice(0,1);if("0"<=P&&P<="9"){O="mn"}else{O=(("A">P||P>"Z")&&("a">P||P>"z")?"mo":"mi")}return{input:P,tag:O,output:P,ttype:z}}function g(O){var J,H,T,I,L,R,N=document.createDocumentFragment();O=m.trim(O);J=v(O);if(J===null||J.ttype==e){return[null,O,null]}if(J.ttype==o){O=J.output+y(O,J.input.length);J=v(O);if(J===null||J.ttype==e){return[null,O,null]}}O=y(O,J.input.length);switch(J.ttype){case q:H=createMmlNode(J.tag);H.setAttribute(J.atname,J.atval);return[H,O,J.tag];case r:return[createMmlNode(J.tag,document.createTextNode(J.output)),O,J.tag];case z:H=createMmlNode(J.tag,document.createTextNode(J.output));return[H,O,J.tag];case c:H=createMmlNode(J.tag,document.createTextNode(J.output));H.setAttribute("minsize","1.5");H.setAttribute("maxsize","1.5");H=createMmlNode("mover",H);H.appendChild(createMmlNode("mspace"));return[H,O,J.tag];case j:H=createMmlNode(J.tag,document.createTextNode(J.output));if(J.input=="|"||J.input=="\\vert"||J.input=="\\|"||J.input=="\\Vert"){H.setAttribute("lspace","0em");H.setAttribute("rspace","0em")}H.setAttribute("maxsize",J.atval);if(J.rtag!==null){return[H,O,J.rtag]}else{return[H,O,J.tag]}break;case A:var M=J.atval;J=v(O);if(J===null){return[null,O,null]}O=y(O,J.input.length);H=createMmlNode(J.tag,document.createTextNode(J.output));H.setAttribute("minsize",M);H.setAttribute("maxsize",M);return[H,O,J.tag];case x:if(J.input=="\\left"){J=v(O);if(J!==null){if(J.input=="."){J.invisible=true}O=y(O,J.input.length)}}T=k(O,true,false);if(J===null||(typeof J.invisible=="boolean"&&J.invisible)){H=createMmlNode("mrow",T[0])}else{H=createMmlNode("mo",document.createTextNode(J.output));H=createMmlNode("mrow",H);H.appendChild(T[0])}return[H,T[1],T[2]];case l:if(J.input=="\\begin{array}"){var S="";J=v(O);O=m.trim(O);if(J===null){S="l"}else{O=y(O,J.input.length);if(J.input!="{"){S="l"}else{do{J=v(O);if(J!==null){O=y(O,J.input.length);if(J.input!="}"){S=S+J.input}}}while(J!==null&&J.input!==""&&J.input!="}")}}T=k("{"+O,true,true);H=createMmlNode("mtable",T[0]);S=S.replace(/l/g,"left ");S=S.replace(/r/g,"right ");S=S.replace(/c/g,"center ");H.setAttribute("columnalign",S);H.setAttribute("displaystyle","false");return[H,T[1],null]}else{T=k("{"+O,true,true);H=createMmlNode("mtable",T[0]);H.setAttribute("columnspacing","0.167em");H.setAttribute("columnalign","right center left");H.setAttribute("displaystyle","true");H=createMmlNode("mrow",H);return[H,T[1],null]}break;case B:if(O.charAt(0)=="{"){L=O.indexOf("}")}else{L=0}if(L==-1){L=O.length}R=O.slice(1,L);N.appendChild(createMmlNode(J.tag,document.createTextNode(R)));O=y(O,L+1);return[createMmlNode("mrow",N),O,null];case b:T=g(O);if(T[0]===null){return[createMmlNode(J.tag,document.createTextNode(J.output)),O]}if(typeof J.func=="boolean"&&J.func){R=O.charAt(0);if(R=="^"||R=="_"||R==","){return[createMmlNode(J.tag,document.createTextNode(J.output)),O,J.tag]}else{H=createMmlNode("mrow",createMmlNode(J.tag,document.createTextNode(J.output)));H.appendChild(T[0]);return[H,T[1],J.tag]}}if(J.input=="\\sqrt"){return[createMmlNode(J.tag,T[0]),T[1],J.tag]}else{if(typeof J.acc=="boolean"&&J.acc){H=createMmlNode(J.tag,T[0]);var G=J.output;var Q=createMmlNode("mo",document.createTextNode(G));if(J.input=="\\vec"||J.input=="\\check"){Q.setAttribute("maxsize","1.2")}if(J.input=="\\underbrace"||J.input=="\\underline"){Q.setAttribute("accentunder","true")}else{Q.setAttribute("accent","true")}H.appendChild(Q);if(J.input=="\\overbrace"||J.input=="\\underbrace"){H.ttype=r}return[H,T[1],J.tag]}else{if(typeof J.codes!="undefined"){for(L=0;L<T[0].childNodes.length;L++){if(T[0].childNodes[L].nodeName=="mi"||T[0].nodeName=="mi"){R=(T[0].nodeName=="mi"?T[0].firstChild.nodeValue:T[0].childNodes[L].firstChild.nodeValue);var P=[];for(var K=0;K<R.length;K++){if(R.charCodeAt(K)>64&&R.charCodeAt(K)<91){P=P+J.codes[R.charCodeAt(K)-65]}else{if(R.charCodeAt(K)>96&&R.charCodeAt(K)<123){P=P+J.codes[R.charCodeAt(K)-71]}}}if(T[0].nodeName=="mi"){T[0]=createMmlNode("mo").appendChild(document.createTextNode(P))}else{T[0].replaceChild(createMmlNode("mo").appendChild(document.createTextNode(P)),T[0].childNodes[L])}}}}H=createMmlNode(J.tag,T[0]);H.setAttribute(J.atname,J.atval);if(J.input=="\\scriptstyle"||J.input=="\\scriptscriptstyle"){H.setAttribute("displaystyle","false")}return[H,T[1],J.tag]}}break;case d:T=g(O);if(T[0]===null){return[createMmlNode("mo",document.createTextNode(J.input)),O,null]}I=g(T[1]);if(I[0]===null){return[createMmlNode("mo",document.createTextNode(J.input)),O,null]}if(J.input=="\\root"||J.input=="\\stackrel"){N.appendChild(I[0])}N.appendChild(T[0]);if(J.input=="\\frac"){N.appendChild(I[0])}return[createMmlNode(J.tag,N),I[1],J.tag];case p:O=y(O,J.input.length);return[createMmlNode("mo",document.createTextNode(J.output)),O,J.tag];default:return[createMmlNode(J.tag,document.createTextNode(J.output)),O,J.tag]}}function E(L){var K,I,H,J,N,O,M;L=m.trim(L);I=v(L);N=g(L);J=N[0];L=N[1];O=N[2];K=v(L);if(K.ttype==p){L=y(L,K.input.length);N=g(L);if(N[0]===null){N[0]=createMmlNode("mo",document.createTextNode("\u25A1"))}L=N[1];O=N[2];if(K.input=="_"||K.input=="^"){H=v(L);O=null;M=((I.ttype==r)||(J.ttype==r));if(K.input=="_"&&H.input=="^"){L=y(L,H.input.length);var G=g(L);L=G[1];O=G[2];J=createMmlNode((M?"munderover":"msubsup"),J);J.appendChild(N[0]);J.appendChild(G[0])}else{if(K.input=="_"){J=createMmlNode((M?"munder":"msub"),J);J.appendChild(N[0])}else{J=createMmlNode((M?"mover":"msup"),J);J.appendChild(N[0])}}J=createMmlNode("mrow",J)}else{J=createMmlNode(K.tag,J);if(K.input=="\\atop"||K.input=="\\choose"){J.setAttribute("linethickness","0ex")}J.appendChild(N[0]);if(K.input=="\\choose"){J=createMmlNode("mfenced",J)}}}return[J,L,O]}function k(N,M,S){var R,O,J,U,Y,K=document.createDocumentFragment();do{N=m.trim(N);J=E(N);O=J[0];N=J[1];Y=J[2];R=v(N);if(O!=undefined){if((Y=="mn"||Y=="mi")&&R!==null&&typeof R.func=="boolean"&&R.func){var X=createMmlNode("mspace");X.setAttribute("width","0.167em");O=createMmlNode("mrow",O);O.appendChild(X)}K.appendChild(O)}}while((R.ttype!=e)&&R!==null&&R.output!="");Y=null;if(R.ttype==e){if(R.input=="\\right"){N=y(N,R.input.length);R=v(N);if(R!==null&&R.input=="."){R.invisible=true}if(R!==null){Y=R.rtag}}if(R!==null){N=y(N,R.input.length)}var V=K.childNodes.length;if(S&&V>0&&K.childNodes[V-1].nodeName=="mrow"&&V>1&&K.childNodes[V-2].nodeName=="mo"&&K.childNodes[V-2].firstChild.nodeValue=="&"){var H=[];var P=K.childNodes.length;for(U=0;S&&U<P;U=U+2){H[U]=[];O=K.childNodes[U];for(var T=0;T<O.childNodes.length;T++){if(O.childNodes[T].firstChild.nodeValue=="&"){H[U][H[U].length]=T}}}var I,G,L,Q,W=document.createDocumentFragment();for(U=0;U<P;U=U+2){I=document.createDocumentFragment();G=document.createDocumentFragment();O=K.firstChild;L=O.childNodes.length;Q=0;for(T=0;T<L;T++){if(typeof H[U][Q]!="undefined"&&T==H[U][Q]){O.removeChild(O.firstChild);I.appendChild(createMmlNode("mtd",G));Q++}else{G.appendChild(O.firstChild)}}I.appendChild(createMmlNode("mtd",G));if(K.childNodes.length>2){K.removeChild(K.firstChild);K.removeChild(K.firstChild)}W.appendChild(createMmlNode("mtr",I))}return[W,N]}if(typeof R.invisible!="boolean"||!R.invisible){O=createMmlNode("mo",document.createTextNode(R.output));K.appendChild(O)}}return[K,N,Y]}createMmlNode=(document.createElementNS)?function(G,I){var H=document.createElementNS("http://www.w3.org/1998/Math/MathML",G);if(I){H.appendChild(I)}return H}:function(G,I){var H=document.createElement("m:"+G);if(I){H.appendChild(I)}return H};if(!document.createElementNS){document.createElementNS=function(H,G){return this.createElement(G)}}return{showFormulaOnMouseOver:false,latexImages:false,latexConverter:"http://www.yourequations.com/eq.latex?",mathColor:"black",mathFontSize:"",createElementXHTML:function(G,H,J){var I=document.createElementNS("http://www.w3.org/1999/xhtml",G);if(H){I.id=H}if(J){I.className=J}return I},define:function(I,J){if(MSVG.latexImages){return}if((typeof I)=="string"){I=[I];J=[J]}var H,G=I.length;if(G!=J.length){return}for(H=0;H<G;H++){a=a.concat([{input:"\\"+I[H],tag:"mo",output:J[H],ttype:o}])}w()},parseMath:function(K,J,H,G){if(K===null){return null}var L=k(K.replace(/^\s+/g,""),false,false)[0];var I=(L.firstChild.nodeName=="mstyle")?L.firstChild:createMmlNode("mstyle",L);if(J){m(I).attr({displaystyle:"true"})}m(I).attr({mathcolor:G||MSVG.mathColor,fontsize:H||MSVG.mathFontSize,fontfamily:MSVG.mathFontFamily});I=createMmlNode("math",I);if(MSVG.showFormulaOnMouseOver){m(I).attr({title:K.replace(/\s+/g," ")})}return I},parseMathExternal:function(L,K,H,G){if(L===null){return null}var J=MSVG.createElementXHTML("img");var I=MSVG.latexConverter+((!K)?"\\inline ":"")+L;m(J).attr({src:I});if(MSVG.showFormulaOnMouseOver){m(J).attr({title:L.replace(/\s+/g," ")})}return J},generic:function(){if(MSVG.latexImages||!n()){MSVG.parseMath=MSVG.parseMathExternal}else{w()}if(!(window.SVGElement||m.browser.opera||m.browser.safari)){ASVG.drawPictures=ASVG.removePictures}}}}(jQuery);var ASVG=function($){var SVG;var collection=[];var startDrag={x:null,y:null};var chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var markerChars="o*sSx+<>|";function createSVGElement(elType,elId){var node=document.createElementNS("http://www.w3.org/2000/svg",elType);if(elId){node.id=elId}return node}function getSVGElement(id,el){var node;if(id){id=SVG.id+"_"+id;node=$("#"+id)[0]}if(!node){node=createSVGElement(el,id)}return node}function setButton(text,title,func){var node=MSVG.createElementXHTML("span",null,"svgButton");node.title=title;node.onclick=func;$(node).append(text);$(node).css({paddingRight:"0.5em",paddingLeft:"0.5em",fontSize:"1em",fontFamily:"monospace",background:"blue",color:"yellow",cursor:"pointer"});$(node).mouseover(function(){$(this).css({background:"yellow",color:"blue"})});$(node).mouseout(function(){$(this).css({background:"blue",color:"yellow"})});node.setAttribute("owner",SVG.id);return node}function pictureAttributes(){this.stroke="blue";this.strokewidth=1;this.strokeopacity=1;this.strokedasharray="none";this.fill="none";this.fillopacity=1;this.fontstyle="normal";this.fontfamily="serif";this.fontweight="normal";this.fontsize=12;this.fontstroke="none";this.fontfill="black";this.borderstroke="black";this.borderwidth=0;this.largearc=0;this.sweep=0;this.rx=0;this.ry=0;this.closed=false;this.curve="";this.marker="o";this.markerstrokewidth=1;this.markerstroke="blue";this.markerfill=null;this.markersize=8;this.markeropacity=1;this.direction=[1,0];this.ticklabels="";this.pos="";this.points=200;this.axesstroke="black";this.axesstrokewidth=0.5;this.gridstroke="grey";this.gridstrokewidth=0.25;this.backgroundcolor="white";this.backgroundopacity=1}function pictureObject(){this.id=null;this.src="";this.canvas=null;this.width=300;this.height=200;this.factor=1;this.xmin=-5;this.xmax=5;this.ymin=null;this.ymax=null;this.xunitlength=null;this.yunitlength=null;this.origin=[0,0];this.coords="cartesian";this.mouse=[null,null];this.attr=new pictureAttributes()}function refresh(){translateAndEval(SVG.id)}function translateAndEval(id){var errstr;var src=SVG.src;$("#"+SVG.id+"Canvas").empty();$("#"+SVG.id+"mml").empty();ASVG.dynamic[id]={};src=src.replace(/dynamic\./g,"ASVG.dynamic."+id+".");SVG.attr=new pictureAttributes();try{with(Math){eval(src)}}catch(err){if(typeof err=="object"){errstr=err.name+" "+err.message+" "+err.number+" "+err.description}else{errstr=err}alert(errstr+"\n"+src)}collection[SVG.id]=SVG}function setOptions(atr){for(i in atr){SVG.attr[i]=atr[i]}}function getOption(opt,options){return(opt in options)?options[opt]:SVG.attr[opt]}function setAction(evt,fn,id){if(!$.isFunction(fn)){return}var node=(id)?$("#"+SVG.id+"_"+id):$("#"+SVG.id);$(node).bind(evt,fn)}function getPosition(evt){var obj=evt.currentTarget;var posX=(evt.pageX-obj.parentNode.offsetLeft-SVG.origin[0])/SVG.xunitlength;var posY=(SVG.height-SVG.origin[1]-(evt.pageY-obj.parentNode.offsetTop))/SVG.yunitlength;return[posX,posY]}function getAngle(p){p=p||[0,0];var res=Math.atan2(SVG.mouse[1]-p[1],SVG.mouse[0]-p[0]);res=(res<0)?res+2*Math.PI:res;return res}function getDistance(p){p=p||[0,0];return Math.sqrt(Math.pow(SVG.mouse[0]-p[0],2)+Math.pow(SVG.mouse[1]-p[1],2))}function updateButton(obj){var id=$(obj).attr("owner");var node=$("#"+id+"src");if(obj.firstChild.nodeValue=="Edit"){obj.firstChild.nodeValue="Update";obj.title="Update picture";node.val(SVG.src).css("display","block");return}else{SVG.src=node.val();translateAndEval(id)}}function switchTo(evt){if(!evt){return}var name=evt.currentTarget.id;if(SVG.id==name){return}SVG=collection[name]}function onWheel(evt){evt=evt||window.event;var factor=1;if(evt.wheelDelta){factor=(evt.wheelDelta>0)?0.8:1.25}else{if(evt.detail){factor=(evt.detail<0)?0.8:1.25}}if(evt.shiftKey){changeSize(factor)}else{changeScales(factor)}if(evt.stopPropagation){evt.stopPropagation()}if(evt.preventDefault){evt.preventDefault()}evt.cancelBubble=true;evt.cancel=true;evt.returnValue=false;return false}function onClick(evt){if(evt.button===0){if(evt.shiftKey){$("#"+SVG.id+"toolbar").slideToggle();$("#"+SVG.id+"src").val(SVG.src)}startDrag.x=evt.clientX;startDrag.y=evt.clientY}return false}function onDrop(evt){if(startDrag.x==null){return false}var xlen=(startDrag.x-evt.clientX)/SVG.xunitlength;var ylen=(-startDrag.y+evt.clientY)/SVG.yunitlength;startDrag={x:null,y:null};if(xlen==0&&ylen==0){return false}changeScales(1,[SVG.xmin+xlen,SVG.xmax+xlen,SVG.ymin+ylen,SVG.ymax+ylen]);return false}function randomID(size){return Math.randomString(chars,size)}function setScales(){SVG.xunitlength=SVG.width/(SVG.xmax-SVG.xmin);SVG.yunitlength=SVG.height/(SVG.ymax-SVG.ymin);SVG.origin=[-SVG.xmin*SVG.xunitlength,-SVG.ymin*SVG.yunitlength]}function setSize(){var picture=$("#"+SVG.id)[0];picture.setAttribute("width",SVG.width);picture.setAttribute("height",SVG.height);picture.parentNode.style.width=SVG.width+"px";picture.parentNode.style.height=SVG.height+"px";var border=SVG.attr.borderwidth*0.5;var node=$("#"+SVG.id+"ClipPath")[0];node.firstChild.setAttribute("d","M"+border+","+border+" "+(SVG.width-border)+","+border+" "+(SVG.width-border)+","+(SVG.height-border)+" "+border+","+(SVG.height-border));node=$("#"+SVG.id+"Coords")[0];if(node){node.setAttribute("x",SVG.width-SVG.attr.borderwidth*0.5-2);node.setAttribute("y",SVG.height-SVG.attr.borderwidth*0.5-5)}}function changeSize(factor){SVG.factor*=factor;SVG.width/=factor;SVG.height/=factor;setSize();setScales();translateAndEval(SVG.id)}function changeScales(factor,trans){trans=trans||[SVG.xmin,SVG.xmax,SVG.ymin,SVG.ymax];SVG.factor*=factor;var dx=(SVG.xmax-SVG.xmin)*(1-factor)*0.5;var dy=(SVG.ymax-SVG.ymin)*(1-factor)*0.5;SVG.xmin=trans[0]+dx;SVG.xmax=trans[1]-dx;SVG.ymin=trans[2]+dy;SVG.ymax=trans[3]-dy;setScales();translateAndEval(SVG.id)}function updateCoord(evt){if($.browser.opera){switchTo(evt)}SVG.mouse=getPosition(evt)}function displayCoord(){var coords;if(SVG.coords=="cartesian"){coords="C: ("+SVG.mouse[0].toFixed(2)+", "+SVG.mouse[1].toFixed(2)+")"}else{coords="P: ("+getDistance().toFixed(2)+", "+getAngle().toFixed(2)+")"}$("#"+SVG.id+"Coords").text(coords);return false}function removeCoord(){$("#"+SVG.id+"Coords").text("")}function exportSVG(obj){var name=$(obj).attr("owner");var pic=$("#"+name)[0].parentNode.innerHTML;var pos=pic.indexOf("</svg")+6;pic=pic.substr(0,pos);var svg="<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";if(pic.indexOf("svgCoords")>-1){pos=pic.lastIndexOf("<text");svg+=pic.substr(0,pos);pos=pic.lastIndexOf("</text")+7;svg+=pic.substr(pos)}else{svg+=pic}svg=svg.replace(/&nbsp;/g,"");svg=svg.replace(/><(?!\/)/g,">\n<");obj.previousSibling.firstChild.nodeValue="Edit";$("#"+name+"src").val(svg).css("display","block")}function toSVG(p){var x=p[0]*SVG.xunitlength+SVG.origin[0];var y=SVG.height-p[1]*SVG.yunitlength-SVG.origin[1];return[x,y]}function toSVGPair(p){p=toSVG(p);return p[0]+","+p[1]}function setStrokeAndFill(node,options){node.setAttribute("stroke",getOption("stroke",options));node.setAttribute("stroke-width",getOption("strokewidth",options)/SVG.factor);node.setAttribute("stroke-dasharray",getOption("strokedasharray",options));node.setAttribute("stroke-opacity",getOption("strokeopacity",options));node.setAttribute("fill",getOption("fill",options));node.setAttribute("fill-opacity",getOption("fillopacity",options))}function setText(st,id){$("#"+id).text(st)}function setMarkers(obj,options){options=options||{};var markersize=getOption("markersize",options)/SVG.factor;var markerstroke=getOption("markerstroke",options);var markeropacity=getOption("markeropacity",options);var markerfill=getOption("markerfill",options);if(!markerfill){markerfill=SVG.attr.backgroundcolor}var markerstrokewidth=getOption("markerstrokewidth",options)/SVG.factor;var node,node2,i,id,pos=["marker-start","marker-mid","marker-end"];var lim=options.marker.length;for(i=0;i<lim;i++){var type=options.marker.charAt(i);if(type=="-"){continue}id=((options.id)?options.id+"_":"")+"Marker_"+markerChars.indexOf(type);node=$("#"+SVG.id+"_"+id)[0];if(!node){node=getSVGElement(id,"marker");node.setAttribute("viewBox","0 0 10 10");node.setAttribute("refX",5);node.setAttribute("refY",5);node.setAttribute("orient","auto");node.setAttribute("stroke",markerstroke);node.setAttribute("stroke-width",markerstrokewidth);node.setAttribute("fill",markerfill);node.setAttribute("stroke-opacity",markeropacity);node.setAttribute("fill-opacity",markeropacity);switch(type){case"*":node.setAttribute("fill",markerstroke);case"o":node2=createSVGElement("circle",null);node2.setAttribute("cx",5);node2.setAttribute("cy",5);node2.setAttribute("r",4);break;case">":node2=createSVGElement("path",null);node2.setAttribute("d","M 0 0 L 10 5 L 0 10 z");node.setAttribute("fill",markerstroke);node.setAttribute("refX",10);break;case"<":node2=createSVGElement("path",null);node2.setAttribute("d","M 10 0 L 10 10 L 0 5 z");node.setAttribute("fill",markerstroke);node.setAttribute("refX",0);break;case"x":node2=createSVGElement("path",null);node2.setAttribute("d","M 0 0 L 10 10 M 0 10 L 10 0");break;case"+":node2=createSVGElement("path",null);node2.setAttribute("d","M 5 0 L 5 10 M 0 5 L 10 5");break;case"|":node2=createSVGElement("path",null);node2.setAttribute("d","M 5 0 L 5 10");break;case"S":node.setAttribute("fill",markerstroke);case"s":node2=createSVGElement("rect",null);node2.setAttribute("x",0);node2.setAttribute("y",0);node2.setAttribute("width",10);node2.setAttribute("height",10)}node.appendChild(node2);$("#"+SVG.id+"Defs:first").append(node)}node.setAttribute("markerWidth",markersize);node.setAttribute("markerHeight",markersize);obj.setAttribute(pos[i],"url(#"+SVG.id+"_"+id+")")}}function setLabels(p,options){var i,point,pos;var label=(typeof options.label=="string")?[options.label]:options.label;var labelpos=getOption("pos",options);labelpos=(typeof labelpos=="string")?[labelpos]:labelpos;var poslen=labelpos.length;var markersize=getOption("markersize",options)/SVG.factor;var dx=(0.5*markersize/SVG.xunitlength)/SVG.factor;var dy=(0.5*markersize/SVG.yunitlength)/SVG.factor;for(i=0;i<label.length;i++){options.isLabel="_label"+i;point=p[i];pos=(poslen>i)?labelpos[i].toUpperCase():pos;if(/E/.test(pos)){point[0]+=dx}if(/W/.test(pos)){point[0]-=dx}if(/N/.test(pos)){point[1]+=dy}if(/S/.test(pos)){point[1]-=dy}options.pos=pos;text(point,label[i],options)}}function line(p,q,options){options=options||{};options.closed=false;options.curve="";path([p,q],options)}function dot(p,options){options=options||{};var direction=getOption("direction",options);var q=[p[0]+direction[0]/SVG.xunitlength,p[1]+direction[1]/SVG.yunitlength];options.marker=getOption("marker",options).charAt(0);var node=getSVGElement(options.id,"path");var st="M"+toSVGPair(p)+" "+toSVGPair(q);node.setAttribute("d",st);node.setAttribute("stroke","none");setMarkers(node,options);if(options.label){setLabels([p,q],options)}if(options.echo){return node}else{SVG.canvas.appendChild(node)}}function path(list,options){options=options||{};var st,i,node=getSVGElement(options.id,"path");var curve=getOption("curve",options);var closed=getOption("closed",options);if(typeof plist=="string"){st=list}else{var len=list.length;if(len===0){return}st="M"+toSVGPair(list[0])+" "+curve;for(i=1;i<len;i++){st+=toSVGPair(list[i])+" "}if(closed){st+="Z"}}node.setAttribute("d",st);setStrokeAndFill(node,options);if(options.marker){setMarkers(node,options)}SVG.canvas.appendChild(node);if(options.label){setLabels(list,options)}}function rotate(id,angle,options){if(!id||!angle){return}var node=$("#"+SVG.id+"_"+id)[0];if(node){options=options||{};var center=options.center?toSVG(options.center):SVG.origin;angle=-angle*180/Math.PI;var transform=node.getAttribute("transform")||"";transform="rotate("+angle+" "+center+") "+(options.replace?"":transform);node.setAttribute("transform",transform)}}function translate(id,delta,options){if(!id||!delta){return}var node=$("#"+SVG.id+"_"+id)[0];if(node){options=options||{};delta=toSVG(delta);var transform=node.getAttribute("transform")||"";transform="translate("+(delta[0]-SVG.origin[0])+"  "+(SVG.origin[1]+delta[1]-SVG.height)+") "+(options.replace?"":transform);node.setAttribute("transform",transform)}}function curve(list,options){options=options||{};options.curve=options.curve||"T";path(list,options)}function vector(p,q,options){options=options||{};options.closed=false;options.curve="";options.marker="-->";path([p,q],options)}function circle(center,radius,options){ellipse(center,radius,radius,options)}function loop(p,options){options=options||{};var d=options.direction||[1,0];options.curve="C";options.closed=false;path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],options)}function arc(options){options=options||{};var start=options.start;var end=options.end;var center=options.center;var startangle=options.startangle;var endangle=options.endangle;var st="M",node=getSVGElement(options.id,"path");var largearc=getOption("largearc",options);var sweep=getOption("sweep",options);var closed=getOption("closed",options);var radius=options.radius;if(center!=null&&startangle!=null&&endangle!=null&&radius!=null){end=[radius*Math.cos(startangle)+center[0],radius*Math.sin(startangle)+center[1]];start=[radius*Math.cos(endangle)+center[0],radius*Math.sin(endangle)+center[1]]}if(start==null||end==null){return}if(!radius){var v=[end[0]-start[0],end[1]-start[1]];radius=Math.sqrt(v[0]*v[0]+v[1]*v[1])}if(closed&&center!=null){st+=toSVGPair(center)+" "}st+=toSVGPair(start)+" A"+radius*SVG.xunitlength+","+radius*SVG.yunitlength+" 0 "+largearc+","+sweep+" "+toSVGPair(end);if(closed&&center!=null){st+=" z"}node.setAttribute("d",st);setStrokeAndFill(node,options);if(options.marker){setMarkers(node,options)}SVG.canvas.appendChild(node);if(options.label){setLabels([start,end],options)}}function ellipse(center,rx,ry,options){options=options||{};var node=getSVGElement(options.id,"ellipse");center=toSVG(center);node.setAttribute("cx",center[0]);node.setAttribute("cy",center[1]);node.setAttribute("rx",rx*SVG.xunitlength);node.setAttribute("ry",ry*SVG.yunitlength);setStrokeAndFill(node,options);SVG.canvas.appendChild(node)}function polygon(list,options){options=options||{};options.closed=true;path(list,options)}function rect(p,q,options){options=options||{};var node=getSVGElement(options.id,"rect");node.setAttribute("x",toSVG(p)[0]);node.setAttribute("y",toSVG(q)[1]);node.setAttribute("width",(q[0]-p[0])*SVG.xunitlength);node.setAttribute("height",(q[1]-p[1])*SVG.yunitlength);node.setAttribute("rx",getOption("rx",options)*SVG.xunitlength);node.setAttribute("ry",getOption("ry",options)*SVG.yunitlength);setStrokeAndFill(node,options);SVG.canvas.appendChild(node)}function text(p,st,options){options=options||{};options.fill=options.fill||SVG.attr.fontfill;var id=options.id;var factor=(options.fixed)?1:SVG.factor;if(id&&options.isLabel){id+=options.isLabel}var pos=getOption("pos",options).toUpperCase();var fontsize=getOption("fontsize",options)/factor;var node,dx=0,dy=0,str=st.toString();var q=toSVG(p);if(/\$/.test(str)){var dnode=$("#"+SVG.id+"mml:first");if(id){node=$("#"+id)[0]}if(node==null){node=MSVG.createElementXHTML("div",id);node.style.position="absolute";dnode.append(node)}else{$(node).empty()}str=$.trim(str);str=str.substr(1,str.length-2);node.appendChild(MSVG.parseMath(str,true,fontsize+"px",options.fill));dx=-node.offsetWidth/2;dy=-node.offsetHeight/2;if(/N/.test(pos)){dy=-node.offsetHeight}if(/S/.test(pos)){dy=0}if(/E/.test(pos)){dx=0}if(/W/.test(pos)){dx=-node.offsetWidth}node.style.left=(q[0]+dx)+"px";node.style.top=(q[1]+dy)+"px";return}var baseline="middle",textanchor="middle";if(/E/.test(pos)){textanchor="start"}if(/W/.test(pos)){textanchor="end"}if(/N/.test(pos)){baseline="text-after-edge"}if(/S/.test(pos)){baseline="text-before-edge"}node=getSVGElement(id,"text");$(node).empty().text(str);node.setAttribute("x",q[0]);node.setAttribute("y",q[1]);node.setAttribute("font-style",getOption("fontstyle",options));node.setAttribute("font-family",getOption("fontfamily",options));node.setAttribute("font-weight",getOption("fontweight",options));node.setAttribute("font-size",fontsize);node.setAttribute("text-anchor",textanchor);node.setAttribute("dominant-baseline",baseline);options.stroke=options.stroke||SVG.attr.fontstroke;setStrokeAndFill(node,options);if(options.echo){return node}else{SVG.canvas.appendChild(node)}}function image(url,options){options=options||{};var node=getSVGElement(options.id,"image");var height=options.height||SVG.height;var width=options.width||SVG.width;var point=toSVG(options.point||[SVG.xmin,SVG.ymin]);var pos=(options.pos||"").toUpperCase();var x=point[0]-width*0.5;var y=point[1]-height*0.5;if(/N/.test(pos)){y-=height*0.5}if(/S/.test(pos)){y+=height*0.5}if(/E/.test(pos)){x+=width*0.5}if(/W/.test(pos)){x-=width*0.5}node.setAttribute("x",x);node.setAttribute("y",y);node.setAttribute("width",width);node.setAttribute("height",height);node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",url);SVG.canvas.appendChild(node)}function grid(options){options=options||{};var dx,dy,x,y,k,st="",start,stop,limit;var stroke=options.stroke||SVG.attr.gridstroke;var strokewidth=(options.strokewidth||SVG.attr.gridstrokewidth)/SVG.factor;var strokedasharray=getOption("strokedasharray",options);var strokeopacity=getOption("strokeopacity",options);if(SVG.coords=="polar"){dx=options.dx||1;dy=options.dy||3;var lim=Math.max(Math.abs(SVG.xmax),Math.abs(SVG.xmin),Math.abs(SVG.ymax),Math.abs(SVG.ymin));for(x=dx;x<lim;x+=dx){circle([0,0],x,{stroke:stroke,strokewidth:strokewidth,strokedasharray:strokedasharray,strokeopacity:strokeopacity})}if(dy>1){for(y=1;y<dy;y++){k=Math.tan(y*Math.PI/(2*dy));line([SVG.xmin,SVG.xmin*k],[SVG.xmax,SVG.xmax*k],{stroke:stroke,strokewidth:strokewidth,strokedasharray:strokedasharray,strokeopacity:strokeopacity});line([SVG.xmin,-SVG.xmin*k],[SVG.xmax,-SVG.xmax*k],{stroke:stroke,strokewidth:strokewidth,strokedasharray:strokedasharray,strokeopacity:strokeopacity})}}}else{dx=options.dx||1;dy=options.dy||dx;var gdx=dx*SVG.xunitlength;var gdy=dy*SVG.yunitlength;var border=SVG.attr.borderwidth*0.5;var node=createSVGElement("path",null);node.setAttribute("class","svgGrid");start=SVG.origin[0];stop=SVG.width-border;limit=SVG.height-border;for(x=start;x<stop;x+=gdx){st+=" M"+x+","+border+" "+x+","+limit}start=SVG.origin[0]-gdx;for(x=start;x>border;x-=gdx){st+=" M"+x+","+border+" "+x+","+limit}start=SVG.height-SVG.origin[1];stop=SVG.height-border;limit=SVG.width-border;for(y=start;y<stop;y+=gdy){st+=" M"+border+","+y+" "+limit+","+y}start=SVG.height-SVG.origin[1]-gdy;for(y=start;y>border;y-=gdy){st+=" M"+border+","+y+" "+limit+","+y}node.setAttribute("d",st);node.setAttribute("stroke-width",strokewidth);node.setAttribute("stroke",stroke);node.setAttribute("stroke-dasharray",strokedasharray);node.setAttribute("stroke-opacity",strokeopacity);SVG.canvas.appendChild(node)}}function axes(options){options=options||{};var x,y,mdx,mdy,lx,ly,lxp,lyp,start,stop,tick,top,bottom;orig=options.origin||[0,0];var origin=toSVG(orig);var dx=options.dx||1;var dy=options.dy||dx;mdx=dx*SVG.xunitlength;mdy=dy*SVG.yunitlength;var fontsize=getOption("fontsize",options)/SVG.factor;var ticklength=(fontsize*0.25)/SVG.factor;var border=SVG.attr.borderwidth*0.5;var group=getSVGElement("Axes","g");$(group).empty();var node=getSVGElement(options.id,"path");node.setAttribute("class","svgAxes");var st="M"+border+","+origin[1]+" "+(SVG.width-border)+","+origin[1]+" M"+origin[0]+","+border+" "+origin[0]+","+(SVG.height-border);start=origin[0]+mdx;stop=SVG.width-border;top=origin[1]+ticklength;bottom=origin[1]-ticklength;for(x=start;x<stop;x+=mdx){st+=" M"+x+","+top+" "+x+","+bottom}start=origin[0]-mdx;stop=border;for(x=start;x>stop;x-=mdx){st+=" M"+x+","+top+" "+x+","+bottom}start=origin[1]+mdy;stop=SVG.height-border;top=origin[0]+ticklength;bottom=origin[0]-ticklength;for(y=start;y<stop;y+=mdy){st+=" M"+top+","+y+" "+bottom+","+y}start=origin[1]-mdy;stop=border;for(y=start;y>stop;y-=mdy){st+=" M"+top+","+y+" "+bottom+","+y}node.setAttribute("d",st);node.setAttribute("stroke-width",(options.strokewidth||SVG.attr.axesstrokewidth)/SVG.factor);node.setAttribute("stroke",options.stroke||SVG.attr.axesstroke);node.setAttribute("stroke-dasharray",getOption("strokedasharray",options));node.setAttribute("stroke-opacity",getOption("strokeopacity",options));group.appendChild(node);if(options.ticklabels!=false){lx=orig[0];ly=orig[1];var leftLabels=(origin[0]>1.5*fontsize);var belowLabels=(SVG.height-origin[1]>1.5*fontsize);var py=(fontsize/SVG.yunitlength*0.25)/SVG.factor;var px=(fontsize/SVG.xunitlength*0.5)/SVG.factor;lyp=leftLabels?"W":"E";lxp=belowLabels?"S":"N";var ddx=Math.max(0,Math.floor(-Math.log(dx+1e-9)/Math.log(10))+1);var ddy=Math.max(0,Math.floor(-Math.log(dy+1e-9)/Math.log(10))+1);var bdx=SVG.attr.borderwidth*0.5/SVG.xunitlength;var bdy=SVG.attr.borderwidth*0.5/SVG.yunitlength;start=dx+lx;stop=SVG.xmax-bdx;y=ly+(belowLabels?-1.5:2.5)*py;for(x=start;x<stop;x+=dx){tick=text([x,y],x.toFixed(ddx),{echo:true,pos:lxp});group.appendChild(tick)}start=-dx+lx;stop=SVG.xmin+bdx;for(x=start;stop<x;x-=dx){tick=text([x,y],x.toFixed(ddx),{echo:true,pos:lxp});group.appendChild(tick)}start=dy+ly;stop=SVG.ymax-bdy;x=lx+(leftLabels?-1:1)*px;for(y=start;y<stop;y+=dy){tick=text([x,y],y.toFixed(ddy),{echo:true,pos:lyp});group.appendChild(tick)}start=-dy+ly;stop=SVG.ymin+bdy;for(y=start;stop<y;y-=dy){tick=text([x,y],y.toFixed(ddy),{echo:true,pos:lyp});group.appendChild(tick)}}if(options.marker){options.echo=true;options.markerstroke=getOption("axesstroke",options);tick=dot([SVG.xmax-(border+1)/SVG.xunitlength,orig[1]],options);group.appendChild(tick);options.direction=[0,1];tick=dot([orig[0],SVG.ymax-(border+1)/SVG.yunitlength],options);group.appendChild(tick)}SVG.canvas.appendChild(group)}function plot(fun,options){options=options||{};var i,steps=options.steps||[];var leftMarkers=options.leftMarkers||"-";var rightMarkers=options.rightMarkers||"-";if(steps.length===0){plotter(fun,options)}else{var n_steps=steps.length-1;options.max=steps[0];options.marker="--"+leftMarkers.charAt(0);plotter(fun,options);for(i=0;i<n_steps;i++){options.max=steps[i+1];options.min=steps[i];options.marker=rightMarkers.charAt((rightMarkers.length>i)?i:0)+"-"+leftMarkers.charAt((leftMarkers.length>i+1)?i+1:0);plotter(fun,options)}options.max=null;options.min=steps[n_steps];options.marker=rightMarkers.charAt((rightMarkers.length==n_steps)?n_steps-1:0)+"--";plotter(fun,options)}}function plotter(fun,options){options=options||{};var min=(options.min==null)?SVG.xmin:options.min;var max=(options.max==null)?SVG.xmax:options.max;if(min>SVG.xmax||max<SVG.xmin){return}options.closed=false;options.curve="";min=Math.max(min,SVG.xmin);max=Math.min(max,SVG.xmax);var points=getOption("points",options);var inc=(max-min)/points;var t,gt,pth=[],g=fun;if(typeof fun!="object"){if(typeof fun=="string"){with(Math){eval("g = function(x){return "+fun+"}")}}for(t=min;t<=max;t+=inc){gt=g(t);if(isFinite(gt)){pth[pth.length]=[t,gt]}}}else{options.stroke="transparent";options.marker=options.marker||"***";pth=fun}path(pth,options)}function area(fun1,fun2,options){options=options||{};options.curve="";options.closed=true;var gt1,gt2,u,pth1=[],pth2=[];var t,g1=fun1,g2=fun2;var min=(options.min==null)?SVG.xmin:options.min;var max=(options.max==null)?SVG.xmax:options.max;if(min>SVG.xmax||max<SVG.xmin){return}min=Math.max(min,SVG.xmin);max=Math.min(max,SVG.xmax);var points=getOption("points",options);var inc=(max-min)/points;if(typeof fun1=="string"){with(Math){eval("g1 = function(x){return "+fun1+"}")}}if(typeof fun2=="string"){with(Math){eval("g2 = function(x){return "+fun2+"}")}}for(t=min;t<=max;t+=inc){gt1=g1(t);if(isFinite(gt1)){pth1[pth1.length]=[t,gt1]}u=min+max-t;gt2=g2(u);if(isFinite(gt2)){pth2[pth2.length]=[u,gt2]}}pth1=pth1.concat(pth2);path(pth1,options)}function polarPlot(fun,options){options=options||{};options.closed=false;options.curve="";var t,pth=[],g=fun;if(typeof fun=="string"){with(Math){eval("g = function(x){return "+fun+"}")}}var min=(options.min==null)?0:options.min;var max=(options.max==null)?2*Math.PI:options.max;var points=getOption("points",options);var inc=(max-min)/points;var gt,xt,yt;for(t=min;t<=max;t+=inc){gt=g(t);xt=gt*Math.cos(t);yt=gt*Math.sin(t);if(isFinite(xt)&&isFinite(yt)){pth[pth.length]=[xt,yt]}}path(pth,options)}function parametricPlot(fun1,fun2,options){options=options||{};options.closed=false;options.curve="";var t,pth=[],g1=fun1,g2=fun2;if(typeof fun1=="string"){with(Math){eval("g1 = function(x){return "+fun1+"}")}}if(typeof fun2=="string"){with(Math){eval("g2 = function(x){return "+fun2+"}")}}var min=(options.min==null)?0:options.min;var max=(options.max==null)?2*Math.PI:options.max;var points=getOption("points",options);var inc=(max-min)/points;var xt,yt;for(t=min;t<=max;t+=inc){xt=g1(t);yt=g2(t);if(isFinite(xt)&&isFinite(yt)){pth[pth.length]=[xt,yt]}}path(pth,options)}function slopeField(fun,options){options=options||{};var g=fun;if(typeof fun=="string"){with(Math){eval("g = function(x,y){return "+fun+"}")}}var gxy,x,y,u,v,dz;var dx=(options.dx==null)?1:options.dx;var dy=(options.dy==null)?1:options.dy;dz=Math.sqrt(dx*dx+dy*dy)/6;var x_min=Math.ceil(SVG.xmin/dx);var y_min=Math.ceil(SVG.ymin/dy);for(x=x_min;x<=SVG.xmax;x+=dx){for(y=y_min;y<=SVG.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],options)}}}}return{dynamic:{},removePictures:function(obj){var pictures=obj?[obj]:$(".svgGraph");$(pictures).each(function(){var target=this.parentNode;$(this).remove();$(target).css({color:"red",background:"yellow"});$(target).text("Missing picture: your  browser does not support inline SVG");window.setTimeout(function(){$(target).remove()},10000)})},drawPictures:function(obj){var options;var xmin,xmax,ymin,ymax;var pictures=obj?[obj]:$(".svgGraph");$(pictures).each(function(){SVG=new pictureObject();options=this.getAttribute("options");if(options!=""){eval("options="+options)}else{options={}}setOptions(options);SVG.width=options.width||SVG.width;SVG.height=options.height||SVG.height;SVG.coords=options.coords||"cartesian";SVG.src=this.getAttribute("script");var container=this.parentNode;container.removeChild(this);options.scales=options.scales||[];switch(options.scales.length){case 0:xmin=SVG.xmin;xmax=SVG.xmax;ymin=null;ymax=null;break;case 2:xmin=options.scales[0];xmax=options.scales[1];ymin=null;ymax=null;break;case 4:xmin=options.scales[0];xmax=options.scales[1];ymin=options.scales[2];ymax=options.scales[3];break;default:return}if(xmin>=xmax){throw"Incorrect values: xmax<=xmin."}var xunitlength=SVG.width/(xmax-xmin);if(typeof ymin!="number"){ymin=-SVG.height/(2*xunitlength);ymax=-ymin}if(ymin>=ymax){throw"Incorrect values: ymax<=ymin."}SVG.xmin=xmin;SVG.xmax=xmax;SVG.ymin=ymin;SVG.ymax=ymax;setScales();SVG.id=randomID(20);var qnode=createSVGElement("svg",SVG.id);qnode.setAttribute("xmlns","http://www.w3.org/2000/svg");var node=createSVGElement("clipPath",SVG.id+"ClipPath");var node2=createSVGElement("path");$(node).append(node2);node2=createSVGElement("defs",SVG.id+"Defs");$(node2).append(node);$(qnode).append(node2);node=createSVGElement("rect",null);node.setAttribute("class","svgBackground");node.setAttribute("x","0");node.setAttribute("y","0");node.setAttribute("width","100%");node.setAttribute("height","100%");node.setAttribute("stroke",SVG.attr.borderstroke);node.setAttribute("stroke-width",SVG.attr.borderwidth);node.setAttribute("fill",SVG.attr.backgroundcolor);node.setAttribute("fill-opacity",SVG.attr.backgroundopacity);$(qnode).append(node);node=createSVGElement("g",SVG.id+"Canvas");node.setAttribute("clip-path","url(#"+SVG.id+"ClipPath)");SVG.canvas=node;$(qnode).append(node);if(SVG.coords!="none"){node=createSVGElement("text",SVG.id+"Coords");node.setAttribute("class","svgCoords");node.setAttribute("text-anchor","end");node.setAttribute("font-size",(SVG.attr.fontsize*0.8));$(qnode).append(node)}$(container).append(qnode);container.style.position="relative";node=MSVG.createElementXHTML("span",SVG.id+"mml");$(container).append(node);node=MSVG.createElementXHTML("span",SVG.id+"toolbar");node.style.position="absolute";node.style.textAlign="left";node.style.zIndex=10;node2=setButton("Update","Edit script",function(){updateButton(this)});$(node).append(node2);node2=setButton("SVG","View SVG code",function(){exportSVG(this)});$(node).append(node2);node2=setButton("-","Zoom out",function(){changeScales(1.25)});$(node).append(node2);node2=setButton("+","Zoom in",function(){changeScales(0.8)});$(node).append(node2);node2=setButton("\u2191","Enlarge picture",function(){changeSize(0.8)});$(node).append(node2);node2=setButton("\u2193","Reduce picture",function(){changeSize(1.25)});$(node).append(node2);$(node).append("<br />");node2=MSVG.createElementXHTML("textarea",SVG.id+"src");node2.setAttribute("rows",8);node2.setAttribute("cols",60);node.appendChild(node2);node.style.display="none";$(container).append(node);setAction("mousemove",updateCoord);if(SVG.coords!="none"){setAction("mousemove",displayCoord);setAction("mouseout",removeCoord)}setAction("mouseover",switchTo);setAction("mousedown",onClick);setAction("mouseup",onDrop);if(window.addEventListener){var evt=$.browser.mozilla?"DOMMouseScroll":"mousewheel";qnode.addEventListener(evt,onWheel,false)}setSize();translateAndEval(SVG.id)})}}}(jQuery);
//}}}
/***
!~TiddlyWiki formatters
***/
//{{{
if(!version.extensions.MathSVGPlugin) { //# ensure that the plugin is only installed once
version.extensions.MathSVGPlugin = {installed: true};
MSVG.generic();

config.formatterHelpers.MathSVGHelper = function(w) {
  this.lookaheadRegExp.lastIndex = w.matchStart;
  var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
  if(lookaheadMatch){
    var eq = MSVG.parseMath(lookaheadMatch[1],this.displaystyle);
    if(this.displaystyle){
      var node = createTiddlyElement(w.output,"div");
      node.style.textAlign='center';
      node.appendChild(eq);
      w.output.appendChild(node);
    } else {w.output.appendChild(eq);}
    w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
  }
}

config.formatters.push( {
  name: "clatex",
  match: "\\$\\$",
  lookaheadRegExp: /\$\$((?:.|\n)*?)\$\$/mg,
  displaystyle: true,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "clatex2",
  match: "\\\\\\\[",
  lookaheadRegExp: /\\\[\s*(.*?)\s*\\\]/mg,
  displaystyle: true,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "latex",
  match: "\\$",
  lookaheadRegExp: /\$((?:.|\n)*?)\$/mg,
  displaystyle: false,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "graph",
  match: "\\(:graph",
  lookaheadRegExp: /\(:graph(\((.*?),?\s?(\{.+\})?\))?[\s]+((?:.|\n)*?)[\s]+:\)/mg,
  handler: function(w){
  this.lookaheadRegExp.lastIndex = w.matchStart;
  var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
  if(lookaheadMatch){
    var element = (lookaheadMatch[2] == "inline") ? "span" : "div";
    var eq = createTiddlyElement(w.output,element);
    switch(lookaheadMatch[2]){
    case "center":
      eq.style.marginLeft = "auto";
      eq.style.marginRight = "auto";
      break;
    case "left":
      eq.style.cssFloat = "left";
      break;
    case "right":
      eq.style.cssFloat = "right";
    }
    var svg = createTiddlyElement(eq,"embed");
    svg.className="svgGraph";
    svg.setAttribute('options',lookaheadMatch[3]||"");
    svg.setAttribute('script',lookaheadMatch[4]);
    ASVG.drawPictures(svg);
    w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
  }
  }
})
}
//}}}
MATHS $$\sum_{n=1}^{+\infty} \frac{1}{n^2}=\frac{\pi^2}{6}.$$

Click the picture to start animation
(:graph({height:300,scales:[-4.5,4.5,-4.5,4.5],coords:"polar"})

dynamic.goforit = function(){
if(animate==1) timer = setInterval("dynamic.roll()",50);
else clearInterval(timer);
animate++;
animate %= 2;
}

dynamic.roll=function(){
time+=0.05;
p.push([3*cos(time)-cos(3*time), 3*sin(time)-sin(3*time)]);
path(p,{stroke:"red",strokewidth:2,id:"neph"});
var cs= [3*cos(time),3*sin(time)];
line(p[p.length-1],cs,{stroke:"green",id:"axe",marker:"*-*",markerstroke:"green"});
circle(cs,1,{stroke:"black",id:"rev"});
if(time>2*PI) {p=[[2,0]]; time=0; animate=1; clearInterval(timer);}
}

time=0;
animate=1;
setAction("click",dynamic.goforit);
grid();
axes();
circle([0,0],2);
circle([0,0],3,{stroke:"grey"});
circle([3,0],1,{stroke:"black",id:"rev"});
line([2,0],[3,0],{stroke:"green",id:"axe",marker:"*-*",markerstroke:"green"});
p=[[2,0]];
:)

<<timeline better:true onlyTag:Tag1 excludeTag:Tag2 sortBy:modified/created firstDay:YYYYMMDD maxDays:7 maxEntries:30>>

<<bibliography Bibliography showAll>>
personal web notebook
Matt Oates
* Start adding stuff to this wiki. maybe some plugins?
<!--{{{-->
<div class='toolbar' macro='toolbar fullscreen [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->