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
<!--{{{-->
<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>>
<<importTiddlers>>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
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]]
<!--{{{-->
<div class='header' role='banner' 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' role='navigation' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' role='navigation' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' role='complementary' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea' role='main'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/*{{{*/
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]];}

.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]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#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:0; top:0;}

.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:0 3px 0 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:0; padding-bottom:0;}

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

.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='toolbar' role='navigation' 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>
<!--}}}-->
General category for all FEI used CCD camera's
[[StyleSheetTiddlySpace]]
[[StyleSheetTiddler]]
!Introduction.
The key to producing the best SEM image of a specimen is a full understanding of the effects of the machine variables. Some important variables are; condenser lens current, stigmatism, working distance and accelerating voltage. You can make adjustments by changing these variables and as you will see it often will be a trade-off between multiple variables.

!Image Formation using the SEM.
When the electron beam strikes a sample, these electrons will scatter through the sample within a defined area called the interaction volume. During the electron beam-specimen interactions, secondary products like secondary electrons, backscattered electrons, X-rays, heat and light will be formed. Image formation of surface structures using the SEM mainly depends on the production of secondary electrons.
Secondary electrons are low energy electrons and when produced deeper within the interaction volume, will be absorbed by the sample. Only secondary electrons close to the surface will be able to escape the specimen (figure 1). The weakly negative secondary electrons will be deflected by a positive pull exerted by the Faraday cage surrounding the secondary electron detector and therefore will contribute to the image formation.
Backscattered electrons are also produced deep within the sample but have a much higher energy and because of this, are able to escape from deeper within the interaction volume. Because of their high energy, backscattered electrons will not be deflected by the Faraday Cage and therefore not contribute to the image formation. Only a few backscattered electrons will interfere with the signal for secondary electrons (figure 1).

<html>
<img src="/static/files/Microscopy/SEM/var1.jpg" width=500>
</html>

Figure 1. Interaction volume between the electron beam and the specimen. Notice that the backscattered electrons are able to escape from far deeper in the sample.

Different numbers of secondary electrons produced at different areas of the sample will provide image contrast. If at a certain spot on the sample more secondary electrons are produced, a bright spot will appear on the image. Often many secondary electrons are produced along raised areas of the sample, therefore many electrons will be detected, producing a bright spot on the image. This effect is called the edge effect (figure 2). Some secondary electrons are produced in a valley of the sample and are difficult to deflect by the Faraday Cage. In this case only few electrons will be detected producing a dark spot on the image.

<html>
<img src="/static/files/Microscopy/SEM/var2.jpg" width=500>
</html>

Figure 2. Secondary electrons escape from sample areas close to the surface. The edge effect takes place when many electrons escape from areas with sharp edges or peaks to be deflected by the Faraday Cage (B). Some electrons escape from areas without sharp edges (A and C). Few secondary electrons are detected when generated secondary electrons are only deflected partially by the Faraday Cage due to the location on the sample they are generated (A).

!Condenser Lens Current and Resolution.
The current in the condenser lens changes the spot size or diameter of the beam of electrons that scans the sample. More detailed information will be collected when the electron beam scans the same area with a smaller spot size (figure 3). An increased current or a higher number for the condenser lens (CL) setting, will produce a smaller spot size and in general will result in a better resolution (figure 4).

<html>
<img src="/static/files/Microscopy/SEM/var3.jpg" width=400>
</html>

Figure 3. A smaller spot size or smaller diameter of the beam of electrons will resolve more detailed structures of your sample as compared to a beam with a big spot size.

<html>
<img src="/static/files/Microscopy/SEM/var4.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var5.jpg" width=300>
</html>

Figure 4. Diatom sample imaged using different CL settings. A small spot size or a higher condenser lens setting (CL = 14) will result in an image with more detail or better resolution (A). A bigger spot size or lower CL setting will resolve less detail (B). Bar is 1µm, Magnification = x 4500, Acceleration Voltage = 5kV, Working Distance = 15mm (A, B).

!Condenser Lens Current and Beam Current.
The disadvantage of obtaining a better resolution using a higher condenser lens current is the effect on the beam current or number of electrons available to interact with the specimen. An increase in condenser lens current results in a lower beam current (figure 5). The effect of a lower beam current is that fewer electrons interact with the sample and therefore fewer secondary and back scattered electrons become available to form an image. Electronically this signal can be increased to compensate for the low beam current but this will also result in an increase in electronic noise. Because of the increased noise ('snowy' image on the viewing screen) it will be more difficult to focus the specimen and the final image will start to look grainy as well.
Recall that the condenser lens current also effects the spot size (see 'Condenser Lens Current and Resolution'). A correct balance between spot size and beam current needs to be found.
<html>
<img src="/static/files/Microscopy/SEM/var6.jpg" width=400>
</html>

Figure 5. If the current of the condenser lens increases, the focal length of the crossover produced will become shorter resulting in a smaller spot size, increasing the resolution of the final image. A shorter focal length will cause the beam to diverge so that many electrons are not able to enter the final lens resulting in a decreasing beam current as well.


!Stigmatism and Resolution.
The stigmator knobs control distortions in the roundness of the spot that is scanned over the sample (stigme means 'mark' or 'spot' in Latin). If the electron beam is not round but elliptical, extraneous information obtained by using this elliptical spot will be collected by the detector and rendered in a round spot on the viewing screen and/or your final image. This phenomenon, called astigmatism, causes a reduction in resolution (figure 6, A-C). When alternating between over and under focus, astigmatism can be recognized by a smeared look in two different directions (figure 6, D and E).
<html>
<img src="/static/files/Microscopy/SEM/var7.jpg" width=400>
</html>
<html>
<img src="/static/files/Microscopy/SEM/var8.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var9.jpg" width=300>
</html>
<html>
<img src="/static/files/Microscopy/SEM/var10.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var11.jpg" width=300>
</html>

Figure 6. Copy paper imaged to show the effect of stigmatism on resolution. A good image of the copy paper can be obtained when the specimen is in focus with no stigmatism present (A). When stigmatism increases, the resolution will become worse. Little stigmatism present (B). More stigmatism present (C). When stigmatism is present and when the sample is scanned in over or under focus, a smeared image in one or the other direction will show (D and E). Bar is 1µm, Magnification = x 20,000, Acceleration Voltage = 5kV, Working Distance = 8mm, Condenser Lens setting = 15 (A - E).


!Working Distance and Resolution.
The working distance is the distance between the final condenser lens and the specimen. Changing the working distance will have an effect on the spherical aberration of the imaging system and therefore will effect the resolution of the final image. Recall that spherical aberration is due to the geometry of electromagnetic lenses. Electrons passing along the axis of the electron beam refract less than electrons passing through the periphery of the electron beam creating more than one focal point and therefore resulting in an enlarged, unsharp spot (figure 7). When the working distance decreases, this effect of spherical aberration will become less, the spot striking the specimen will become smaller and therefore will improve resolution (figure 8).

<html>
<img src="/static/files/Microscopy/SEM/var12.jpg" width=400>
</html>

Figure 7. Spherical aberration is the failure of the lens system to image central and peripheral electrons at the same focal point. If spherical aberration is present the beam will scan with an enlarged, unsharp spot (A). If spherical aberration is absent, the beam will scan with the sharpest spot possible (B).

<html>
<img src="/static/files/Microscopy/SEM/var13.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var14.jpg" width=300>
</html>

Figure 8. A diatom imaged using different working distances. At a longer working distance (WD = 48mm) spherical aberration is present decreasing resolution (A). At a shorter working distance (WD = 8) the effect of spherical aberration is less resulting in an image with improved resolution (B). Bar is 5µm, Magnification = x 3300, Acceleration Voltage = 5kV, Condenser Lens setting = 14 (A and B).

!Working Distance and Depth of Field.
The working distance has an effect on the depth in the sample that appears to be in focus or in other words, has an effect on the depth of field. At a short working distance the sample will be scanned with a wide cone of electrons resulting in an image with little depth of field. At a longer working distance the sample will be scanned with a narrow cone of electrons resulting in an image with an increased depth of field (figure 9). Recall that a longer working distance does not give you the optimal resolution (see 'Working Distance and Resolution'). If a sample with large topographical variation needs to be scanned it may be important to use a longer working distance to bring as much of the image into focus as possible; however, some of the resolution will be lost (figure 10). If a relative flat sample is scanned it is possible to benefit from a better resolution using a shorter working distance since depth of field becomes less important (figure 8). Depending on the sample and the contained features, a correct balance between working distance and depth of field needs to be found.

<html>
<img src="/static/files/Microscopy/SEM/var15.jpg" width=400>
</html>

Figure 9. The shape of the cone of electrons (wide versus narrow) depends partly on the working distance and is important in determining the depth of field of a sample. At a short working distance little of your sample appears to be in focus (A). At a long working distance, more of your sample appears to be in focus because of a greater depth of field (B).

<html>
<img src="/static/files/Microscopy/SEM/var16.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var17.jpg" width=300>
</html>

Figure 10. A head of a fruit fly imaged using different working distances. At a short working distance (WD = 8) only part of the head is in focus because of a limited depth of field (A). At a longer working distance (WD = 48) more is in focus due to an increase in depth of field (B). Bar is 100µm, Magnification = x 130, Acceleration Voltage = 5kV, Condenser Lens setting = 12 (A and B).

!Accelerating Voltage and Resolution.
The acceleration voltage is the high voltage applied to the filament. Together with the application of a small current, it will cause the electrons to leave the filament. The size of accelerating voltages often used in SEM imaging vary between 5kV and 20kV. In general, increasing the accelerating voltage will decrease the spherical aberration of the system and therefore increase the resolution. But, varying the acceleration voltage will also have an effect on the beam-specimen interaction. If a higher accelerating voltage is used, the interaction volume between the beam and the specimen will become bigger because of the greater energy of the beam of electrons (figure 11). This effect is more significant in specimens with low atomic number, such as most biological samples (figure 12).

<html>
<img src="/static/files/Microscopy/SEM/var18.jpg" width=400>
</html>

Figure 11. Effect of the acceleration voltage on the interaction volume. Notice that with an increase in acceleration voltage the interaction volume becomes bigger.

<html>
<img src="/static/files/Microscopy/SEM/var19.jpg" width=400>
</html>

Figure 12. Effect of the acceleration voltage on samples with different atomic number. Notice that the interaction volume of samples with a high atomic number is much smaller as compared to samples with a low atomic number.

Resolution is dependent on the area from which secondary electrons are produced. Normally this area would be defined by the spot size. By increasing the accelerating voltage, backscattered electrons, emitted from a larger area of the sample, interact with the sample on their way out, producing secondary electrons further away from the original spot size (figure 13), thereby reducing the resolution of the image (figure 14). This effect will be much less in a sample with high atomic numbers. In this case, you can benefit from the reduction in spherical aberration when increasing the acceleration voltage because it does not create a large interaction volume and therefore increases the resolution of the final image.
In addition, a higher accelerating voltage will increase secondary yield from all parts of the specimen due to a greater beam penetration. This will reduce the edge effect and therefore has a diminishing effect on the contrast (figure 14).
<html>
<img src="/static/files/Microscopy/SEM/var13.jpg" width=300>
</html>

Figure 13. When the interaction volume increases, more backscattered electrons will be able to escape from a bigger volume. These backscattered electrons may generate secondary electrons near the sample surface on their way out, increasing the area from which secondary electrons are produced and therefore reducing the resolution of the final image.
<html>
<img src="/static/files/Microscopy/SEM/var20.jpg" width=500>
</html>
<html>
<img src="/static/files/Microscopy/SEM/var21.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var22.jpg" width=300>
</html>
	
Figure 14. A diatom imaged using different accelerating voltages. Fine detail of a diatom imaged at a low accelerating voltage of 5kV is visible (A). A decrease in resolution and contrast can be observed when a diatom is imaged using a much higher accelerating voltage (20kV) (B). Bar is 1µm, Magnification = x 4000, Working Distance = 8mm, Condenser Lens setting = 15 (A and B).


!Charge accumulation.
Specimens need to be conductive when examined using a SEM. When a specimen is nonconductive a negative charge from the electron beam tends to accumulate, thus effecting the final image. Some of the effects are abnormal contrast, appearing of abnormal lines (figure 15B) or shifts/breaks within the image. Biological samples are mainly nonconductive and need to be coated with a thin layer of metal making the surface conductive (figure 15A). Specimens like metals and most semiconductors are conductive and can be examined without coating.

<html>
<img src="/static/files/Microscopy/SEM/var23.jpg" width=300>
<img src="/static/files/Microscopy/SEM/var24.jpg" width=300>
</html>
	
Figure 15. Pollen samples showing the effect of charge accumulation. No effect of charge accumulation is visible (A). Pollen showing the type of charging that produces abnormal lines within the image (B). Bar is 5µm, Magnification = x 2300, Acceleration Voltage = 10kV, Working Distance = 39mm, Condenser Lens setting = 15 (A and B).
In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) whose length is 1 (the unit length). A unit vector is often denoted by a lowercase letter with a "hat", like this: i-hat (pronounced "i-hat").

In Euclidean space, the dot product of two unit vectors is simply the cosine of the angle between them. This follows from the formula for the dot product, since the lengths are both 1.

The normalized vector or versor $\Large \hat{u}$ of a non-zero vector u is the unit vector codirectional with u, i.e.,

$\Large \hat{u}$ = $\LARGE \frac{u}{\|u\|}$

where vector u between two pairs of vertical lines is the norm (or length) of vector u. The term normalized vector is sometimes used as a synonym for unit vector.

The elements of a basis are usually chosen to be unit vectors. Every vector in the space may be written as a linear combination of unit vectors. The most commonly encountered bases are Cartesian, polar, and spherical coordinates. Each uses different unit vectors according to the symmetry of the coordinate system. Since these systems are encountered in so many different contexts, it is not uncommon to encounter different naming conventions than those used here.
!URL
http://www.imaging-git.com/news/detecting-cellular-processes

!Description
<html>
<!-- begin embedded QuickTime file... -->
      <!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="left">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320"
        height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="/static/files/Microscopy/2008.04.02-mse640-l12-part2.mp4">
        <param name='autoplay' value="false">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src="/static/files/Microscopy/2008.04.02-mse640-l12-part2.mp4" width="320" height="255" autoplay="false" 
        controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table>
</html>

Find the slides at: http://nanohub.org/resources/4682/download/2008.04.02-mse640-l12-part2.pdf
!URL
http://www.microscopy-news.com/news/fei-and-nanonics-enter-into-collaborative-agreement.html

!Description
About Nanonics

Nanonics Imaging Ltd. is the market leader of combined near-field opitcal microscopes (commonly referred to as either NSOM or SNOM systems) and atomic force microscopes (AFM). Incorporated in 1997, Nanonics is the longest established and most experienced supplier of such systems in the market, whose products have won several awards. These awards have recognized innovations and pioneering developments in multiprobe atomic force microscopy and transparently integrated AFM Raman microspectroscopy. Nanonics platforms with their associated probe technologies have circumvented barriers that have prevented AFM from effective integration into electron optical and similar upright microscope geometries. More information can be found at: www.nanonics.co.il
!URL
http://www.azcentral.com/news/articles/2011/10/21/20111021asu-electron-microscopes-sought-by-scientists.html

!Description
Grace Shih, a doctoral student in materials science and engineering at the University of Arizona, drives from Tucson to Tempe several times a month to work on a key part of her research.

She settles into a small, sturdy, soundproof building on the campus of Arizona State University at a world-class electron microscope where she studies the composition of extremely thin chemical films.

Her work could have a global impact because she is working toward increasing the efficiency of solar cells, which is necessary before solar energy can be used widely.
!URL
http://blog.oregonlive.com/siliconforest/2011/02/when_the_president_comes_to_vi.html

!Description
Barbara Miner got the word last week that Intel chief executive Paul Otellini might tour her electron microscope lab during a visit to the company's Ronler Acres campus in Hillsboro.

An Intel manager then called her in with another piece of news, still too secret to say out loud in one of Intel’s ubiquitous cubicles, where any talk is easily overhead.
<html>
<!-- begin embedded QuickTime file... -->
      <!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="left">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320"
        height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="/static/files/Microscopy/2008.04.09-mse640-l15-part1.mp4">
        <param name='autoplay' value="false">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src="/static/files/Microscopy/2008.04.09-mse640-l15-part1.mp4" width="320" height="255" autoplay="false" 
        controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table>
</html>

Find the slides at: /static/files/Microscopy/2008.04.09-mse640-l15-part1.pdf
Orignally copied material from: http://nanohub.org/resources/4092
http://www.gatan.com/analysis/bf_df.php
Download the pdf [[here|http://files.dirkjanswagerman.nl/Microscopy/FEI_-_All_you_ever_wanted_to_know_about_Electron_Microscopy.pdf]]
[[Lensless Imaging of Whole Biological Cells With Soft X-Rays|http://www.sciencedaily.com/releases/2010/04/100427171844.htm]]
!URL
http://www.microscopy-news.com/news/-windows--into-the-cell-s-interior---new-method-enables-deeper-insights-into-the-cell.html

!Description
March 19, 2012. -- Cryo-electron tomography provides high-resolution, three-dimensional insights into the cell. However, with this method only very small cells or thin peripheral regions of larger cells can be investigated directly. Scientists of the Max Planck Institute of Biochemistry (MPIB) in Martinsried near Munich have now developed a procedure to provide access to cellular regions which were previously nearly inaccessible. Using focused ion beam (FIB) technology, specific cellular material can be cut out, opening up thin “windows” into the cell’s interior. This alternative approach enables the preparation of larger cellular samples devoid of artefacts. The study was recently published in PNAS USA.
!URL
http://www.imaging-git.com/webcasts/super-resolution-microscopy

!Description
The imaging technology, called OMX 3D SIM super resolution microscopy, is a new 3D tool that captures cellular processes unfolding at nanometer scales. The team worked closely with Associate Professor Cynthia Whitchurch and Dr Lynne Turnbull from the i3 institute at UTS to capture these images. Dr Baum said the methodology would be integral to the development of new malaria drugs and vaccines. "If, for example, you wanted to test a particular drug or vaccine, or investigate how a particular human antibody works to protect you from malaria, this imaging approach now gives us a window to see the actual effects that each reagent or antibody has on the precise steps of invasion," he said. Further he said that one of the most interesting discoveries the imaging approach revealed was that once the parasite has attached to the red blood cell and formed a tight bond with the cell, a master switch for invasion is initiated and invasion will continue unabated without any further checkpoints.
|Symbol|Command|h
|$\large \hat{x}$|\\hat{x}|
|$\large \check{x}$|\\check{x}|
|$\large \dot{x}$|\\dot{x}|
|$\large \breve{x}$|\\breve{x}|
|$\large \acute{x}$|\\acute{x}|
|$\large \ddot{x}$|\\ddot{x}|
|$\large \grave{x}$|\\grave{x}|
|$\large \tilde{x}$|\\tilde{x}|
|$\large \bar{x}$|\\bar{x}|
|$\large \vec{x}$|\\vec{x}|
!URL
http://www.microscopy-news.com/news/quorum-technologies-names-xstor-systems-exclusive-pathology-image-storage-partner-for-canadian-market.html

!Description
XStor Systems, Inc., a provider of next-generation, specialty-specific digital imaging storage and connectivity solutions for radiology, pathology, and oncology, announced today an exclusive partnership with Quorum Technologies, Canada’s leading provider of microscope-based equipment and image processing solutions for scientists, clinicians and laboratories. Through this new partnership, Quorum will be the exclusive distributor of the XStorPath digital image storage and management system for the Canadian pathology market.
{{{
config.macros.PDF = {
  handler: function (place, macroName, params, wikifier, paramString, tiddler)
  {
     var url;

     if (params[0] != null)
     {
           url = params[0];
     }

     resultString = "<html>";
     resultString += '<iframe src ="http://docs.google.com/gview?url='
     resultString += url;
     resultString += ' &embedded=true" style="width:600px;height:340px;" frameborder="0"';
     resultString += '</iframe>'
     resultString += '</html>';

     wikify(resultString,place);
   }
 }
}}}
!URL
http://www.physorg.com/news/2011-04-pool-atoms.html

!Description
Low-energy ion scattering is the only technique that can identify the atoms present on the outermost layer of a solid surface (~0.3 nanometer depth resolution; 1 nm equals a billionth of a meter).
!URL
http://www.adaptica.com/site/en/pages/faq-adaptive-optics

!Description
Improvements for optical light microscopy
/***
|''Name:''|FieldsEditorPlugin|
|''Description:''|//create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>.|
|''Version:''|1.0.2|
|''Date:''|Dec 21,2007|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.2.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[FieldEditor example]]
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
*optionnaly : add the following css text in your StyleSheet : {{{#popup tr.fieldTableRow td {padding:1px 3px 1px 3px;}}}}
!Code
***/

//{{{

config.commands.fields.handlePopup = function(popup,title) {
	var tiddler = store.fetchTiddler(title);
	if(!tiddler)
		return;
	var fields = {};
	store.forEachField(tiddler,function(tiddler,fieldName,value) {fields[fieldName] = value;},true);
	var items = [];
	for(var t in fields) {
		var editCommand = "<<untiddledCall editFieldDialog "+escape(title)+" "+escape(t)+">>";
		var deleteCommand = "<<untiddledCall deleteField "+escape(title)+" "+escape(t)+">>";
		var renameCommand = "<<untiddledCall renameField "+escape(title)+" "+escape(t)+">>";
		items.push({field: t,value: fields[t], actions: editCommand+renameCommand+deleteCommand});
	}
	items.sort(function(a,b) {return a.field < b.field ? -1 : (a.field == b.field ? 0 : +1);});
	var createNewCommand = "<<untiddledCall createField "+escape(title)+">>";
	items.push({field : "", value : "", actions:createNewCommand });
	if(items.length > 0)
		ListView.create(popup,items,this.listViewTemplate);
	else
		createTiddlyElement(popup,"div",null,null,this.emptyText);
}

config.commands.fields.listViewTemplate = {
	columns: [
		{name: 'Field', field: 'field', title: "Field", type: 'String'},
		{name: 'Actions', field: 'actions', title: "Actions", type: 'WikiText'},
		{name: 'Value', field: 'value', title: "Value", type: 'WikiText'}
	],
	rowClasses: [
			{className: 'fieldTableRow', field: 'actions'}
	],
	buttons: [	//can't use button for selected then delete, because click on checkbox will hide the popup
	]
}

config.macros.untiddledCall = {  // when called from listview, tiddler is unset, so we need to pass tiddler as parameter
	handler : function(place,macroName,params,wikifier,paramString) {
		var macroName = params.shift();
		if (macroName) var macro = config.macros[macroName];
		var title = params.shift();
		if (title) var tiddler = store.getTiddler(unescape(title));
		if (macro) macro.handler(place,macroName,params,wikifier,paramString,tiddler);		
	}
}

config.macros.deleteField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"delete", "delete "+fieldName,this.onClickDeleteField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickDeleteField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName && confirm("delete field " + fieldName+" from " + title +" tiddler ?")) {
			delete tiddler.fields[fieldName];
			store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
			story.refreshTiddler(title,"ViewTemplate",true);
		}
		return false;
	}
}

config.macros.createField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly) {
			var btn = createTiddlyButton(place,"create new", "create a new field",this.onClickCreateField);
			btn.setAttribute("title",tiddler.title);
		}
	},
	onClickCreateField : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		if (tiddler) {
			var fieldName = prompt("Field name","");
			if (store.getValue(tiddler,fieldName)) {
				window.alert("This field already exists.");
			}
			else if (fieldName) {
				var v = prompt("Field value","");
				tiddler.fields[fieldName]=v;
				store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.editFieldDialog = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"edit", "edit this field",this.onClickEditFieldDialog);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickEditFieldDialog : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		var fieldName=this.getAttribute("fieldName");
		if (tiddler && fieldName) {
			var value = tiddler.fields[fieldName];
			value = value ? value : "";
			var lines = value.match(/\n/mg);
			lines = lines ? true : false;
			if (!lines || confirm("This field contains more than one line. Only the first line will be kept if you edit it here. Proceed ?")) {
				var v = prompt("Field value",value);
				tiddler.fields[fieldName]=v;
				store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.renameField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"rename", "rename "+fieldName,this.onClickRenameField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickRenameField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName) {
			var newName = prompt("Rename " + fieldName + " as ?", fieldName);
			if (newName) {
				tiddler.fields[newName]=tiddler.fields[fieldName];
				delete tiddler.fields[fieldName];
				store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.shadowTiddlers.StyleSheetFieldsEditor = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow td {padding : 1px 3px}\n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow .button {border:0; padding : 0 0.2em}\n";
config.shadowTiddlers.StyleSheetFieldsEditor +="/*}}}*/";
store.addNotification("StyleSheetFieldsEditor", refreshStyles);

//}}}
Stands
for Gatan Imaging Filter:

Is installed below a TEM, allows to record
electron energy loss spectra ([[EELS]]) and element specific images
(elemental maps) by means of the electron spectroscopic imaging (ESI)
technique. Mostly, the so-called [[three-window method]] is applied for
mappings (see figure): an image is taken after a suitable ionisation
edge of the corresponding element (post-edge image, ΔE3), two
additional images (pre-edge 1, ΔE1, and pre-edge 2, ΔE2) are recorded
at energy losses smaller than the ionisation edge. Only the electrons
passing through the selected energy slit contribute to these images.
Specimen drift during recording of these images is compensated for by a
cross-correlation algorithm implemented in the software of the GIF. The
pre-edge images are used for an approximate determination of the
unspecific background which is then subtracted from the post-edge image
leading to an elemental map with enhanced contrast. Alternatively, the
post-edge image can be divided by a pre-edge image (ratio
method).


|[[GIF 860]]|1kx1k|retractable TV rate camera|
|[[GIF 850]]|2kx2k|retractable TV rate camera|
|[[GIF 863 Tridium]]|2kx2k|[[Ultrascan 1000]]|
|[[GIF 865 Tridium ER]]|2kx2k|[[Ultrascan 1000]]|

On Titan off axis TV camera are not
supported. A presence of the TV camera discriminates between the
850/860 and newer Tridium series.

All GIF's are mounted with a
camera block. This is easier for alignments when you add a so called
pre-GIF or high-res camera. Main precondition is that a high-res camera
needs to be retractable. Only Gatan cameras have this ability: [[US
1000]], [[US 2000]], [MSI 794]]
!URL
http://www.bitplane.com/go/bitplane

!Description
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]] icons:yes more:popup'></div>
<div class='heading'>
	<div class='spaceSiteIcon' macro='tiddlerOrigin label:yes height:48 width:48'></div>
	<div class='modifierIcon'
		macro='view modifier SiteIcon label:yes height:48 width:48 labelPrefix:"modified by "'>
	</div>
	<div class='title' macro='view title'></div>
	<div class='tagClear'></div>
</div>
<div class='tagClear'></div>
<div class='concertina' ></div>
<div class='content'>
	<div class='info'>
		<div class='calendar' macro='viewRevisions page:5'>
			<div class='month' macro='view modified date mmm'></div>
			<div class='date' macro='view modified date 0DD'></div>
			<div class='time' macro='view modified date 0hh:0mm'></div>
		</div>
		<div class='tagClear'></div>
		<div class='tagged' macro='tags'></div>
	</div>
	<div class='viewer' macro='view text wikified'></div>
</div>
<div class='tagClear'></div>
<div class='tagging' macro='tagging'></div>
<div class='counted' macro='BBClonePlugin'></div>
<div class='tagClear'></div>
<!--}}}-->
The equation for an electron wave is given by:

$\Large \psi = e^{-ikx}$

<html>
	<div id="jxgbox" class="jxgbox" style="height:400px; width:600px;"></div>
</html>

<script>
  var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-3,  2, 15, -15], keepaspectratio:true, axis:true});
  board.suspendUpdate();

  var s = board.create('slider', [[0,-2.5],[15,-2.5], [0.0,0.0, 15]], {name:'x'}, {withLabel: false});
  var k = board.create('slider', [[1,-5],[15,-5], [0.0,1.0, 15]], {name:'k'}, {withLabel: false});

  var c = board.create('circle', [[function(){return -1.5},0],[function(){return -1.5},1]],{'strokeColor':'purple'});

  var c1 = new JXG.Complex (function(){return Math.cos(s.Value()*k.Value())},function(){return Math.sin(s.Value()*k.Value())});

  var imaginarygraph = board.create('functiongraph', 
                       [function(x){ return (Math.sin(x*k.Value()));}, 0, 20]
                    );
  var sinline = board.create ('line',[[0,0.0],[20,0.0]], {'dash':true});

  var realgraph = board.create('curve', 
                       [function(y){ return Math.cos((y+2.5)*k.Value())-1.5;}, 
                        function(y){ return y;},-2.5,-15], {'strokeColor':'red'}
                    );

  var realline = board.create ('line',[[-1.5,2],[-1.5,-15]], {'dash':true, 'strokeColor':'red'});

var arrow = board.create('arrow', [[function(){return -1.5},function(){return 0}],[function(){return c1.real()-1.5},function (){return c1.imaginary()}]]);

var realarrow = board.create('arrow', [[function(){return 0}, function(){return -s.Value() -2.5}],[function(){return c1.real()-1.5},function (){return -s.Value()-2.5}]],{'strokeColor':'red'});

var imaginaryarrow = board.create('arrow', [[function(){return s.Value()}, function(){return -2.5}],[function(){return s.Value()},function (){return c1.imaginary()}]],{'strokeColor':'blue'});

  board.unsuspendUpdate();

</script>
!URL
http://www.bitplane.com/go/bitplane

!Description
//{{{
config.shadowTiddlers["StyleSheetJSXGraph"]="/*{{{*/\n"+
".jxgbox {\n"+
"    position:relative; /* for IE 7 */\n"+
"    overflow:hidden;\n"+
"    background-color:#ffffff;\n"+
"    border-style:solid;\n"+
"    border-width:1px;\n"+
"    border-color:#356AA0;\n"+
"    -moz-border-radius:10px;\n"+
"    -webkit-border-radius:10px;\n"+
"}\n"+
"\n"+
".JXGtext {\n"+
"    background-color:transparent;\n"+
"    font-family: Arial, Helvetica, Geneva;\n"+
"    padding:0px;\n"+
"    margin:0px;\n"+
"}\n"+
"\n"+
".navbar {\n"+
"    color: #aaaaaa;\n"+
"    background-color: #f5f5f5;\n"+
"    padding: 2px;\n"+
"    position: absolute;\n"+
"    font-size: 10px;\n"+
"    cursor: pointer;\n"+
"    z-index: 100;\n"+
"    right: 5px;\n"+
"    bottom: 5px;\n"+
"}\n"+
"/*}}}*/";
store.addNotification("StyleSheetJSXGraph",refreshStyles);
//}}}
/***
|''Name''|RevisionsCommandPlugin|
|''Description''|provides access to tiddler revisions|
|''Author''|FND|
|''Contributors''|Martin Budden|
|''Version''|0.3.3|
|''Status''|@@beta@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/RevisionsCommandPlugin.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/plugins/|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.6.0|
|''Keywords''|serverSide|
!Usage
Extend [[ToolbarCommands]] with {{{revisions}}}.
!Revision History
!!v0.1 (2009-07-23)
* initial release (renamed from experimental ServerCommandsPlugin)
!!v0.2 (2010-03-04)
* suppressed wikification in diff view
!!v0.3 (2010-04-07)
* restored wikification in diff view
* added link to side-by-side diff view
!To Do
* strip server.* fields from revision tiddlers
* resolve naming conflicts
* i18n, l10n
* code sanitizing
* documentation
!Code
***/
//{{{
(function($) {

jQuery.twStylesheet(".diff { white-space: pre, font-family: monospace }",
	{ id: "diff" });

var cmd = config.commands.revisions = {
	type: "popup",
	hideShadow: true,
	text: "revisions",
	tooltip: "display tiddler revisions",
	revTooltip: "", // TODO: populate dynamically?
	loadLabel: "loading...",
	loadTooltip: "loading revision list",
	selectLabel: "select",
	selectTooltip: "select revision for comparison",
	selectedLabel: "selected",
	compareLabel: "compare",
	linkLabel: "side-by-side view",
	revSuffix: " [rev. #%0]",
	diffSuffix: " [diff: #%0 #%1]",
	dateFormat: "YYYY-0MM-0DD 0hh:0mm",
	listError: "revisions could not be retrieved",

	handlePopup: function(popup, title) {
		title = this.stripSuffix("rev", title);
		title = this.stripSuffix("diff", title);
		var tiddler = store.getTiddler(title);
		var type = _getField("server.type", tiddler);
		var adaptor = new config.adaptors[type]();
		var limit = null; // TODO: customizable
		var context = {
			host: _getField("server.host", tiddler),
			workspace: _getField("server.workspace", tiddler)
		};
		var loading = createTiddlyButton(popup, cmd.loadLabel, cmd.loadTooltip);
		var params = { popup: popup, loading: loading, origin: title };
		adaptor.getTiddlerRevisionList(title, limit, context, params, this.displayRevisions);
	},

	displayRevisions: function(context, userParams) {
		removeNode(userParams.loading);
		if(context.status) {
			var callback = function(ev) {
				var e = ev || window.event;
				var revision = resolveTarget(e).getAttribute("revision");
				context.adaptor.getTiddlerRevision(tiddler.title, revision, context,
					userParams, cmd.displayTiddlerRevision);
			};
			var table = createTiddlyElement(userParams.popup, "table");
			for(var i = 0; i < context.revisions.length; i++) {
				var tiddler = context.revisions[i];
				var row = createTiddlyElement(table, "tr");
				var timestamp = tiddler.modified.formatString(cmd.dateFormat);
				var revision = tiddler.fields["server.page.revision"];
				var cell = createTiddlyElement(row, "td");
				createTiddlyButton(cell, timestamp, cmd.revTooltip, callback, null,
					null, null, { revision: revision });
				cell = createTiddlyElement(row, "td", null, null, tiddler.modifier);
				cell = createTiddlyElement(row, "td");
				createTiddlyButton(cell, cmd.selectLabel, cmd.selectTooltip,
					cmd.revisionSelected, null, null, null,
					{ index:i, revision: revision, col: 2 });
				cmd.context = context; // XXX: unsafe (singleton)!?
			}
		} else {
			$("<li />").text(cmd.listError).appendTo(userParams.popup);
		}
	},

	revisionSelected: function(ev) {
		var e = ev || window.event;
		e.cancelBubble = true;
		if(e.stopPropagation) {
			e.stopPropagation();
		}
		var n = resolveTarget(e);
		var index = n.getAttribute("index");
		var col = n.getAttribute("col");
		while(!index || !col) {
			n = n.parentNode;
			index = n.getAttribute("index");
			col = n.getAttribute("col");
		}
		cmd.revision = n.getAttribute("revision");
		var table = n.parentNode.parentNode.parentNode;
		var rows = table.childNodes;
		for(var i = 0; i < rows.length; i++) {
			var c = rows[i].childNodes[col].firstChild;
			if(i == index) {
				if(c.textContent) {
					c.textContent = cmd.selectedLabel;
				} else {
					c.text = cmd.selectedLabel;
				}
			} else {
				if(c.textContent) {
					c.textContent = cmd.compareLabel;
				} else {
					c.text = cmd.compareLabel;
				}
				c.onclick = cmd.compareSelected;
			}
		}
	},

	compareSelected: function(ev) {
		var e = ev || window.event;
		var n = resolveTarget(e);
		var context = cmd.context;
		context.rev1 = n.getAttribute("revision");
		context.rev2 = cmd.revision;
		context.tiddler = context.revisions[n.getAttribute("index")];
		context.format = "unified";
		context.adaptor.getTiddlerDiff(context.tiddler.title, context,
			context.userParams, cmd.displayTiddlerDiffs);
	},

	displayTiddlerDiffs: function(context, userParams) {
		var tiddler = context.tiddler;
		tiddler.title += cmd.diffSuffix.format([context.rev1, context.rev2]);
		tiddler.text = "{{diff{\n" + context.diff + "\n}}}";
		tiddler.tags = ["diff"];
		tiddler.fields.doNotSave = "true"; // XXX: correct?
		if(!store.getTiddler(tiddler.title)) {
			store.addTiddler(tiddler);
		}
		var src = story.getTiddler(userParams.origin);
		var tiddlerEl = story.displayTiddler(src, tiddler);
		var uri = context.uri.replace("format=unified", "format=horizontal");
		var link = $('<a target="_blank" />').attr("href", uri).text(cmd.linkLabel);
		$(".viewer", tiddlerEl).prepend(link);
	},

	displayTiddlerRevision: function(context, userParams) {
		var tiddler = context.tiddler;
		tiddler.title += cmd.revSuffix.format([tiddler.fields["server.page.revision"]]);
		tiddler.fields.doNotSave = "true"; // XXX: correct?
		if(!store.getTiddler(tiddler.title)) {
			store.addTiddler(tiddler);
		}
		var src = story.getTiddler(userParams.origin);
		story.displayTiddler(src, tiddler);
	},

	stripSuffix: function(type, title) {
		var str = cmd[type + "Suffix"];
		var i = str.indexOf("%0");
		i = title.indexOf(str.substr(0, i));
		if(i != -1) {
			title = title.substr(0, i);
		}
		return title;
	}
};

var _getField = function(name, tiddler) {
	return tiddler.fields[name] || config.defaultCustomFields[name];
};

})(jQuery);
//}}}
!URL
http://www.nanowerk.com/news/newsid=19678.php

!Description
Posted: Jan 12th, 2011
Fastest movie in the world recorded - a method to film nanostructures
(Nanowerk News) When we catch a cold, the immune system steps in to defend us. This is a well-known biological fact, but is difficult to observe directly. Processes at a molecular level are not only miniscule, they are often extremely fast, and therefore difficult to capture in action. Scientists at Helmholtz-Zentrum Berlin für Materialien und Energie (HZB) and the Technische Uni-versität Berlin (TUB) now present a method that takes us a good step towards producing a "molecular movie". They can record two pictures at such a short time interval that it will soon be possible to observe molecules and nanostructures in real time.
experimental setup to film nanostructures
This diagram shows the experimental setup.
A "molecular movie" that shows how a molecule behaves at the crucial moment of a chemical reaction would help us better understand fundamental processes in the natural sciences. Such proce
/***
|''Name''|BinaryTiddlersPlugin|
|''Description''|renders base64-encoded binary tiddlers as images or links|
|''Author''|FND|
|''Version''|0.3.2|
|''Status''|@@beta@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/BinaryTiddlersPlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5|
!Code
***/
//{{{
(function($) {

var ctfield = "server.content-type";

var plugin = config.extensions.BinaryTiddlersPlugin = {
	isWikiText: function(tiddler) {
		var ctype = tiddler.fields[ctfield];
		if(ctype) {
			return !this.isBinary(tiddler) && !this.isTextual(ctype);
		} else {
			return true;
		}
	},
	// NB: pseudo-binaries are considered non-binary here
	isBinary: function(tiddler) {
		var ctype = tiddler.fields[ctfield];
		return ctype ? !this.isTextual(ctype) : false;
	},
	isTextual: function(ctype) {
		return ctype.indexOf("text/") == 0
			|| this.endsWith(ctype, "+xml")
			|| ctype == 'application/json'
			|| ctype == 'application/javascript';
	},
	endsWith: function(str, suffix) {
		return str.length >= suffix.length &&
			str.substr(str.length - suffix.length) == suffix;
	},
        isLink: function(tiddler) {
            return this.isBinary(tiddler) && tiddler.text.indexOf("<html>") != -1
        }
};

// Disable edit for linked tiddlers (for now)
// This will be changed to a GET then PUT
config.commands.editTiddler.isEnabled = function(tiddler) {
    var existingTest = config.commands.editTiddler.isEnabled;
    if (existingTest) {
        return existingTest && !plugin.isLink(tiddler);
    } else {
        return !plugin.isLink(tiddler);
    }
};

// hijack text viewer to add special handling for binary tiddlers
var _view = config.macros.view.views.wikified;
config.macros.view.views.wikified = function(value, place, params, wikifier,
		paramString, tiddler) {
	var ctype = tiddler.fields["server.content-type"];
	if(params[0] == "text" && ctype && !tiddler.tags.contains("systemConfig") && !plugin.isLink(tiddler)) {
		var el;
		if(plugin.isBinary(tiddler)) {
			var uri = "data:%0;base64,%1".format([ctype, tiddler.text]); // TODO: fallback for legacy browsers
			if(ctype.indexOf("image/") == 0) {
				el = $("<img />").attr("alt", tiddler.title).attr("src", uri);
			} else {
				el = $("<a />").attr("href", uri).text(tiddler.title);
			}
		} else {
			el = $("<pre />").text(tiddler.text);
		}
		el.appendTo(place);
	} else {
		_view.apply(this, arguments);
	}
};

// hijack edit macro to disable editing of binary tiddlers' body
var _editHandler = config.macros.edit.handler;
config.macros.edit.handler = function(place, macroName, params, wikifier,
		paramString, tiddler) {
	if(params[0] == "text" && plugin.isBinary(tiddler)) {
		return false;
	} else {
		_editHandler.apply(this, arguments);
	}
};

// hijack autoLinkWikiWords to ignore binary tiddlers
var _autoLink = Tiddler.prototype.autoLinkWikiWords;
Tiddler.prototype.autoLinkWikiWords = function() {
	return plugin.isWikiText(this) ? _autoLink.apply(this, arguments) : false;
};

})(jQuery);
//}}}
/***
|''Name''|GraphPlugin|
|''Description''|Display dot graphs|
|''Version''|0.12.1|
|''Status''|beta|
|''License''|[[BSD open source license]] from [[IDEIA|http://www.ideia.fr]]|
|''~CoreVersion''|2.4.0|
|''Keywords''|visualization, graph, diagram, forcedirected, animated|
!Usage
Draw a graph
{{{
<<graph dimX dimY nolinks backlinks strict tags:tags anim:timing filter:tags start:tiddlers plot:tiddler>>
}}}
Options
* ''nolinks''  : do not follow forward links and tags
* ''nogroups'' : do not treat "tag" links as group links
* ''backlinks'' : follow reverse links
* ''strict'' : exclude all node not tagged with "tags" (otherwise direct links are included)
* ''notags'' : ignore tag links
* ''fields'' : read from fields instead of slices
* ''anim'':animate graph for some time
* ''tags'' : choose tiddlers with specified tags
* ''filter'' : exclude those tiddler with specified tags
* ''start'' : check also from these tiddler (+ thier direct links)
* ''plot'' : use the text of this tiddler to draw a graph from the text and not the tiddlers node, annot, link, type in an array. '->' for direct link, '<-' for backlinks and ':>' or ':<' for tag/group link.
Change node properties with slices
* ''color'' : graph.fillStyle, graph.strokeStyle, 
* ''position'' : graph.X, graph.Y, graph.repulse
* ''display'': graph.title, graph.subTitle, graph.ignore
* ''life'' : graph.endLife, graph.startLife
In GraphConfig, you can configure style for links by combining
* ''link type'': direct, titled, bracket, back, tag
* ''display'' : fillStyle, strokeStyle, lineWidth, margin, rounded
!!History
|15.01.09| 0.1.0|Initial release, draw graph with anotated nodes from tiddler|
|16.01.09| 0.2.0|Add animation (the 3 parameter is the number of steps calculated)|
|19.01.09| 0.3.0|Added ability to move nodes, graph dynamically updated|
|22.01.09| 0.4.0|Support of multiple tags and filter also|
|22.01.09| 0.5.0|Can set color for node and links, depending of it's type|
|23.01.09| 0.6.0|Annotated links can be overiden by a tiddler|
|23.01.09| 0.6.1|Fix a bug : now start can have multiple tiddlers|
|23.01.09| 0.7.0|Now a new slice graph.subtitle|
|28.01.09| 0.8.0|Add preliminary time support in graph : graph.endLife|
|02.02.09| 0.8.1|Add "strict" filter for some graph displaying unwanted nodes|
|03.02.09| 0.8.2|Add graph.ignore to filter some individual links in graph|
|04.02.09| 0.8.3|Initial position of node is not 0 any more, so that no more random graphs|
|04.02.09| 0.9.0|Option to read from slices or from fields|
|05.02.09| 0.9.1|Add : graph.startLife|
|05.02.09| 0.9.2|Add : graph.repulse : so that nodes can be more isolated (useful for anotated links|
|13.02.09| 0.9.3|Links can be individually colored in their tiddler if it exist, rather than in GraphConfig|
|20.02.09| 0.10.0|Add : rounded rectangle + collapsible text for links|
|13.04.09| 0.11.0|Add direct graph plotting from table syntax|
|13.04.09| 0.12.0|Add group node support (eq tag link = group link)|
|13.04.09| 0.12.0|Add 'dot' syntax to direct graph (it means that it can read plain text to draw graphs|
!Known BUGS
* In some cases when every node in the graph have exactly the same tags, it can create a NaN anomaly. To bypass it, just change some tags.
* the new functionnalité collapsible links is not yet compatible with "full links" ... full links are links described in a tiddler
!Code
***/
//{{{
if(!version.extensions.GraphPlugin) {
version.extensions.GraphPlugin = {installed:true};

config.macros.graph = {};

config.macros.graph.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	var box = createTiddlyElement(place,"div",null,"graphBox",'');
	box.title = "Graph";
	box.id = "graphBox";
	box.style.position = "relative";
	var canvas = document.createElement("canvas");
	canvas.width = params[0];
	canvas.height = params[1];
	box.appendChild(canvas);
	var ctx = canvas.getContext("2d");
	var timer = document.createElement("div");
	box.appendChild(timer);

	var parameters = paramString.parseParams("noname",null,true);
	var includeTags = parameters[0]["tags"]?parameters[0]["tags"][0].split(","):[];
	var startTiddlers = parameters[0]["start"]?parameters[0]["start"][0].split(","):[];
	var plotTiddlers = parameters[0]["plot"]?parameters[0]["plot"][0].split(","):[];
	var excludeTags = parameters[0]["filter"]?parameters[0]["filter"][0].split(","):[];
	var anim = parameters[0]["anim"]?parseInt(parameters[0]["anim"][0]):0;
	var results = [];
	if (parameters[0]["start"]) {
		for (var k=0; k<startTiddlers.length; k++)
			results.push( store.getTiddler(startTiddlers[k]) );
	} else store.forEachTiddler(function(title,tiddler) {
		if (tiddler.tags.containsAny(includeTags) 
		 && !tiddler.tags.containsAny(excludeTags))
			results.push(tiddler);
		});

var g = new Graph(box);
g.useSlice = parameters[0]["noname"].indexOf("fields") == -1;
g.useGroup = parameters[0]["noname"].indexOf("nogroups") == -1;
var strict = parameters[0]["noname"].indexOf("strict") != -1;
var waitingList = [];
var time=0;

	if (parameters[0]["plot"]) {
		for (var k=0; k<plotTiddlers.length; k++)
			plotTiddler( store.getTiddler(plotTiddlers[k]) );
	}

for (var i=0; i<results.length; i++)
{
	if (!g.getValue(results[i].title, "graph.startLife"))
		g.addNode(results[i].title); 
	else
		waitingList.push(results[i]);
}
relink();

function plotGetTableLine(line) {
     params = line.split('|');
     node = params[1];
     if (!node) return;
     annot = params[2];
     link = params[3];
     linktype = params[4]?params[4]:"plot";
     if (link)
       g.addEdge(node, link,{type:linktype, text:annot?annot:""})
     else
       g.addNode(node, annot); 
}

function plotGetWikiLinks(node, line, mode) {
        // mode = 0 : direct link, mode = 1 : backlink, mode = 2, group link
	node = node.replace(/ /g,'').replace(/^\*/g, '').replace(/\'/g, '').replace(/\[/g,'').replace(/\]/g,'');
	var tiddlerLinkRegExp = config.textPrimitives.tiddlerForcedLinkRegExp;
        t=1;
function addInternalLink(link, annot) {
               switch (mode) {
                       case '->' : g.addEdge(node, link,{type:"plot", text:annot}); break;
                       case '<-' : g.addEdge(link, node,{type:"plot", text:annot}); break;
                       case ':>' : g.addEdge(node, link,{type:"tag", text:annot}); break;
                       case ':<' : g.addEdge(link, node,{type:"tag", text:annot}); break;
              }
}

	//tiddlerLinkRegExp.lastIndex = 0;
	var formatMatch = tiddlerLinkRegExp.exec(line);
	while(formatMatch) {
		//var lastIndex = tiddlerLinkRegExp.lastIndex;
		if(formatMatch[2-t] && !config.formatterHelpers.isExternalLink(formatMatch[3-t])) // titledBrackettedLink
                        addInternalLink(formatMatch[3-t], formatMatch[2-t], node, mode)
		else if(formatMatch[4-t] && formatMatch[4-t] != this.title) // brackettedLink
			addInternalLink(formatMatch[4-t], "", node, mode);
		//tiddlerLinkRegExp.lastIndex = lastIndex;
		formatMatch = tiddlerLinkRegExp.exec(line);
	}

}

function plotTiddler(tiddler) {
  var lines = new Array();   
  lines = tiddler.text.split("\n");
  for (var i=0; i < lines.length; i++) {
    var line = lines[i]; 
    if (line == "") continue;
    if (line[0] == "|") plotGetTableLine(line);
    var n = line.indexOf("->");
    if (n != -1) plotGetWikiLinks(line.slice(0, n), line.slice(n+2), '->');
    n = line.indexOf("<-");
    if (n != -1) plotGetWikiLinks(line.slice(0, n), line.slice(n+2), '<-');
    n = line.indexOf(":>");
    if (n != -1) plotGetWikiLinks(line.slice(0, n), line.slice(n+2), ':>');
    n = line.indexOf(":<");
    if (n != -1) plotGetWikiLinks(line.slice(0, n), line.slice(n+2), ':<');
  }
}

function relink() {
	for (var i=0; i<results.length; i++)
	{
		if (!g.getValue(results[i].title, "graph.startLife"))
			addLinks(results[i]); 
	}
}

function tiddlerIndexOf(a, t) {
	for (var i=0; i<a.length; i++)
		if (a[i].title == t) return i;
	return -1;
}

function addLivingEdge(ta, tb, info) {
	if (!g.getValue(tb, "graph.startLife") )
		g.addEdge(ta, tb, info);
	else if (time >= g.getValue(tb, "graph.startLife" ))
		g.addEdge(ta, tb, info);
}

function addLinks(ta) {
	var ignoreList = g.getValue(ta.title, "graph.ignore");
	ignoreList = ignoreList ? ignoreList.readBracketedList():[];

	if (parameters[0]["noname"].indexOf("notags") == -1) {
		for (var j=0; j<results.length; j++)  {
			var tb = results[j];
			if (ignoreList.contains(tb.title)) continue;
			if ( ta.tags.contains(tb.title) ) 
			addLivingEdge(ta.title, tb.title, {type:"tag", text:""});
		}
	}
	if (parameters[0]["noname"].indexOf("backlinks") != -1) {
		var references = store.getReferringTiddlers(ta.title);
		for(var r=0; r<references.length; r++) {
			if(references[r].title != ta.title
			 && !references[r].tags.contains("excludeLists")
			 && (tiddlerIndexOf(results, references[r].title) != -1 || !strict) 
			 && (!ignoreList.contains(references[r].title)) )
				addLivingEdge(ta.title, references[r].title, {type:"back", text:""});
		}
	}
	if (parameters[0]["noname"].indexOf("nolinks") == -1) {
		var links = ta.annotatedLinks();
		for (var r=0; r<links.length; r++) {
			if ( (tiddlerIndexOf(results, links[r].link) != -1 || !strict)
			 && !ignoreList.contains(links[r].link))
				addLivingEdge(ta.title, links[r].link, links[r].info);
		}
	}

}

var layouter = new Graph.Layout.Spring(g);
layouter.prepare();
var renderer = new Graph.Renderer.Basic(canvas, g);
var interval = 0; 
if (anim != 0)
	interval = setInterval(animate, 250);
else
{
	layouter.layout();
	renderer.draw();
}

function animate()
{
	timer.innerHTML = "time :"+time;
	if (isdrag) {
		elementToMove.style.left = newElementX + 'px';
		elementToMove.style.top  = newElementY + 'px';
		layouter.reverse(renderer.factorX, renderer.factorY);
	}
	for (var i=waitingList.length-1; i>=0; i--) {
		var current = waitingList[i];
		if (time >= g.getValue(current.title, "graph.startLife")) {
			g.addNode(current.title);
			relink();
			layouter.layoutPrepareLastNode();
			waitingList.splice(i,1);
		}
	}
	g.animate(time);
	layouter.step();
	renderer.draw();
	time++;
	if (time==anim || time > 500) clearInterval(interval);
}


var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;					// this flag indicates that the mouse movement is actually a drag.
var mouseStartX, mouseStartY;		// mouse position when drag starts
var elementStartX, elementStartY;	// element position when drag starts
var newElementX, newElementY;
var elementToMove;
var bounds = new Array(4);

function movemouse(e)
{
	if (isdrag)
	{
		var currentMouseX = nn6 ? e.clientX : event.clientX;
		var currentMouseY = nn6 ? e.clientY : event.clientY;
		newElementX = elementStartX + currentMouseX - mouseStartX;
		newElementY = elementStartY + currentMouseY - mouseStartY;

		/*/ check bounds
		// note: the "-1" and "+1" is to avoid borders overlap
		if(newElementX < bounds[0])
			newElementX = bounds[0] + 1;
		if(newElementX + elementToMove.offsetWidth > bounds[2])
			newElementX = bounds[2] - elementToMove.offsetWidth - 1;
		if(newElementY < bounds[1])
			newElementY = bounds[1] + 1;
		if(newElementY + elementToMove.offsetHeight > bounds[3])
			newElementY = bounds[3] - elementToMove.offsetHeight - 1;*/
		
		// move element
		elementToMove.style.left = newElementX + 'px';
		elementToMove.style.top  = newElementY + 'px';
	
		elementToMove.style.right = null;
		elementToMove.style.bottom = null;

		layouter.reverse(renderer.factorX, renderer.factorY);
		
		return false;
	}
}

function startDrag(e) 
{	
	var eventSource = nn6 ? e.target : event.srcElement;
	if(eventSource.tagName == 'HTML')
		return;

	while (eventSource != document.body && !hasClass(eventSource, "draggable"))
	{  	
		eventSource = nn6 ? eventSource.parentNode : eventSource.parentElement;
	}

	// if a draggable element was found, calculate its actual position
	if (hasClass(eventSource, "draggable"))
	{
                time = 0;
		isdrag = true;
		elementToMove = eventSource;

		// set absolute positioning on the element		
		//elementToMove.style.position = "absolute";
				
		// calculate start point
		elementStartX = elementToMove.offsetLeft;
		elementStartY = elementToMove.offsetTop;
		
		// calculate mouse start point
		mouseStartX = nn6 ? e.clientX : event.clientX;
		mouseStartY = nn6 ? e.clientY : event.clientY;
		
		/*/ calculate bounds as left, top, width, height of the parent element
		if(getStyle(elementToMove.parentNode, "position") == 'absolute')
		{
			bounds[0] = 0;
			bounds[1] = 0;
		}
		else
		{
			bounds[0] = calculateOffsetLeft(elementToMove.parentNode);
			bounds[1] = calculateOffsetTop(elementToMove.parentNode);
		}
		bounds[2] = bounds[0] + elementToMove.parentNode.offsetWidth;
		bounds[3] = bounds[1] + elementToMove.parentNode.offsetHeight;*/
		
		document.onmousemove = movemouse;
		interval = setInterval(animate, 50);
				
		return false;
	}
}

function stopDrag(e)
{
	isdrag=false; 
	elementToMove = null;
	document.onmousemove = null;
	clearInterval(interval);
	animate(); // one last time to refresh correctly last mouse pos
}

document.onmousedown = startDrag;
document.onmouseup = stopDrag;


function hasClass(element, className)
{
	if(!element || !element.className)
		return false;
		
	var classes = element.className.split(' ');
	var i;
	for(i = 0; i < classes.length; i++)
		if(classes[i] == className)
			return true;
	return false;
}

function getStyle(node, styleProp)
{
	// if not an element
	if( node.nodeType != 1)
		return;
		
	var value;
	if (node.currentStyle)
	{
		// ie case
		styleProp = replaceDashWithCamelNotation(styleProp);
		value = node.currentStyle[styleProp];
	}
	else if (window.getComputedStyle)
	{
		// mozilla case
		value = document.defaultView.getComputedStyle(node, null).getPropertyValue(styleProp);
	}
	
	return value;
}

function replaceDashWithCamelNotation(value)
{
	var pos = value.indexOf('-');
	while(pos > 0 && value.length > pos + 1)
	{
		value = value.substring(0, pos) + value.substring(pos + 1, pos + 2).toUpperCase() + value.substring(pos + 2);
		pos = value.indexOf('-');
	}
	return value;
}

/*
 * This function calculates the absolute 'top' value for a html node
 */
function calculateOffsetTop(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) 
			curtop += obj.offsetTop
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

/*
 * This function calculates the absolute 'left' value for a html node
 */
function calculateOffsetLeft(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) 
		{
			curleft += obj.offsetLeft;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}



}
}


//}}}
Unless you're delighted with the default scheme you can make some quick changes by generating a new random color palette, hit this button to cycle through some alternatives.

<<RandomColorPaletteButton saturation_pale:0.67 saturation_light:0.53
saturation_mid:0.43 saturation_dark:0.06 pale:0.99 light:0.85 mid:0.5 dark:0.31>>
<html><hr><html>
!URL
http://www.microscopy-analysis.com/features/srs-microscopy-captures-blood-cells-video-rate?c=light

!Description
SRS microscopy captures blood cells at video rate

Researchers at Harvard University in Cambridge, Mass., have captured blood cells squeezing through capillaries at video rate using stimulated Raman scattering microscopy.

Previously, SRS microscopy captured only about one image per minute, which was too slow to use in live animals or humans. The Harvard researchers, who included Brian G. Saar, Christian W. Freudiger, and X. Sunney Xie, were able to speed the collection of data by more than three orders of magnitude, fast enough for video-rate imaging.

SRS microscopy works by detecting the intrinsic vibrations in chemical bonds between atoms. The researchers improved detection of laser light backscattered by tissue by rearranging photodetectors to surround a small aperture through which laser light is directed at the tissue. This allowed the researchers to collect and analyze almost 30% of the laser light directed at a biological sample, a more than 30-fold increase over previous SRS
!URL
http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2818.2009.03287.x/full

!Description
Real-time computation of subdiffraction-resolution fluorescence images
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   version="1.1"
   width="14pt"
   height="14pt"
   viewBox="918 510 14 14"
   id="svg3070">
  <metadata
     id="metadata3089">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs3072">
    <radialGradient
       cx="0"
       cy="0"
       r="1"
       id="Gradient"
       gradientUnits="userSpaceOnUse">
      <stop
         id="stop3075"
         style="stop-color:#ffffff;stop-opacity:1"
         offset="0" />
      <stop
         id="stop3077"
         style="stop-color:#2b2b2b;stop-opacity:1"
         offset="1" />
    </radialGradient>
    <radialGradient
       id="Obj_Gradient"
       xlink:href="#Gradient"
       gradientTransform="matrix(11.473944,0,0,11.473944,922.3752,513.7837)" />
  </defs>
  <g
     id="g3080"
     style="fill:none;stroke:none">
    <g
       id="g3082">
      <path
         d="m 929.6952,512.9018 c -2.5384,-2.53843 -6.654,-2.53843 -9.1924,0 -2.5384,2.5384 -2.5384,6.654 0,9.19238 2.5384,2.53839 6.654,2.53839 9.1924,0 2.5384,-2.53838 2.5384,-6.65398 0,-9.19238 m -4.5962,2.8407 2.07733,-2.07734 1.75547,1.75549 -2.0773,2.07735 2.0773,2.07732 -1.75547,1.75548 -2.07733,-2.07732 -2.07733,2.07732 -1.75547,-1.75548 2.0773,-2.07732 -2.0773,-2.07735 1.75547,-1.75549 z"
         id="path3084"
         style="fill:url(#Obj_Gradient)" />
      <path
         d="m 927.61447,515.38354 a 4.51205,4.2590378 0 1 1 -9.0241,0 4.51205,4.2590378 0 1 1 9.0241,0 z"
         transform="matrix(1.0218069,0,0,1.0462046,-18.063694,-21.648443)"
         id="path2394"
         style="fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
    </g>
  </g>
</svg>
!URL
http://ami.scripps.edu/software/phoelix/

!Description
[[Diffraction]]

[[Elastic
scattering]]

[[Inelastic
scattering]]

[[Apertures]]

[[Microprobe]] vs
[[Nanoprobe]]

[[TEM Gun lens exitation]]
!URL
http://www.cell.com/neuron/abstract/S0896-6273(11)01003-8

!Description
The neuroimaging community is at a crossroads. Long characterized by individualism, the data and computational and analytic needs of the connectome-wide association era necessitate cultural reform. Emerging initiatives have demonstrated the feasibility and utility of adopting an open neuroscience model to accelerate the pace and success of scientific discovery.
!URL
http://www.nanowerk.com/news/newsid=18303.php

!Description
(Nanowerk News) Our attempts to use solar energy continue to be very ineffective; the true masters of this craft are photosynthetic plants, algae, and bacteria. Science is trying to emulate these organisms.
Igor Nabiev from the NanoGUNE Research Centre in San Sebastian (Spain), Alexander O. Govorov of Ohio University (USA), John Donegan of CRANN, Trinity College Dublin (Ireland), and a team of Spanish, Irish, French, and Russian scientists have now developed a new approach to increasing light efficiency. As they report in the journal Angewandte Chemie Kim is first author of a recent research paper in Environmental Science & Technology ("Fluorescent Quantum Dots as Artificial Antennas for Enhanced Light Harvesting and Energy Transfer to Photosynthetic Reaction Centers"), they successfully equipped the photosynthetic center from a purple bacterium with a "light-harvesting antenna" consisting of a quantum dot—an inorganic nanocrystal.
Quantum dots (QDs) can be tagged with photosynthetic reaction centers (RCs) in such a way (see picture) that FRET from the QD to the RC leads to a near-threefold increase in the rate of generation of excitons in the RC over that in the RC alone
Quantum dots (QDs) can be tagged with photosynthetic reaction centers (RCs) in such a way (see picture) that FRET from the QD to the RC leads to a near-threefold increase in the rate of generation of excitons in the RC over that in the RC alone. Even-stronger enhancements are predicted, thus indicating that such complexes may significantly improve the efficiency of photosynthesis.


In organisms, the first step of photosynthesis is the absorption of light by an antenna, a complex of proteins and pigments that is brought into an electronically excited state by light energy. The energy packet can then be passed on to special chlorophyll cofactors in the reaction center of the photosynthetic apparatus. There the energy is finally used to produce cellular energy stores such as ATP. The passing-on of the energy packets occurs through a special radiation-free process called Förster resonance energy transfer (FRET), in which the electronic states of the sender and receiver of the energy packets must be brought into resonance.

Artificial photosynthetic systems also require an antenna for the efficient harvesting of light. The antenna must also be able to pass the energy packets along through FRET. Previous synthetic antennas were organic dye molecules, which have the disadvantage of capturing too small a range of wavelengths from sunlight. Furthermore, they are not stable under long-term irradiation. The new idea in this case was to replace the organic molecules with fluorescing inorganic quantum dots as antennas. Quantum dots are nanoscopic crystals that are so tiny that in many respects they behave like molecules rather than as macroscopic solid objects. The electronic and optical properties of quantum dots, including the wavelengths that they absorb, can largely be made to order, because these are dependent on the size, shape, and composition of the dot.
The researchers chose to use quantum dots made of cadmium telluride and cadmium selenide, which fluoresce under irradiation while remaining stable in the long term. The size and surface composition were selected so that they could absorb a particularly broad range of sunlight.
The researchers were able to couple the quantum-dot antenna to a reaction center from the photosynthetic system of a purple bacterium. Under irradiation, the quantum dots then no longer fluoresce; instead they pass the absorbed energy over to the reaction center through FRET. This new approach may clear a path toward novel synthetic photosynthetic systems.
!URL
http://xmipp.cnb.csic.es/

!Description
There are a lot of interesting people using ~TiddlySpace that you might like to keep track of and interact with. There are a number of ways of doing this.

If you see a number in the speech bubble in one of your tiddlers, it means that someone is writing about the same thing as you. You can find out what they're saying by clicking on it. Likewise, if you see something interesting in someone else's space, you can respond to it and write up your own thoughts on the subject by clicking "Reply to this tiddler".

Additionally, if you find anyone interesting, or you find an interesting looking space and you'd like to know when it's changed, you can "follow" that space. To do this, simply create a tiddler with the title: {{{@space-name}}} and tag it {{{follow}}}. If you want, you can store some notes about that space in the body of the tiddler.

If you then want to know what happening, simply [[include|How do I include/exclude spaces?]]@docs the @tivity space and then visit your activity stream at [[/activity|/activity]], or just visit the @tapas space directly.

!Not sure who to follow?
Here's a few suggestions:
* @fnd
* @cdent
* @pmario
* @bengillies
* @dickon
!URL
http://www.nanowerk.com/news/newsid=18488.php

!Description
Unsung hero - researchers produce high-res model of Ndc80 in action
(Nanowerk News) Unless you are in a field of study related to cell biology, you most likely have never heard of Ndc80. Yet this protein complex is essential to mitosis, the process by which a living cell separates its chromosomes and distributes them equally between its two daughter cells. Now, through a combination of cryo-electron microscopy and three-dimensional image reconstruction, a team of researchers with the Lawrence Berkeley National Laboratory (Berkeley Lab) and the University of California (UC) Berkeley have produced a subnanometer resolution model of human Ndc80 that reveals how this unsung hero carries out its essential tasks.
"Our model suggests that Ndc80 oligomerizes on the surface of the microtubule via a segment of the protein that is regulated so that correct attachments are maintained and incorrect attachments are discarded," says biophysicist Eva Nogales who led this study.

Overhead view of a subnanometer resolution reconstruction showing the microtubule-binding region of the Ndc80 complex (blue) attached to a microtubule(green)
Overhead view of a subnanometer resolution reconstruction showing the microtubule-binding region of the Ndc80 complex (blue) attached to a microtubule (green). The part of the Ndc80 complex away from the microtubule is flexible and appears as scattered density in the reconstruction (red).
"What we propose is that this oligomerization is an important part of the mechanism by which Ndc80 is able to utilize the energy of microtubule disassembly to move chromosomes towards the spindle poles during mitosis. This oligomerization will only happen for correctly attached microtubules"

Nogales holds joint appointments with Berkeley Lab's Life Sciences Divisions, UC Berkeley's Molecular and Cell Biology Department, and the Howard Hughes Medical Institute. An expert on electron microscopy and image analysis and an authority on the structure and dynamics of microtubules, she is the corresponding author of a paper published in the journal Nature titled, "The Ndc80 kinetochore complex forms oligomeric arrays along microtubules."

Co-authoring the paper with Nogales were Gregory Alushin, Vincent Ramey, Sebastiano Pasqualato, David Ball, Nikolaus Grigorieff and Andrea Musacchio.

Biological cells have a cytoskeleton that gives shape to membrane walls and other cellular structures and also controls the transportation of substances in and out of the cell. This cytoskeleton is spun from tiny fibers of tubulin protein called microtubles. During mitosis, microtubules disassemble and reform into spindles across which duplicate sets of chromosomes line up and migrate to opposite poles. After chromosome migration is complete, the microtubules disassemble and reform back into skeletal systems for the two new daughter cells.

A kinetochore is the multi-protein structure in which microtubule spindle fibers engage chromosomes to align and separate them equally between daughter cells during cell division.
A kinetochore is the multi-protein structure in which microtubule spindle fibers engage chromosomes to align and separate them equally between daughter cells during cell division.
Mistakes in the distribution of chromosomes from a parent cell to its daughter cells can lead to birth defects, cancer and other disorders. To ensure that each daughter cell receives a single copy of each chromosome, microtubule spindles dock with each chromosome's centromere – the central region where its two chromatids connect. The microtubule spindles connect with the centromere through a network of proteins called the kinetochore. Ndc80 is a key member of the kinetochore network and serves as a sort of "landing pad" for the microtubule-centromere connection. Although Ndc80's genetics and biochemistry have been extensively characterized, the mechanisms behind its activities have until now remained a mystery.

"Our first ever subnanometer model of Ndc80 shows that the protein complex binds the microtubule with a tubulin monomer repeat that is sensitive to tubulin conformation," Nogales says. "Furthermore, Ndc80 complexes self-associate along microtubule protofilaments via interactions that are mediated by the amino-terminal tail of the Ndc80 protein, which is the site of phospho-regulation by the Aurora B kinase."

The Aurora B kinase is an enzyme that ensures the correction of any improper microtubule-kinetochore attachments – faulty attachments will result in unequal segregation of the genetic material, such as both chromatides going to the same daughter cell. In their paper, Nogales and her co-authors contend that Ndc80's mode of interaction with the microtubule and its oligomerization provide a means by which the Aurora B kinase can regulate the stability of the load-bearing Ndc80-microtubule attachments.

"The Aurora B kinase corrects wrong microtubule-kinetochore attachments by phosphorylating proteins in the kinetochore," Nogales says. "Ndc80 is a major substrate of this regulation. Our work shows that if phosphorylated by Aurora B, attachments are not robust because there is no oligomerization of Ndc80s."
<html>For
simplicity, assume that the image I being considered is formed by
projection from scene S (which might be a two- or three-dimensional
scene, etc.).

The frequency domain is a space in which each image
value at image position F represents the amount that the intensity
values in image I vary over a specific distance related to F.<br
/><br />In the frequency domain, changes in image position
correspond to changes in the spatial frequency, (or the rate at which
image intensity values) are changing in the [[spatial domain]] image
I.<br /><br />For example, suppose that there is the value
20 at the point that represents the frequency 0.1 (or 1 period every 10
pixels). This means that in the corresponding spatial domain image I
the intensity values vary from dark to light and back to dark over a
distance of 10 pixels, and that the contrast between the lightest and
darkest is 40 gray levels (2 times 20).

The [[spatial frequency]]
domain is interesting because:<br /><br />1) it may make
explicit periodic relationships in the spatial domain, and<br
/>2) some image processing operators are more efficient or indeed
only practical when applied in the frequency domain.<br /><br
/>In most cases, the Fourier Transform is used to convert images
from the spatial domain into the frequency domain and vice-versa.

A
related term used in this context is [[spatial frequency]], which
refers to the (inverse of the) periodicity with which the image
intensity values change. Image features with high spatial frequency
(such as edges) are those that change greatly in intensity over short
image distances.<br /><p>
If an image has <span
style="font-weight: bold;">large values at </span><em
style="font-weight: bold;">high</em><span
style="font-weight: bold;"> frequency </span>components then
the data is changing <span style="font-weight: bold;">rapidly on
a short distance scale. </span><em>e.g.</em> a page
of text
</p><p>
If the image has <span
style="font-weight: bold;">large </span><em
style="font-weight: bold;">low</em><span
style="font-weight: bold;"> frequency </span>components then
the <span style="font-weight: bold;">large scale features of the
picture are more important. </span><em>e.g.</em> a
single fairly simple object which occupies most of the
image.
</p></html>
/***
|''Name:''|purpleTheme|
|''Description:''|A theme with lots of white space and a clean and elegant purple presentation|
|''Author:''|Saq Imtiaz and Simon McManus|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]] |
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/purpleTheme.tiddler|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/purpleTheme.tiddler|
|''~CoreVersion:''|2.4.1|
|''~PageTemplate:''|##PageTemplate|
|''~tabs:''|##tabs|
|''~OptionsPanel:''|##OptionsPanel|
|''~SideBarTabs:''|##SideBarTabs|
|''~StyleSheet:''|##StyleSheet|
|''~taskViewTemplate:''|##taskViewTemplate|
|''~taskEditTemplate:''|##taskEditTemplate|
|''~EditTemplate:''|##EditTemplate|.wizzz
|''~ViewTemplate:''|##ViewTemplate|
***/
!PageTemplate
<!--{{{-->
<div id='bodywrapper'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' tiddler='purpleTheme##SideBarOptions'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter'  macro='gradient vert #eee #ccc'></div>
</div>
<!--}}}-->

!EditTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></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'></span></div>
<!--}}}-->

!ViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='tagClear'></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>
<hr />
<!--}}}-->

!tabs
<<tabs txtMainTab "Timeline" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>


!SideBarOptions
<<search {{config.options.search}}>><<closeAll>><<newTiddler label:{{config.macros.newTiddler.label}} text:{{config.macros.newTiddler.text}} title:{{config.macros.newTiddler.title}} tag:"">
<<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel  {{config.macros.ccOptions.options}} 'change TiddlyWiki Options'>><<slider 'chkLoginStatus' 'LoginStatus' {{config.macros.ccLoginStatus.status}} 'Login to make changes'>><<slider chkSliderTabs SideBarTabs {{config.theme.contentTitle}} {{config.theme.contentTiddlerTooltip}}>>

!StyleSheet
/***
General
***/
/*{{{*/

body, html{
	background-color: #999999;
	color:#333;
//	background:url(http://www.thefabricdeli.com/assets/images/qud21112-purple.jpg);
//	background:url(http://mr-pc.org/inc/paisleyTileSmall.png);
}

#backstageCloak {
	opacity:0.8; filter:'alpha(opacity:70)';
	background:black;
}
.tiddler .button {
	line-height:4;
	margin:5px;
	padding:8px;
}

body .chkOptionInput {
	width:auto;
	float:right;
}

#contentWrapper .wizard .txtOptionInput {
	width:7em;
}

.wizard  .txtOptionInput{
text-align:right;
	border:1px solid #ccc;
}

#contentWrapper .sliderPanel .tabsetWrapper .tabContents {
	border:0px;
	background-color:white;
}

.header {
	background-color:#eee;
}

#messageArea {
	border:1px solid white;
	background-color:#eee;
}

#messageArea .button {
	background:none;
}

h1 {
	color:black;
}

#contentWrapper {
	position:relative;
	margin: 2.5em auto;
	width:780px;
	line-height: 1.6em;
	border:1px solid #ccc;
	font-size: 11px;
	font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif;
	height:1%;
//	display:table;
	background-color:#eee;
}

.clearAll{
	clear:both;
}

.tagClear{
	clear:none;
}
/*}}}*/

/*{{{*/
.siteTitle {
	font-family: 'Trebuchet MS' sans-serif;
	font-weight: bold;
	position:relative;
	top:20px;
	left :20px;
	font-size: 32px;
	color:Purple;
}

.siteSubtitle {
	padding-top:15px;
	font-size: 1.0em;
	display:block;
	color: #999; margin-top:0.5em !important; margin-top:1em; margin-left:3em;
	padding-top:3em;
}

#displayArea {
	margin-left:1.35em;
	margin-right:16.3em;
	margin-top:0;
	padding-top:1em;
	padding-bottom:10px;
}

#sidebarOptions input {
	border:1px solid #ddd;
}

div.tabset {
	margin-bottom:1px;
}

.tabUnselected {
	background:#ddd none repeat scroll 0%;
	color:#999;
	border:1px solid #ccc;
}

#sidebar {
	position:inherit;
	float:right;
	display:inline;
}

#tiddlerDisplay .tagging, #tiddlerDisplay .tagged {
	background-color:#eee;
	border:none;
	float:none;
}

.sliderPanel .tabsetWrapper .tabContents {
	border-right:none;
	border-color:#999;
	background-color:#999;
}

#sidebarOptions .sliderPanel a {
	padding:3px;
	margin:0px;
	border:2px;
	background-color:#999;
}

.tabsetWrapper {
	position :relative;
}

#sidebar{
	padding-left:0.5em;
	background-color:#eee;
	padding-top:1em;
}

#sidebarOptions a {
	margin:17px;
	display:block;
	margin:0.5em 0em;
	padding:0.3em 0.6em;
}

.popup li a {
	margin:0px;
	padding:0px;
	display:inline;
	color:black;
}

.popup {
	background-color:white;
	border:1px solid purple;
}

.popup li a:hover {
	display:inline;
	margin:0px;
	padding:0px;
	background-color:white;
	color:purple;
}

.popup li {
	margin:0px;
	padding:5px;
	background-color:#eee;
}
.popup li:hover {
	background-color:white;
}

#tiddlerDisplay .toolbar a.button, #sidebarOptions a, .toolbar .popup li a, #mainMenu a, .tiddler .button, #sidebarOptions .sliderPanel input {
	border:1px solid white;
	background-color:white;
	color:purple;
}

#tiddlerDisplay .toolbar a.button:hover, #sidebarOptions a:hover,  #mainMenu a:hover, .tiddler .button, #sidebarOptions .sliderPanel input:hover
{
	border:1px solid #ccc;
}

#sidebarOptions a:hover {
border-right:1px solid white;
}

.tagged ul {
	list-style: none;
}

.tagged li {
	display: inline;
}

.zoomer {
	background:none; color:#ddd;
	border:2px solid #ddd;
}

a:active{
	border:1px solid red;
	background-color:#eee;
	color:[[ColorPalette::smmLight1]]
}

a:hover {
	background-color:#eee;
	color:[[ColorPalette::smmLight1]]
}

#backstageArea,#backstageArea a {
	background:transparent;
	color:white;
}

#mainMenu a {
	padding:8px 15px 8px 15px;
	margin:10px;
	line-height:40px;
	border:1px solid #eee;
}

#contentWrapper #mainMenu{
	position:static;
	width:100%;
	float:left;
	text-align:left;
	padding-top:20px;
}

.editor textarea, .editor input, input, body select {
	border:1px solid #ccc;
	background-color:white;
	color:#999;
	padding:3px;
	margin:3px;
}

#sidebarOptions input {
	width:85%;
	margin-left:-0.1em;}

#sidebarTabs {
	margin:0px;
	padding:0px
}

#sidebarTabs .tabContents {
	color:[[ColorPalette::smmLight1]];
	background:#999;
}

#contentWrapper .tiddler .button {
margin:0.4em;
padding:0.4em 0.8em;
}

#sideBarOptions .searchButton{
	display:none;
}

#sidebar .sliderPanel {
	margin-left:5px;
	border:0px;
	padding:0em;
	border-right:1px solid #eee;
	margin-bottom:0.8em;
}

#sidebarOptions .searchButton {
	display:none;
}

.title {
	color:#C0C0C0;
}

.subtitle, .subtitle a {
	color: #999;
	font-size: 1em;margin:0.2em;
	font-variant: small-caps;
}

* html .viewer pre {
	margin-left: 0em;
}

* html .editor textarea, * html .editor input {
	width: 98%;
}

a,#sidebarOptions .sliderPanel a, #topMenu a, #topMenu .button {
	color:purple;
	background-color:transparent;
}

#sidebarOptions .sliderPanel a:hover, #topMenu a, #topMenu .button:hover {
	color:black;
	background-color:transparent;
	border:0px;
}

 
#topMenu a, #topMenu .button {
	padding: 5px 15px;
	margin:9px;
	border:1px solid #999;
	font-weight:bold;
	line-height:40px;
	top:1em;
	color:[[ColorPalette::smmLight1]];
	background-color:#eee;
}

#topMenu br {
	display:none;
}

#topMenu a:hover, #topMenu .button:hover {
	background-color:#eee;
}

.tagging, .tagged {
	border: 0px dotted [[ColorPalette::smmLight1]];
}

.highlight, .marked {
	background:transparent;
	color:#999;
	border:none;
	text-decoration:underline;
}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
	border: none;
	background:transparent;
	text-decoration:underline;
	color:#eee;
}

.viewer th, thead td {
	background: #eee;
	border:none;
	color: #fff;
}

.viewer table {
	border:1px solid #eee;
}

table.twtable {
	border-collapse:seperate;
}

.viewer pre {
	background-color:white;
	border: 1px dotted #999;
}

hr {
	border: dotted 1px #ccc;
}

#sidebarOptions .sliderPanel .tabUnselected {
	background:#eee none repeat scroll 0%;
	border:0px solid #999;
	color:#999;
}

.tabSelected, #sidebarOptions .sliderPanel .tabSelected {
	background:white none repeat scroll 0%;
	border:1px solid #ddd;
	border-bottom:1px solid white;
	color:#999;
}

.tabContents {
	background:#f7f7f7;
	border:0px;
}

.viewer code {
	background:##eee none repeat scroll 0%;
	color:#999;
}

h1,h2,h3,h4,h5 {
	color: #555; 
	border-color:#333; 
	background: transparent; 
	padding-bottom:2px; 
	font-family: Arial, Helvetica, sans-serif;
}

h1 {
	font-size:18px;
}

h2 {
	font-size:16px;
	border-bottom:1px solid #FFF;
}

h3 {
	font-size: 14px;
	border-bottom:1px solid #FFF;
}

.annotation {
	background-color:purple;
	border:1px solid white;
	color:white;
}

#contentFooter {
	background:#999;
	clear: both;
	padding: 0.5em 1em;
}

.button, .wizard .button:hover {
	border:0px;
}

.sliderPanel input  {
	border:1px solid #777;
	background-color:white;
	color:#777;	
}

#contentWrapper .tiddler .button:hover {
	border:1px solid;
}

table, .viewer td, .viewer tr, .twtable td, .twtable tr {
	border:0px solid #666666;
}

body .wizardFooter {
	margin:0px;
	padding-top:0px;
	background:white;
	font-weight:bold;
	padding-left:10em;
}

.wizardStep {
	padding:0px;
	border:none;
	background-color:none;
} 
	
.wizard  th{
	background:white;
	color:#888;
	padding:3px;
	margin:40px;
};

.wizard, listView twtable {
	border:0px; 
};

.wizard {
	color:#292929;
}

.viewer .wizard, body .wizard{
	background:white;
	margin:2em;
	border:1px solid #CCCCCC;
	color:#999;
}

.wizard h1 {
	color:#999;
	padding-top:10px;
	padding-bottom:10px;
}

.wizard h2 {
	color:black;
}

body .wizardStep {
	color:#999;
	border:0px;
	margin:0m;
	background:white;	
}

body select {
	border:0px;
	padding:3px;
	margin:4px;
}

#backstageArea a:hover {
	background-color:white;
}

#backstagePanel {
	background:none;
	width:60%;
	position:fixed
	padding:0px;
	margin:0px;
	margin-top:-36px;
}

#backstageToolbar a.backstageSelTab {
	background-color:white;
	border:1px solid white;
}

#sidebar .sliderPanel {
	background-color:#eee;
	font-size:1em;
}

.viewer .wizardStep table {
	border:0px;
}

.viewer th, .viewer td, .viewer tr, .viewer caption, .twtable th, .twtable td, .twtable tr, .twtable caption {
	border:0px;
	padding:0px;
	margin:0px;
}

.viewer .sortable td {
	padding:12px;
	margin:21px;
}

.title {
	color:#777;
	padding:0px;
}

.viewer table, table.twtable {
	border-collapse:seperated;
	border:0px;
}

.viewer th, .viewer thead td, .twtable th, .twtable thead td {
	border:0px;
	background-color:white;
	color:black;
}

.twtable th{
	background-color:#eee;
	padding:15px;
	margin:15px;
}

table.sortable td.sortedCol {
	background-color:white;
}
/*}}}*/

[[StyleSheet]]
<html>1)
Go to the 'Align' page<br />2) Focus the beam (using the
intensity button)<br />3) Use magnification of around
10000x<br />4) Try to minimize the movement using multifunction X
and Y</html>
/*{{{*/
body {
	font-size: 1em;
	font-family: helvetica, arial, sans-serif;
	background-color: #fff;
	color: [[ColorPalette::Foreground]];
}

body ul { margin: 0; }

#popup {
	background-color: [[ColorPalette::TertiaryPale]];
}

#popup.confirmationPopup, .followList {
	font-size: 0.8em;
	padding: 1em;
	border: solid 1px [[ColorPalette::SecondaryMid]];
	background-color: [[ColorPalette::SecondaryPale]];
}

.followList .listTitle {
	text-decoration: underline;
}

#popup .followTiddlersList a {
	display: inline;
	padding: 0;
}

.viewer td { vertical-align: top; }

.borderless table,
.borderless th,
.borderless tr,
.borderless td
   { border:0 }

#popup li a {
	color: #fff;
	font-weight: bold;
}

#popup li a:hover {
	color: #fff;
	background: [[ColorPalette::PrimaryMid]];
}

#popup li.listTitle {
	border-bottom: 1px solid #000;
	font-weight: bold;
	margin-bottom: 10px;
}

#displayArea {
	margin: 0;
	top: 0px;
	left: 0px;
	width: 100%;
	position: relative;
}

.public {
	border-color: #C7EAFF;
}

.private {
	border-color: #FFCAE9;
}

/* *** Header *** */

.headerFix{
	background: [[ColorPalette::PrimaryMid]];
	_width: 100%; /* for ie 6 */
}
.header{
	color: #fff;
	background: [[ColorPalette::PrimaryMid]];
	overflow: hidden;
	_width: 100%; /* for ie 6 */
}

.clearFloat {
	clear: both;
}
#jsMath_Warning {display: none}

#contentWrapper {
	position: relative;
	padding-top: 1px;
	top: -1px;
}

#tiddlerDisplay {
	_position: relative; /* ie 6*/
}

.siteTitle {
	display: block;
	font-size: 28px;
	height: 32px;
	font-weight: bold;
	line-height: 32px;
}

#sidebarSearch {
        float: right;
	right: 80px;
	top: 8px;
	width: 176px;
}

#sidebarSearch .txtOptionInput {
	width: 100%;
	margin-top: 5px;
	_color: #bbb; /* ie6 danger */
}

#sidebarSearch .txtOptionInput:focus {
	color: #000;
}

#sidebarSearch .searchButton {
	display: none;
}

/* *** Menu Bar *** */

#mainMenu {
	position: static;
	text-align: left;
	margin-left: 30px;
	float: left;
	width: auto;
	padding: 0;
	font-size: 1em;
	line-height: normal;
}

#sidebarOptions {
	margin-right: 30px;
	float: right;
	font-size: 1.1em;
	line-height: 1.6em;
	min-height: 1em;
	padding-top: 0;
}

#sidebarOptions a {
	margin-right: 8px;
}

#mainMenu a:hover {
	background-color: [[ColorPalette::PrimaryMid]];
	color: [[ColorPalette::Background]]
}

.confirmationPopup .button,
#sidebarOptions .button {
	cursor: pointer;
	line-height: 1.4em;
	text-align: center;
	margin-right: 8px;
	margin-left:-2px;
}

.confirmationPopup .button {
	font-size: 0.9em;
	padding: 2px;
}

#sidebarOptions .button {
	font-size: 0.7em;
	float: left;
	width: 80px;
	padding: 0px;
}

.confirmationPopup a.button,
#sidebarOptions a {
	border: none;
	margin: 0 0.2em;
	padding: 0.6em 0.25em;
	display: inline;
	color: #666;
}

.confirmationPopup a.button:hover,
#sidebarOptions a:hover {
	color: #000;
}

.confirmationPopup a.button:active,
#sidebarOptions a:active {
	border: solid 1px [[ColorPalette::PrimaryMid]];
	background-color: #fff;
	background: -webkit-gradient( linear, left bottom, left top, color-stop(0.1,rgb(200,200,200)), color-stop(1, rgb(100,100,100)));
	background: -moz-linear-gradient(center bottom , rgb(200,200,200) 10%,rgb(100,100,100) 100%) repeat scroll 0 0 transparent;
}
/* *** Sidebar *** */

#sidebar .wizard table {
	margin: 0px;
}

.tabContents .listTitle:first-child {
	margin-top: 0px;
}

/*******************/
/* --- New CSS --- */
/*******************/

#menuBar {
	background: [[ColorPalette::PrimaryLight]];
	left: 0;
	right: 0;
	position: relative;
	margin: 0;
	padding: 0.5em 0 0.5em 0;
	min-height: 1em;
	overflow: hidden;
	_width: 100%; /* for ie 6 */
}


#menuBarOptions {
	background: [[ColorPalette::PrimaryPale]];
	left: 0;
	right: 0;
	position: relative;
	margin: 0;
	overflow: hidden;
	_width: 100%; /* for ie 6 */
}


#mainMenu a {
	color: #fff;
	padding: 8px;T
	font-size: 0.9em;
	margin-right: 16px;
}

#sidebarOptions a.button {
	color: #fff;
}

#sidebarOptions a.button:hover {
	color: [[ColorPalette::PrimaryPale]];
    background: [[ColorPalette::PrimaryMid]];
}

#tiddlerDisplay, #searchResults {
	margin: 16px 260px 0 40px;
}

#sidebarTabs {
	font-size: 0.7em;
	position: absolute;
	right: 22px;
	width: 208px;
	top: 0;
	font-size: 0.7em;
}

#sidebarTabs .tabsetWrapper .tabset {
	font-size: 0.7em;
	border-top: 1px solid [[ColorPalette::PrimaryPale]];
	border-left: 1px solid [[ColorPalette::PrimaryPale]];
	border-bottom: 1px solid [[ColorPalette::PrimaryPale]];
	height: auto;
	float: left;
	word-wrap: break-word;
	top: 0;
	padding: 0;
}

#sidebarTabs .tabsetWrapper .tabContents {
	font-size: 0.7em;
	background-color: [[ColorPalette::PrimaryPale]];
	border: 3px solid [[ColorPalette::PrimaryMid]];
	width: 160px;
	_width: 156px;
	left: -3px;
	_left: -5px;
	position: relative;
	min-height: 34em;
	padding: 8px;
}

/* ---- Side style --- */

#sidebarTabs .tabsetWrapper .tabset .tab {
	font-size: 0.7em;
	padding: 0.7em 8px 0.5em;
	color: #fff;
	background: [[ColorPalette::PrimaryLight]];
	border: none;
	line-height: 16px;
	position: relative;
	display: block;
	margin: 0;
}

#sidebarTabs .tabsetWrapper .tabset .tabSelected {
	font-size: 0.7em;
	color: [[ColorPalette::PrimaryMid]];
	background: [[ColorPalette::PrimaryPale]];
	border-top: 3px solid [[ColorPalette::PrimaryMid]];
	border-bottom: 3px solid [[ColorPalette::PrimaryMid]];
	border-left: 3px solid [[ColorPalette::PrimaryMid]];
	z-index: 10;
	margin-top: -1px;
	font-weight: bold;
	font-size: 0.4em;
}

#sidebarTabs .tabContents li {
	font-size: 1 em;
	border: none;
	margin-left: 0;
	word-wrap: break-word;
}

.tabContents .timeline {
	font-size: 1em;
	background: [[ColorPalette::PrimaryPale]];
	margin-bottom: 8px;
}

#sidebarTabs .timeline li.listTitle {
	font-size: 1em;
	color: #132E43;
	margin-left: 8px 0;
	padding: 0.3em 0.11em;
	border-bottom: none;
}

#sidebarTabs .tabContents li a {
	font-size: 0.7em;
	display: block;
	text-align: left;
	margin: 0 0 1px 0;
	padding: 0.3em 1em;
	background: [[ColorPalette::PrimaryPale]];
}

#sidebarTabs .tabsetWrapper .tabset a:hover,
#sidebarTabs .tabContents li a:hover {
	color: [[ColorPalette::PrimaryPale]];
	background: [[ColorPalette::PrimaryMid]];
}

/* Activity Stream */
#sidebarTabs .tabContents .activityStream .feedItem a {
	display: inline-block;
	padding: 0;
	background: none;
}

/* ---- Tagging box --- */
.tagInfo {
	border: 1px solid #cccccc;
	padding: 10px 15px;
	-moz-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
	box-shadow: 0 2px 2px rgba(0,0,0,0.2);
	color: [[ColorPalette::TertiaryMid]];
	background: -moz-linear-gradient(100% 100% 90deg, #f4f4f4, #e5e5e5);
	background: -webkit-gradient(linear, left top, right top, from(#e5e5e5), to(#f4f4f4));
	margin-top: 1em;
	font-size: 13px;
	margin: 0 0 0 56px;
}

.tagInfo ul {
	list-style: none;
	padding-left: 2.2em;
}

.tagInfo ul li {
	display: inline;
}

.tagInfo ul li.listTitle,
.tagInfo .tagging ul li.listTitle {
	color: [[ColorPalette::PrimaryMid]];
	font-size: 13px;
}

.tagInfo ul li a {
	border: none;
}

.tagInfo .tagging ul li {
	float: none;
	display: inline-block;
}

.tagInfo .tagging {
	padding: 0;
}

.viewRevision .toolbar {
	right: 48px;
	top: 8px;
}

.viewRevision .modifierIcon img,
.viewRevision .modifierIcon svg {
	margin-right: 8px;
}

.viewRevision .toolbar svg {
	width: 32px;
	height: 32px;
}

/* --- IE hacks from lattice --- */

/* ie hacks */
* html #menuBar {
	margin-bottom: 8px;
}
.toolbar .svgIconText {
	*display: inline;
}

div.tiddler .toolbar a {
	float: left\9;
	display: inline\9;
}

* html .toolbar {
	right: 8px;
}
* html .followButton a {
	margin-top: 0px;
	margin-right: 8px;
}
* html #tiddlerDisplay {
	margin-top: 0px;
}
/* for printing purposes */
@media print {
	#mainMenu,
	#sidebar,
	#messageArea,
	.toolbar,
	.followPlaceHolder,
	#backstageButton,
	#backstageArea,
	#sidebarTabs,
	#sidebarSearch .txtOptionInput,
	#sidebarOptions {
		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 */
	}
	#tiddlerDisplay {
		margin: 16px 16px;
	}
}

@media all and (max-width: 960px){
	#tiddlerDisplay,
	#searchResults {
		margin: 16px 300px 0 16px;
	}

	#mainMenu {
		margin-left: 16px;
	}

	.headerForeground {
		margin-left: 16px;
	}

	#sidebarSearch {
		right: 16px;
	}

	#sidebarOptions {
		margin-right: 16px;
	}

	#sidebarTabs .tabsetWrapper .tabset {
		font-size: 0.5em;
		width: 57px;
	}

	#sidebarTabs .tabsetWrapper .tabContents {
		width: 160px;
		_width: 156px;
		font-size: 0.5em;
	}

	#sidebarTabs .tabContents li a {
		font-size: 0.5em;
	}
}

/*}}}*/
[[StyleSheetTiddler]]
!URL
http://www.imaging-git.com/news/super-resolution-imaging-researchers-produce-primer-guide-use-storm

!Description
Though it was quickly adopted by the scientific community, Professor of Chemistry and Chemical Biology and of Physics Xiaowei Zhuang worried that researchers using the system of technology of super-resolution, stochastic optical reconstruction microscopy (STORM) she developed were not producing high-quality images because they were not using the technology properly
!URL
http://www.microscopy-news.com/news/intelligent-microscopy---embl-software-runs-experiments-on-its-own.html

!Description
The sight of a researcher sitting at a microscope for hours, painstakingly searching for the right cells, may soon be a thing of the past, thanks to new software created by scientists at the European Molecular Biology Laboratory (EMBL) in Heidelberg, Germany. Presented today in Nature Methods, the novel computer programme can rapidly learn what the scientist is looking for and then takes over this laborious and time-consuming task, automatically performing complex microscopy experiments when it detects cells with interesting features.

Called Micropilot, the software brings machine learning to microscopy. It analyses low-resolution images taken by a microscope and, once it has identified a cell or structure the scientists are interested in, it automatically instructs the microscope to start the experiment. This can be as simple as recording high-resolution time-lapse videos or as complex as using lasers to interfere with fluorescently tagged proteins and recording the results.

The sof
!URL
http://www.sciencedaily.com/releases/2011/01/110116144443.htm

!Description
In a technique that could eventually shed light on how gene expression influences human disease, scientists at Albert Einstein College of Medicine of Yeshiva University have for the first time ever successfully visualized single molecules of naturally-occurring messenger RNA (mRNA) transcribed in living mammalian cells.
!URL
http://www.nanowerk.com/news/newsid=23769.php

!Description
(Nanowerk News) Carl Zeiss Microscopy, a company of the Carl Zeiss Group and leading provider of light, laser-scanning and electron and ion beam microscopes, today announced the celebration of its tenth anniversary of the AURIGA© CrossBeam© FIB-SEM technology.
!URL
http://www.microscopy-news.com/news/applied-precision-scientific-team-to-present-3d-sim-paper-at-bios-in-san-francisco.html

!Description
plied Precision is pleased to announce that Paul Goodwin, director of advanced applications, and William Dougherty, senior scientist, have been chosen to present a paper on Three-Dimensional Structured Illumination Microscopy at BiOS SPIE Photonics West.

Three-dimensional structured illumination (3D-SIM) is a super-resolution imaging technique that doubles the lateral and axial resolution, providing an eight-fold improvement in volumetric resolution compared to standard microscopy systems. This revolutionary gain in resolution allows researchers to see biological structures with greater detail and clarity than previously possible
!URL
http://www.cellularimaging.com/products/volocity/

!Description
<<QuickTimeFragment "/static/files/Microscopy/2008.04.02-mse640-l12-part2.mp4">>

/static/files/Microscopy/2008.04.02-mse640-l12-part2.pdf
Orignally copied material from: http://nanohub.org/resources/4092
<html>For
a square image of size NxN the two dimensional DFT is given by:
<br
/><br /><font size="4"><span
class="AM">`F(k,l)=1/(N^2)sum_(i=0)^(N-1)sum_(j=0)^(N-1)f(i,j)e^(-i2pi((ki)/N
+ (ij)/N)`</span><span class="AM"></span><span
class="AM">``</span> <br /><br /><font
size="2">where <span class="AM" style="font-style:
italic;">`f(i,j)`</span> = <span
class="AM"></span>is the image in the [[spatial domain]] and
the exponential term is the basic function corresponding for each point
<span style="font-style: italic;">F(k,l)</span> in the
Fourier space. The equatation can be interpreted as: the value of each
point <span style="font-style: italic;">F(k,l)</span> is
obtained by multiplying the spatial image with the corresponding base
function and summing the result.<br /><br
/></font></font><p>The picture below shows 2
images with their Fourier Transforms directly underneath. The images
are a pure horizontal cosine of 8 cycles and a pure vertical cosine of
32 cycles. Notice that the FT for each just has a single component,
represented by 2 bright spots symmetrically placed about the enter of
the FT image. The center of the image is the origin of the frequency
coordinate system. The u-axis runs left to right through the center and
represents the horizontal component of frequency. The v-axis runs
bottom to top through the center and represents the vertical component
of frequency. In both cases there is a dot at the center that

represents the (0,0) frequency term or average value of the image.
Images usually have a large average value (like 128) and lots of low
frequency information so FT images usually have a bright blob of
components near the center. Notice that high frequencies in the
vertical direction will cause bright dots away from the center in the
vertical direction. And that high frequencies in the horizontal
direction will cause bright dots away from the center in the horizontal
direction. </p><font size="4"><font size="2"><br
/><img src="http://www.cs.unm.edu/%7Ebrayer/vision/cosines.gif"
/><br /><br /><br /></font></font>Here
are 2 images of more general Fourier components. They are images of 2D
cosines with both horizontal and vertical components. The one on the
left has 4 cycles horizontally and 16 cycles vertically. The one on the
right has 32 cycles horizontally and 2 cycles vertically. (Note: You
see a gray band when the function goes through gray = 128 which happens
twice/cycle.) You may begin to notice there is a lot of symmetry. For
all REAL (as opposed to IMAGINARY or COMPLEX) images, the FT is
symmetrical about the origin so the 1st and 3rd quadrants are the same
and the 2nd and 4th quadrants are the same. If the image is symmetrical
about the x-axis (as the cosine images are) 4-fold symmetry
results.<br /><font size="4"><font size="2"><img
src="http://www.cs.unm.edu/%7Ebrayer/vision/basis.gif" /><br
/><br />Sources:<br
/>http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm<br
/>http://www.cs.unm.edu/~brayer/vision/fourier.html<br
/>http://research.stowers-institute.org/efg/Report/FourierAnalysis.pdf<br
/><br /></font></font></html>
<<QuickTimeFragment "/static/files/Microscopy/2008.04.02-mse640-l12-part2.mp4">>

/static/files/Microscopy/2008.04.02-mse640-l12-part2.pdf
Orignally copied material from: http://nanohub.org/resources/4092
!URL
http://picoquant.com/

!Description
PicoQuant GmbH is a research and development company in the field of optoelectronics. The company was founded in 1996 and is based in the science and technology park Berlin-Adlershof, Germany. The company is a worldwide leader in the field of single photon countingapplications. The product line includes pulsed diode lasers and LEDs, photon counting instrumentation, fluorescence lifetime spectrometers and time-resolved confocal microscopes. PicoQuant employs currently around 50 people. Since April 2008 Sales and Support in NorthAmerica is handled by PicoQuant Photonics North America Inc.
{{{
config.macros.QuickTimeFragment = {
  handler: function (place, macroName, params, wikifier, paramString, tiddler)
  {
     var movie;

     if (params[0] != null)
     {
           movie = params[0];
     }

     resultString = '<html>';
     resultString += '<table border="0" cellpadding="0" align="left">';
     resultString += '<tr><td>';

     resultString += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="425" height="344" codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
     resultString += '<param name="src" value="';
     resultString += movie;
     resultString += '">';

     resultString += '</param><param name="autoplay" value="false">';
     resultString += '</param><param name="controller" value="true">';
     resultString += '</param><param name="loop" value="false">';

     resultString += '</param><embed src="';
     resultString += movie;
     resultString += '"allowfullscreen="true" autoplay="false" width="425" height="344">';
     resultString += ' </embed></object> ';
     resultString += '</tr></td>';
     resultString += '</table>';
     resultString += '</html>';

     wikify(resultString,place);
   }
 }
}}}
!URL
http://developer.imagej.net/

!Description
ImageJDev is a federally funded, multi-institution project to develop the next-generation version of ImageJ, an image processing program widely used for scientific research. We wish to strengthen both the ImageJ software itself and its community by pursuing a unified vision of ImageJ and associated community resources, including this website, code and plugin repositories, and user and developer documentation.
<html><p>The
<em>spatial domain</em> is the normal image space, in which
a change in position in I directly projects to a change in position in
S. Distances in I (in pixels) correspond to real distances
(<em>e.g.</em> in meters) in S.</p><p>This
concept is used most often when discussing the frequency with which
image values change, that is, over how many pixels does a cycle of
periodically repeating intensity variations occur. One would refer to
the number of pixels over which a pattern repeats (its periodicity) in
the spatial domain. </p><p>In most cases, the <a
href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm">Fourier
Transform</a> will be used to convert images from the spatial
domain into the<a
href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/freqdom.htm">frequency
domain</a>.
</p><p>
A related term used in this
context is [[<em>spatial frequency</em>]], which refers to
the (inverse of the) periodicity with which the image intensity values
change. Image features with high spatial frequency (such as edges) are
those that change greatly in intensity over short image distances.
</p><p>Another term used in this context is
<em>[[spatial derivative</em>]], which refers to how much
the image intensity values change per change in image position.
</p></html>
!URL
http://www2.mrc-lmb.cam.ac.uk/image2000.html

!Description
!URL
http://imagej.nih.gov/ij/plugins/image5d.html

!Description
These plugins extend image stacks to 5 dimensions: x, y, channel (color), slice (z), frame (t). Unlike the HyperVolume Browser, an Image5D has a "true" 5D format. That way plugins working on stacks should usually work as expected on the currently displayed stack of an Image5D (just try a z-projection to see what this means). Image5Ds are displayed in a window with two scrollbars for slice and time below the image and a panel with controls to change the current channel and its color to the right of the image. A dropdown menu allows to change the display of the channels. Options are one channel in gray, one channel in color and an overlay of selected channels.
!URL
http://emlab.rose2.brandeis.edu/frealign

!Description
Frealign is a program for high-resolution refinement of 3D reconstructions from cryo-EM images of single particles
[Img[http://www.microscopy.ethz.ch/images/drei-fenster.jpg]]

Only
the electrons passing through the selected energy slit contribute to
these
images.

[Img[http://www.microscopy.ethz.ch/images/VOx-dreifenster.jpg]]

In
the case of the three-window method

1) one window is positioned at
the region of the edge onset of the element in question
2) The two
other windows are positioned at energies below the edge
onset.

Images acquired at these two windows are used to calculate
the background image, this means, the background contribution to the
image recorded at the edge onset. Subtraction of the former from the
latter produces the elemental distribution map. The three-window method
may be applied when the spectral region below the edge is not distorted
by the presence of other elements thus allowing a good background
fitting.
!URL
http://newscenter.lbl.gov/feature-stories/2012/03/23/a-shiny-new-tool-for-imaging-biomolecules/

!Description
Researchers with the U.S. Department of Energy (DOE)’s Lawrence Berkeley National Laboratory (Berkeley Lab) and the University of California (UC) Berkeley, have developed the first practical application of optical nanoantennas in cell membrane biology. A scientific team led by chemist Jay Groves has developed a technique for lacing artificial lipid membranes with billions of gold “bowtie” nanoantennas. Through the phenomenon known as “plasmonics,” these nanoantennas can boost the intensity of a fluorescent or Raman optical signal from a protein passing through a plasmonic “hot-spot” tens of thousands of times without the protein ever being touched.
1) Go to diffraction mode
2) Press the 'eucentric focus' knob
3) Focus the pattern using the intensity knob
!URL
http://www.farsight-toolkit.org/wiki/Main_Page

!Description
http://www.gatan.com/analysis/gif_2001.php
!URL
http://www.git-labor.de/produkte/mikroskopie-imaging/n-storm-mikroskope-verbessern-die-aufloesung-um-den-faktor-10x

!Description
Nikon nutzt N-STORM Technologie der Harvard University - exklusives Abkommen
N-STORM Mikroskope verbessern die Auflösung um den Faktor 10
21.12.2010
N-STORM überwindet die Barriere des Lichts: Das Bild zeigt konventionelle und STORM-Aufnahmen von Mitochondrien einer Säugetierzelle im Vergleich (Membranprotein Tom20 wurde gelabeled). Bild: Zhuang Research Group, Department of Chemistry and Chemical Biology, Harvard University, Cambridge, MA.
N-STORM überwindet die Barriere des Lichts: Das Bild zeigt konventionelle und STORM-Aufnahmen von ... Weiter
N-STORM überwindet die Barriere des Lichts: Das Bild zeigt konventionelle und STORM-Aufnahmen von ... Nikon N-STORM steht für ultra-hochauflösende Fluoreszenzmikroskopie mit einem Auflösungsvermögen ... 

Nikon nutzt die N-STORM Technologie der Harvard University und hat dazu ein Abkommen mit der Universität unterzeichnet, das Nikon die exklusive Nutzung der sogenannten Stochastic Optical Reconstruction Microscopy (STORM) Technologie für die
<!--{{{-->
<div class='toolbar'
	macro='toolbar [[ToolbarCommands::ViewToolbar]] icons:yes height:16 width:16 more:popup'>
</div>
<div class='heading'>
	<span class='spaceSiteIcon'
		macro='tiddlerOrigin label:no spaceLink:yes height:48 width:48 preserveAspectRatio:yes'>
	</span>
	<span class="titleBar">
		<div class='title' macro='view title text'></div>
		<span class="subtitle" macro='viewRevisions page:5'>
			last modified on
			<span macro="view modified date"></span>
		</span>
	</span>
	<div class='tagClear'></div>
</div>
<div class='content'>
	<div class='viewer' macro='view text wikified'></div>
</div>
<div class='tagInfo'>
	<div class='tidTags' macro='tags'></div>
	<div class='tagging' macro='tagging'></div>
        <div class='counted' macro='BBClonePlugin'></div>
</div>
<!--}}}-->
[[About]] [[Books]] [[Terms]] [[Audio]] [[Video]] [[Bookmarks]]
!URL
http://www.microscopy-news.com/news/microwave-guiding-of-electrons.html

!Description
However, being extremely small and quick, electrons are difficult to control. Physicists around Dr. Peter Hommelhoff, head of the Max Planck Research Group “Ultrafast Quantum Optics” at the Max Planck Institute of Quantum Optics (Garching near Munich), have now demonstrated efficient guiding of slow electrons by applying a microwave voltage to electrodes fabricated on a planar substrate (Physical Review Letters, Advance online publication, 9 May 2011). This new technique of electron guiding – which resembles the guiding of light waves in optical fibres – promises a variety of applications, from guided matter-wave experiments to non-invasive electron microscopy
/***
|Name|Plugin: jsMath|
|Created by|BobMcElrath|
|Email|my first name at my last name dot org|
|Location|http://bob.mcelrath.org/tiddlyjsmath.html|
|Version|1.5.1|
|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] &ge; 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] &ge; 3.0|
!Description
LaTeX is the world standard for specifying, typesetting, and communicating mathematics among scientists, engineers, and mathematicians.  For more information about LaTeX itself, visit the [[LaTeX Project|http://www.latex-project.org/]].  This plugin typesets math using [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], which is an implementation of the TeX math rules and typesetting in javascript, for your browser.  Notice the small button in the lower right corner which opens its control panel.
!Installation
In addition to this plugin, you must also [[install jsMath|http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html]] on the same server as your TiddlyWiki html file.  If you're using TiddlyWiki without a web server, then the jsMath directory must be placed in the same location as the TiddlyWiki html file.

I also recommend modifying your StyleSheet use serif fonts that are slightly larger than normal, so that the math matches surrounding text, and \\small fonts are not unreadable (as in exponents and subscripts).a
{{{
.viewer {
  line-height: 125%;
  font-family: serif;
  font-size: 12pt;
}
}}}

If you had used a previous version of [[Plugin: jsMath]], it is no longer necessary to edit the main tiddlywiki.html file to add the jsMath <script> tag.  [[Plugin: jsMath]] now uses ajax to load jsMath.
!History
* 11-Nov-05, version 1.0, Initial release
* 22-Jan-06, version 1.1, updated for ~TW2.0, tested with jsMath 3.1, editing tiddlywiki.html by hand is no longer necessary.
* 24-Jan-06, version 1.2, fixes for Safari, Konqueror
* 27-Jan-06, version 1.3, improved error handling, detect if ajax was already defined (used by ZiddlyWiki)
* 12-Jul-06, version 1.4, fixed problem with not finding image fonts
* 26-Feb-07, version 1.5, fixed problem with Mozilla "unterminated character class".
* 27-Feb-07, version 1.5.1, Runs compatibly with TW 2.1.0+, by Bram Chen
!Examples
|!Source|!Output|h
|{{{The variable $x$ is real.}}}|The variable $x$ is real.|
|{{{The variable \(y\) is complex.}}}|The variable \(y\) is complex.|
|{{{This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.}}}|This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.|
|{{{This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.}}}|This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.|
|{{{Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation} }}}|Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation}|
|{{{Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} }}}|Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} |
|{{{I spent \$7.38 on lunch.}}}|I spent \$7.38 on lunch.|
|{{{I had to insert a backslash (\\) into my document}}}|I had to insert a backslash (\\) into my document|
!Code
***/
//{{{

// AJAX code adapted from http://timmorgan.org/mini
// This is already loaded by ziddlywiki...
if(typeof(window["ajax"]) == "undefined") {
  ajax = {
      x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},
      gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}
  }
}

// Load jsMath
jsMath = {
  Setup: {inited: 1},          // don't run jsMath.Setup.Body() yet
  Autoload: {root: '/static/jsMath/', showFontWarnings: 0}  // URL to jsMath directory, change if necessary
};
var jsMathstr;
try {
  jsMathstr = ajax.gets("/static/jsMath/jsMath.js");
} catch(e) {
  alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file.  "
       +"The error was:\n"+e.name+": "+e.message);
  throw(e);  // abort eval
}
try {
  window.eval(jsMathstr);
} catch(e) {
  alert("jsMath failed to load.  The error was:\n"+e.name + ": " + e.message + " on line " + e.lineNumber);
}
jsMath.Setup.inited=0;  //  allow jsMath.Setup.Body() to run again

// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
    var e = document.createElement(this.element);
    e.className = this.className;
    var endRegExp = new RegExp(this.terminator, "mg");
    endRegExp.lastIndex = w.matchStart+w.matchLength;
    var matched = endRegExp.exec(w.source);
    if(matched) {
        var txt = w.source.substr(w.matchStart+w.matchLength, 
            matched.index-w.matchStart-w.matchLength);
        if(this.keepdelim) {
          txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
        }
        e.appendChild(document.createTextNode(txt));
        w.output.appendChild(e);
        w.nextMatch = endRegExp.lastIndex;
    }
}

config.formatters.push({
  name: "displayMath1",
  match: "\\\$\\\$",
  terminator: "\\\$\\\$\\n?", // 2.0 compatability
  termRegExp: "\\\$\\\$\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

config.formatters.push({
  name: "inlineMath1",
  match: "\\\$", 
  terminator: "\\\$", // 2.0 compatability
  termRegExp: "\\\$",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

var backslashformatters = new Array(0);

backslashformatters.push({
  name: "inlineMath2",
  match: "\\\\\\\(",
  terminator: "\\\\\\\)", // 2.0 compatability
  termRegExp: "\\\\\\\)",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath2",
  match: "\\\\\\\[",
  terminator: "\\\\\\\]\\n?", // 2.0 compatability
  termRegExp: "\\\\\\\]\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath3",
  match: "\\\\begin\\{equation\\}",
  terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{equation\\}\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

// These can be nested.  e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
  name: "displayMath4",
  match: "\\\\begin\\{eqnarray\\}",
  terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{eqnarray\\}\\n?",
  element: "div",
  className: "math",
  keepdelim: true,
  handler: config.formatterHelpers.mathFormatHelper
});

// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
    name: "escape",
    match: "\\\\.",
    handler: function(w) {
        w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
        w.nextMatch = w.matchStart+2;
    }
});

config.formatters=backslashformatters.concat(config.formatters);

window.wikify = function(source,output,highlightRegExp,tiddler)
{
    if(source && source != "") {
        if(version.major == 2 && version.minor > 0) {
            var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
            wikifier.subWikifyUnterm(output);
        } else {
            var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
            wikifier.subWikify(output,null);
        }
        jsMath.Synchronize("jsMath.Font.HideMessage()") 
        jsMath.ProcessBeforeShowing();
    }
}
//}}}
!URL
http://www.nanowerk.com/news/newsid=19683.php

!Description
3-D map of atoms sheds light on nanoscale interfaces in teeth, may aid materials design
(Nanowerk News) Teeth and bone are important and complex structures in humans and other animals, but little is actually known about their chemical structure at the atomic scale. What exactly gives them their renowned toughness, hardness and strength? How do organisms control the synthesis of these advanced functional composites? Now, using a highly sophisticated atomic-scale imaging tool on a sea creature's tooth, two Northwestern University researchers have peeled away some of the mystery of organic/inorganic interfaces that are at the heart of tooth and bone structure. They are the first to produce a three-dimensional map of the location and identity of millions of individual atoms in the complex hybrid material that allows the animal to literally chew rock.
Demonstrating that atom-probe tomography (APT) can be used to interrogate such materials opens up the possibility of tracking fluoride in tee
{{{
//{{{
config.macros.PlotFunction = {
  handler: function (place, macroName, params, wikifier, paramString, tiddler)
  {
     var resultString;
     var wolframAlphaQuery;

     var xml;
     var width = '500';
     var height = '270';

     if (params[1] != null)
     {
           width = params[1];
     }

     if (params[2] != null)
     {
           height = params[2];
     }

     wolframAlphaQuery = '/query_wolfram/v1/query?input=';
     wolframAlphaQuery += params[0];
     wolframAlphaQuery += '&format=image&appid=beta824g5';
     var xmlDoc=document.implementation.createDocument("","",null);

     resultString = "<html>";
     resultString += '<iframe ';
     resultString += 'src="';
     resultString += QueryWolframAlpha(wolframAlphaQuery);
     resultString += '"';
     resultString += ' width=' + width;
     resultString += ' height=' + height;
     resultString +='">';
     resultString += '</iframe>';
     resultString += '</html>';

     wikify(resultString,place);
   }
 }

function QueryWolframAlpha(s)
{
     var xmlhttp=false;
     var resultString = "";
     var partialResultString  = "";
     var xmlDoc;

     try {
          xmlhttp = new XMLHttpRequest();
     } catch (e) {
          xmlhttp=false;
     }

     xmlhttp.open("GET",s,false);
     xmlhttp.send(null);
     if (xmlhttp.readyState==4) {
          xmlDoc = xmlhttp.responseXML;
          var xPathRes;
              xPathRes= xmlDoc.evaluate('/queryresult[@success="true"]/pod[@title="Plots"]/subpod[@title=""]/img/@src', xmlDoc, null, XPathResult.ANY_TYPE,null);
               if (xPathRes.resultType == 4)
               {
                    xPathRes = xPathRes.iterateNext();
                    partialResultString = xPathRes.value;
               }
     }
     return (partialResultString);
}

//}}}
}}}
@@Please do not modify this tiddler; it was created automatically upon space creation.@@
/***
|''Name:''|ForEachTiddlerPlugin|
|''Version:''|1.0.8 (2007-04-12)|
|''Source:''|http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]|
|''Copyright:''|&copy; 2005-2007 [[abego Software|http://www.abego-software.de]]|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
!Description

Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.

''Syntax:'' 
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and  {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and  {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]]  is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|

See details see [[ForEachTiddlerMacro]] and [[ForEachTiddlerExamples]].

!Revision history
* v1.0.8 (2007-04-12)
** Adapted to latest TiddlyWiki 2.2 Beta importTiddlyWiki API (introduced with changeset 2004). TiddlyWiki 2.2 Beta builds prior to changeset 2004 are no longer supported (but TiddlyWiki 2.1 and earlier, of cause)
* v1.0.7 (2007-03-28)
** Also support "pre" formatted TiddlyWikis (introduced with TW 2.2) (when using "in" clause to work on external tiddlers)
* v1.0.6 (2006-09-16)
** Context provides "viewerTiddler", i.e. the tiddler used to view the macro. Most times this is equal to the "inTiddler", but when using the "tiddler" macro both may be different.
** Support "begin", "end" and "none" expressions in "write" action
* v1.0.5 (2006-02-05)
** Pass tiddler containing the macro with wikify, context object also holds reference to tiddler containing the macro ("inTiddler"). Thanks to SimonBaird.
** Support Firefox 1.5.0.1
** Internal
*** Make "JSLint" conform
*** "Only install once"
* v1.0.4 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.3 (2005-12-22)
** Features: 
*** Write output to a file supports multi-byte environments (Thanks to Bram Chen) 
*** Provide API to access the forEachTiddler functionality directly through JavaScript (see getTiddlers and performMacro)
** Enhancements:
*** Improved error messages on InternetExplorer.
* v1.0.2 (2005-12-10)
** Features: 
*** context object also holds reference to store (TiddlyWiki)
** Fixed Bugs: 
*** ForEachTiddler 1.0.1 has broken support on win32 Opera 8.51 (Thanks to BrunoSabin for reporting)
* v1.0.1 (2005-12-08)
** Features: 
*** Access tiddlers stored in separated TiddlyWikis through the "in" option. I.e. you are no longer limited to only work on the "current TiddlyWiki".
*** Write output to an external file using the "toFile" option of the "write" action. With this option you may write your customized tiddler exports.
*** Use the "script" section to define "helper" JavaScript functions etc. to be used in the various JavaScript expressions (whereClause, sortClause, action arguments,...).
*** Access and store context information for the current forEachTiddler invocation (through the build-in "context" object) .
*** Improved script evaluation (for where/sort clause and write scripts).
* v1.0.0 (2005-11-20)
** initial version

!Code
***/
//{{{

	
//============================================================================
//============================================================================
//		   ForEachTiddlerPlugin
//============================================================================
//============================================================================

// Only install once
if (!version.extensions.ForEachTiddlerPlugin) {

if (!window.abego) window.abego = {};

version.extensions.ForEachTiddlerPlugin = {
	major: 1, minor: 0, revision: 8, 
	date: new Date(2007,3,12), 
	source: "http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin",
	licence: "[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",
	copyright: "Copyright (c) abego Software GmbH, 2005-2007 (www.abego-software.de)"
};

// For backward compatibility with TW 1.2.x
//
if (!TiddlyWiki.prototype.forEachTiddler) {
	TiddlyWiki.prototype.forEachTiddler = function(callback) {
		for(var t in this.tiddlers) {
			callback.call(this,t,this.tiddlers[t]);
		}
	};
}

//============================================================================
// forEachTiddler Macro
//============================================================================

version.extensions.forEachTiddler = {
	major: 1, minor: 0, revision: 8, date: new Date(2007,3,12), provider: "http://tiddlywiki.abego-software.de"};

// ---------------------------------------------------------------------------
// Configurations and constants 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler = {
	 // Standard Properties
	 label: "forEachTiddler",
	 prompt: "Perform actions on a (sorted) selection of tiddlers",

	 // actions
	 actions: {
		 addToList: {},
		 write: {}
	 }
};

// ---------------------------------------------------------------------------
//  The forEachTiddler Macro Handler 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler.getContainingTiddler = function(e) {
	while(e && !hasClass(e,"tiddler"))
		e = e.parentNode;
	var title = e ? e.getAttribute("tiddler") : null; 
	return title ? store.getTiddler(title) : null;
};

config.macros.forEachTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	// config.macros.forEachTiddler.traceMacroCall(place,macroName,params,wikifier,paramString,tiddler);

	if (!tiddler) tiddler = config.macros.forEachTiddler.getContainingTiddler(place);
	// --- Parsing ------------------------------------------

	var i = 0; // index running over the params
	// Parse the "in" clause
	var tiddlyWikiPath = undefined;
	if ((i < params.length) && params[i] == "in") {
		i++;
		if (i >= params.length) {
			this.handleError(place, "TiddlyWiki path expected behind 'in'.");
			return;
		}
		tiddlyWikiPath = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the where clause
	var whereClause ="true";
	if ((i < params.length) && params[i] == "where") {
		i++;
		whereClause = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the sort stuff
	var sortClause = null;
	var sortAscending = true; 
	if ((i < params.length) && params[i] == "sortBy") {
		i++;
		if (i >= params.length) {
			this.handleError(place, "sortClause missing behind 'sortBy'.");
			return;
		}
		sortClause = this.paramEncode(params[i]);
		i++;

		if ((i < params.length) && (params[i] == "ascending" || params[i] == "descending")) {
			 sortAscending = params[i] == "ascending";
			 i++;
		}
	}

	// Parse the script
	var scriptText = null;
	if ((i < params.length) && params[i] == "script") {
		i++;
		scriptText = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the action. 
	// When we are already at the end use the default action
	var actionName = "addToList";
	if (i < params.length) {
	   if (!config.macros.forEachTiddler.actions[params[i]]) {
			this.handleError(place, "Unknown action '"+params[i]+"'.");
			return;
		} else {
			actionName = params[i]; 
			i++;
		}
	} 
	
	// Get the action parameter
	// (the parsing is done inside the individual action implementation.)
	var actionParameter = params.slice(i);


	// --- Processing ------------------------------------------
	try {
		this.performMacro({
				place: place, 
				inTiddler: tiddler,
				whereClause: whereClause, 
				sortClause: sortClause, 
				sortAscending: sortAscending, 
				actionName: actionName, 
				actionParameter: actionParameter, 
				scriptText: scriptText, 
				tiddlyWikiPath: tiddlyWikiPath});

	} catch (e) {
		this.handleError(place, e);
	}
};

// Returns an object with properties "tiddlers" and "context".
// tiddlers holds the (sorted) tiddlers selected by the parameter,
// context the context of the execution of the macro.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlersAndContext = function(parameter) {

	var context = config.macros.forEachTiddler.createContext(parameter.place, parameter.whereClause, parameter.sortClause, parameter.sortAscending, parameter.actionName, parameter.actionParameter, parameter.scriptText, parameter.tiddlyWikiPath, parameter.inTiddler);

	var tiddlyWiki = parameter.tiddlyWikiPath ? this.loadTiddlyWiki(parameter.tiddlyWikiPath) : store;
	context["tiddlyWiki"] = tiddlyWiki;
	
	// Get the tiddlers, as defined by the whereClause
	var tiddlers = this.findTiddlers(parameter.whereClause, context, tiddlyWiki);
	context["tiddlers"] = tiddlers;

	// Sort the tiddlers, when sorting is required.
	if (parameter.sortClause) {
		this.sortTiddlers(tiddlers, parameter.sortClause, parameter.sortAscending, context);
	}

	return {tiddlers: tiddlers, context: context};
};

// Returns the (sorted) tiddlers selected by the parameter.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlers = function(parameter) {
	return this.getTiddlersAndContext(parameter).tiddlers;
};

// Performs the macros with the given parameter.
//
// @param parameter holds the parameter of the macro as separate properties.
//				  The following properties are supported:
//
//						place
//						whereClause
//						sortClause
//						sortAscending
//						actionName
//						actionParameter
//						scriptText
//						tiddlyWikiPath
//
//					All properties are optional. 
//					For most actions the place property must be defined.
//
config.macros.forEachTiddler.performMacro = function(parameter) {
	var tiddlersAndContext = this.getTiddlersAndContext(parameter);

	// Perform the action
	var actionName = parameter.actionName ? parameter.actionName : "addToList";
	var action = config.macros.forEachTiddler.actions[actionName];
	if (!action) {
		this.handleError(parameter.place, "Unknown action '"+actionName+"'.");
		return;
	}

	var actionHandler = action.handler;
	actionHandler(parameter.place, tiddlersAndContext.tiddlers, parameter.actionParameter, tiddlersAndContext.context);
};

// ---------------------------------------------------------------------------
//  The actions 
// ---------------------------------------------------------------------------

// Internal.
//
// --- The addToList Action -----------------------------------------------
//
config.macros.forEachTiddler.actions.addToList.handler = function(place, tiddlers, parameter, context) {
	// Parse the parameter
	var p = 0;

	// Check for extra parameters
	if (parameter.length > p) {
		config.macros.forEachTiddler.createExtraParameterErrorElement(place, "addToList", parameter, p);
		return;
	}

	// Perform the action.
	var list = document.createElement("ul");
	place.appendChild(list);
	for (var i = 0; i < tiddlers.length; i++) {
		var tiddler = tiddlers[i];
		var listItem = document.createElement("li");
		list.appendChild(listItem);
		createTiddlyLink(listItem, tiddler.title, true);
	}
};

abego.parseNamedParameter = function(name, parameter, i) {
	var beginExpression = null;
	if ((i < parameter.length) && parameter[i] == name) {
		i++;
		if (i >= parameter.length) {
			throw "Missing text behind '%0'".format([name]);
		}
		
		return config.macros.forEachTiddler.paramEncode(parameter[i]);
	}
	return null;
}

// Internal.
//
// --- The write Action ---------------------------------------------------
//
config.macros.forEachTiddler.actions.write.handler = function(place, tiddlers, parameter, context) {
	// Parse the parameter
	var p = 0;
	if (p >= parameter.length) {
		this.handleError(place, "Missing expression behind 'write'.");
		return;
	}

	var textExpression = config.macros.forEachTiddler.paramEncode(parameter[p]);
	p++;

	// Parse the "begin" option
	var beginExpression = abego.parseNamedParameter("begin", parameter, p);
	if (beginExpression !== null) 
		p += 2;
	var endExpression = abego.parseNamedParameter("end", parameter, p);
	if (endExpression !== null) 
		p += 2;
	var noneExpression = abego.parseNamedParameter("none", parameter, p);
	if (noneExpression !== null) 
		p += 2;

	// Parse the "toFile" option
	var filename = null;
	var lineSeparator = undefined;
	if ((p < parameter.length) && parameter[p] == "toFile") {
		p++;
		if (p >= parameter.length) {
			this.handleError(place, "Filename expected behind 'toFile' of 'write' action.");
			return;
		}
		
		filename = config.macros.forEachTiddler.getLocalPath(config.macros.forEachTiddler.paramEncode(parameter[p]));
		p++;
		if ((p < parameter.length) && parameter[p] == "withLineSeparator") {
			p++;
			if (p >= parameter.length) {
				this.handleError(place, "Line separator text expected behind 'withLineSeparator' of 'write' action.");
				return;
			}
			lineSeparator = config.macros.forEachTiddler.paramEncode(parameter[p]);
			p++;
		}
	}
	
	// Check for extra parameters
	if (parameter.length > p) {
		config.macros.forEachTiddler.createExtraParameterErrorElement(place, "write", parameter, p);
		return;
	}

	// Perform the action.
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(textExpression, context);
	var count = tiddlers.length;
	var text = "";
	if (count > 0 && beginExpression)
		text += config.macros.forEachTiddler.getEvalTiddlerFunction(beginExpression, context)(undefined, context, count, undefined);
	
	for (var i = 0; i < count; i++) {
		var tiddler = tiddlers[i];
		text += func(tiddler, context, count, i);
	}
	
	if (count > 0 && endExpression)
		text += config.macros.forEachTiddler.getEvalTiddlerFunction(endExpression, context)(undefined, context, count, undefined);

	if (count == 0 && noneExpression) 
		text += config.macros.forEachTiddler.getEvalTiddlerFunction(noneExpression, context)(undefined, context, count, undefined);
		

	if (filename) {
		if (lineSeparator !== undefined) {
			lineSeparator = lineSeparator.replace(/\\n/mg, "\n").replace(/\\r/mg, "\r");
			text = text.replace(/\n/mg,lineSeparator);
		}
		saveFile(filename, convertUnicodeToUTF8(text));
	} else {
		var wrapper = createTiddlyElement(place, "span");
		wikify(text, wrapper, null/* highlightRegExp */, context.inTiddler);
	}
};


// ---------------------------------------------------------------------------
//  Helpers
// ---------------------------------------------------------------------------

// Internal.
//
config.macros.forEachTiddler.createContext = function(placeParam, whereClauseParam, sortClauseParam, sortAscendingParam, actionNameParam, actionParameterParam, scriptText, tiddlyWikiPathParam, inTiddlerParam) {
	return {
		place : placeParam, 
		whereClause : whereClauseParam, 
		sortClause : sortClauseParam, 
		sortAscending : sortAscendingParam, 
		script : scriptText,
		actionName : actionNameParam, 
		actionParameter : actionParameterParam,
		tiddlyWikiPath : tiddlyWikiPathParam,
		inTiddler : inTiddlerParam, // the tiddler containing the <<forEachTiddler ...>> macro call.
		viewerTiddler : config.macros.forEachTiddler.getContainingTiddler(placeParam) // the tiddler showing the forEachTiddler result
	};
};

// Internal.
//
// Returns a TiddlyWiki with the tiddlers loaded from the TiddlyWiki of 
// the given path.
//
config.macros.forEachTiddler.loadTiddlyWiki = function(path, idPrefix) {
	if (!idPrefix) {
		idPrefix = "store";
	}
	var lenPrefix = idPrefix.length;
	
	// Read the content of the given file
	var content = loadFile(this.getLocalPath(path));
	if(content === null) {
		throw "TiddlyWiki '"+path+"' not found.";
	}
	
	var tiddlyWiki = new TiddlyWiki();

	// Starting with TW 2.2 there is a helper function to import the tiddlers
	if (tiddlyWiki.importTiddlyWiki) {
		if (!tiddlyWiki.importTiddlyWiki(content))
			throw "File '"+path+"' is not a TiddlyWiki.";
		tiddlyWiki.dirty = false;
		return tiddlyWiki;
	}
	
	// The legacy code, for TW < 2.2
	
	// Locate the storeArea div's
	var posOpeningDiv = content.indexOf(startSaveArea);
	var posClosingDiv = content.lastIndexOf(endSaveArea);
	if((posOpeningDiv == -1) || (posClosingDiv == -1)) {
		throw "File '"+path+"' is not a TiddlyWiki.";
	}
	var storageText = content.substr(posOpeningDiv + startSaveArea.length, posClosingDiv);
	
	// Create a "div" element that contains the storage text
	var myStorageDiv = document.createElement("div");
	myStorageDiv.innerHTML = storageText;
	myStorageDiv.normalize();
	
	// Create all tiddlers in a new TiddlyWiki
	// (following code is modified copy of TiddlyWiki.prototype.loadFromDiv)
	var store = myStorageDiv.childNodes;
	for(var t = 0; t < store.length; t++) {
		var e = store[t];
		var title = null;
		if(e.getAttribute)
			title = e.getAttribute("tiddler");
		if(!title && e.id && e.id.substr(0,lenPrefix) == idPrefix)
			title = e.id.substr(lenPrefix);
		if(title && title !== "") {
			var tiddler = tiddlyWiki.createTiddler(title);
			tiddler.loadFromDiv(e,title);
		}
	}
	tiddlyWiki.dirty = false;

	return tiddlyWiki;
};


	
// Internal.
//
// Returns a function that has a function body returning the given javaScriptExpression.
// The function has the parameters:
// 
//	 (tiddler, context, count, index)
//
config.macros.forEachTiddler.getEvalTiddlerFunction = function (javaScriptExpression, context) {
	var script = context["script"];
	var functionText = "var theFunction = function(tiddler, context, count, index) { return "+javaScriptExpression+"}";
	var fullText = (script ? script+";" : "")+functionText+";theFunction;";
	return eval(fullText);
};

// Internal.
//
config.macros.forEachTiddler.findTiddlers = function(whereClause, context, tiddlyWiki) {
	var result = [];
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(whereClause, context);
	tiddlyWiki.forEachTiddler(function(title,tiddler) {
		if (func(tiddler, context, undefined, undefined)) {
			result.push(tiddler);
		}
	});
	return result;
};

// Internal.
//
config.macros.forEachTiddler.createExtraParameterErrorElement = function(place, actionName, parameter, firstUnusedIndex) {
	var message = "Extra parameter behind '"+actionName+"':";
	for (var i = firstUnusedIndex; i < parameter.length; i++) {
		message += " "+parameter[i];
	}
	this.handleError(place, message);
};

// Internal.
//
config.macros.forEachTiddler.sortAscending = function(tiddlerA, tiddlerB) {
	var result = 
		(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
			? 0
			: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
			   ? -1 
			   : +1; 
	return result;
};

// Internal.
//
config.macros.forEachTiddler.sortDescending = function(tiddlerA, tiddlerB) {
	var result = 
		(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
			? 0
			: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
			   ? +1 
			   : -1; 
	return result;
};

// Internal.
//
config.macros.forEachTiddler.sortTiddlers = function(tiddlers, sortClause, ascending, context) {
	// To avoid evaluating the sortClause whenever two items are compared 
	// we pre-calculate the sortValue for every item in the array and store it in a 
	// temporary property ("forEachTiddlerSortValue") of the tiddlers.
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(sortClause, context);
	var count = tiddlers.length;
	var i;
	for (i = 0; i < count; i++) {
		var tiddler = tiddlers[i];
		tiddler.forEachTiddlerSortValue = func(tiddler,context, undefined, undefined);
	}

	// Do the sorting
	tiddlers.sort(ascending ? this.sortAscending : this.sortDescending);

	// Delete the temporary property that holds the sortValue.	
	for (i = 0; i < tiddlers.length; i++) {
		delete tiddlers[i].forEachTiddlerSortValue;
	}
};


// Internal.
//
config.macros.forEachTiddler.trace = function(message) {
	displayMessage(message);
};

// Internal.
//
config.macros.forEachTiddler.traceMacroCall = function(place,macroName,params) {
	var message ="<<"+macroName;
	for (var i = 0; i < params.length; i++) {
		message += " "+params[i];
	}
	message += ">>";
	displayMessage(message);
};


// Internal.
//
// Creates an element that holds an error message
// 
config.macros.forEachTiddler.createErrorElement = function(place, exception) {
	var message = (exception.description) ? exception.description : exception.toString();
	return createTiddlyElement(place,"span",null,"forEachTiddlerError","<<forEachTiddler ...>>: "+message);
};

// Internal.
//
// @param place [may be null]
//
config.macros.forEachTiddler.handleError = function(place, exception) {
	if (place) {
		this.createErrorElement(place, exception);
	} else {
		throw exception;
	}
};

// Internal.
//
// Encodes the given string.
//
// Replaces 
//	 "$))" to ">>"
//	 "$)" to ">"
//
config.macros.forEachTiddler.paramEncode = function(s) {
	var reGTGT = new RegExp("\\$\\)\\)","mg");
	var reGT = new RegExp("\\$\\)","mg");
	return s.replace(reGTGT, ">>").replace(reGT, ">");
};

// Internal.
//
// Returns the given original path (that is a file path, starting with "file:")
// as a path to a local file, in the systems native file format.
//
// Location information in the originalPath (i.e. the "#" and stuff following)
// is stripped.
// 
config.macros.forEachTiddler.getLocalPath = function(originalPath) {
	// Remove any location part of the URL
	var hashPos = originalPath.indexOf("#");
	if(hashPos != -1)
		originalPath = originalPath.substr(0,hashPos);
	// Convert to a native file format assuming
	// "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
	// "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
	// "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
	// "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
	var localPath;
	if(originalPath.charAt(9) == ":") // pc local file
		localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file://///") === 0) // FireFox pc network file
		localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file:///") === 0) // mac/unix local file
		localPath = unescape(originalPath.substr(7));
	else if(originalPath.indexOf("file:/") === 0) // mac/unix local file
		localPath = unescape(originalPath.substr(5));
	else // pc network file
		localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");	
	return localPath;
};

// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
	".forEachTiddlerError{color: #ffffff;background-color: #880000;}",
	"forEachTiddler");

//============================================================================
// End of forEachTiddler Macro
//============================================================================


//============================================================================
// String.startsWith Function
//============================================================================
//
// Returns true if the string starts with the given prefix, false otherwise.
//
version.extensions["String.startsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.startsWith = function(prefix) {
	var n =  prefix.length;
	return (this.length >= n) && (this.slice(0, n) == prefix);
};



//============================================================================
// String.endsWith Function
//============================================================================
//
// Returns true if the string ends with the given suffix, false otherwise.
//
version.extensions["String.endsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.endsWith = function(suffix) {
	var n = suffix.length;
	return (this.length >= n) && (this.right(n) == suffix);
};


//============================================================================
// String.contains Function
//============================================================================
//
// Returns true when the string contains the given substring, false otherwise.
//
version.extensions["String.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.contains = function(substring) {
	return this.indexOf(substring) >= 0;
};

//============================================================================
// Array.indexOf Function
//============================================================================
//
// Returns the index of the first occurance of the given item in the array or 
// -1 when no such item exists.
//
// @param item [may be null]
//
version.extensions["Array.indexOf"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.indexOf = function(item) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == item) {
			return i;
		}
	}
	return -1;
};

//============================================================================
// Array.contains Function
//============================================================================
//
// Returns true when the array contains the given item, otherwise false. 
//
// @param item [may be null]
//
version.extensions["Array.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.contains = function(item) {
	return (this.indexOf(item) >= 0);
};

//============================================================================
// Array.containsAny Function
//============================================================================
//
// Returns true when the array contains at least one of the elements 
// of the item. Otherwise (or when items contains no elements) false is returned.
//
version.extensions["Array.containsAny"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAny = function(items) {
	for(var i = 0; i < items.length; i++) {
		if (this.contains(items[i])) {
			return true;
		}
	}
	return false;
};


//============================================================================
// Array.containsAll Function
//============================================================================
//
// Returns true when the array contains all the items, otherwise false.
// 
// When items is null false is returned (even if the array contains a null).
//
// @param items [may be null] 
//
version.extensions["Array.containsAll"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAll = function(items) {
	for(var i = 0; i < items.length; i++) {
		if (!this.contains(items[i])) {
			return false;
		}
	}
	return true;
};


} // of "install only once"

// Used Globals (for JSLint) ==============
// ... DOM
/*global 	document */
// ... TiddlyWiki Core
/*global 	convertUnicodeToUTF8, createTiddlyElement, createTiddlyLink, 
			displayMessage, endSaveArea, hasClass, loadFile, saveFile, 
			startSaveArea, store, wikify */
//}}}


/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
!URL
http://newsroom.ucla.edu/portal/ucla/ucla-physicists-peer-within-gold-230808.aspx

!Description
UCLA researchers are now able to peer deep within the world's tiniest structures to create three-dimensional images of individual atoms and their positions. Their research, published March 22 in the journal Nature, presents a new method for directly measuring the atomic structure of nanomaterials.
!URL
http://www.sciencedaily.com/releases/2010/04/100427171844.htm

!Description
A team of scientists working at beamline 9.0.1 of the Advanced Light Source (ALS) at the U.S. Department of Energy's Lawrence Berkeley National Laboratory has used x-ray diffraction microscopy to make images of whole yeast cells, achieving the highest resolution -- 11 to 13 nanometers (billionths of a meter) -- ever obtained with this method for biological specimens. Their success indicates that full 3-D tomography of whole cells at equivalent resolution should soon be possible.
"We have demonstrated that lensless imaging techniques can achieve very high resolution while overcoming the limitations of x-ray optics -- limitations that include requiring 20 to 50 times the radiation exposure to get a magnified image of the sample," says Chris Jacobsen, formerly of Stony Brook University, now of Argonne National Laboratory and Northwestern University, who designed the lensless-imaging research program at beamline 9.0.1. "While at present it takes us a long time to image a single specimen -- and full 3-D imaging of hydrated cells will take even more work -- this is a big step in the right direction."

Three-dimensional imaging of whole cells under conditions close to those in nature, namely a hydrated (watery) environment, is already done at the National Center for X-Ray Tomography at ALS beamline 2.1, under the direction of Carolyn Larabell of Berkeley Lab's Physical Biosciences Division, where large numbers of cells can be processed in a short time at resolutions of 40 to 60 nanometers. The ability to increase resolution to the 10-nanometer range would significantly advance research in both biology and materials sciences.

"Ten-nanometer resolution is easy to achieve with an electron microscope," says Janos Kirz of the ALS, co-designer with Jacobsen of the lensless imaging program. "The problem is that electron microscopy is limited to very thin samples, a few hundred nanometers or less -- so you can't use it to look through a whole cell."

While x-rays have the ability to look deep into thick specimens, or right through them, imaging with a lens has its own problems. Even the best x-ray microscope lenses (concentric circles of metal known as Fresnel zone plates), can't focus x-rays with high efficiency, so to get an image means using such intense radiation that it more quickly damages biological specimens. At the same time, the geometry of the highest-resolution zone plates makes for an extremely narrow depth of focus.

To get around these barriers, a research team led by Jacobsen’s students Johanna Nelson, Xiaojing Huang, and Jan Steinbrener—also of Stony Brook—used lensless x-ray diffraction microscopy, a concept pioneered by David Sayre beginning in the 1980s. To produce a high-resolution diffraction pattern from noncrystalline structures like the membranes and organelles of a cell, the light has to be coherent, that is, laser-like, having all the same frequency and phase. Beamline 9.0.1 was built to supply this kind of light.

As they proceed through the cell, the coherent x-rays are scattered and differentially absorbed by the cell's internal structures. There's no lens either in front or behind the sample as the light passes through the cell and reaches the detector, so there's nothing to limit resolution or efficiency.

But the result looks nothing like an image. Instead it's a pattern of dark and light speckles, the traces of the scattered x-rays. A computer -- which acts as the "lens" in lensless imaging -- uses these patterns to create an image.

Stefano Marchesini, ALS beamline scientist for beamline 9.0.1, says, "The challenge of the lensless technique is that essentially the preparation and quality of the sample have to be perfect -- and, ideally, completely isolated in the beam."

The ideal can't be reached in reality, since the sample has to be supported. Furthermore, to image hydrated cells, the specimen has to be frozen, which introduces misleading data from the presence of ice. Last November Jacobsen's team used beamline 9.0.1 to image a frozen, fully hydrated yeast cell at a resolution of 25 nanometers -- a resolution limited by ice. The current experiment's 10 to 13 nanometer resolution required using unhydrated, freeze-dried cells at room temperature.

Until recently, to produce an image, researchers had to know the precise shape of the sample's support and have a pretty good idea of the shape of the sample itself, before the computer could even start solving the diffraction patterns. A new algorithm written by Marchesini called "shrinkwrap" converges on the diffraction data through subsequent iterations, and finally distinguishes and subtracts the support from the sample image.

Nevertheless, tens of thousands of iterations with both algorithms and manual adjustments of the cell boundaries were needed to yield the current experiment's final image of a pair of yeast cells. Details emerged when the computer was instructed to represent differences in absorption with differences in image brightness, and differences in the phase of the light, altered by scattering, with differences in image color.

The relationship of a cell's internal structures can only be determined accurately by full 3-D tomography. In a 2-D image these features are stacked one on top of another, and separating the planes is partly a matter of guesswork. Short of true 3-D, it's possible to gain some sense of how the internal structures are arranged by focusing on different depths in the structure, then comparing these images with others of the same object made with different techniques.

In the current experiment, additional images of the same freeze-dried cells were made first by scanning transmission x-ray microscopy (using a lens), which was of lower resolution but helped confirm features at different planes, and then by scanning electron microscopy, which was of higher resolution but could only show surface details such as sugar molecules in the cell walls, which the researchers had labeled with gold particles to serve as position markers.

"True 3-D of whole, hydrated, frozen cells at this very high resolution is our next step," says Jacobsen. "One ingredient is to rotate the frozen sample in the beam to get more depth information. Another is to scan the beam across the sample."

Jacobsen's team is making progress using both methods at beamline 9.0.1, but the present set-up, remarkable as it is, requires what he calls "heroic" experimental efforts. To reap the full benefits of lensless imaging with x-ray diffraction microscopy, he says, will require a source of intense coherent light that can yield a thousand times the current data rate. "We'll want to readily tune the frequency of the light, and tune its energy to the optimum. And we'll need a sample stage that can easily tilt and rotate frozen samples, holding them in the beam for many exposures. These advances would mean we could do our experiments reasonably rather than heroically, and on a wider range of materials."

In the meantime, x-ray diffraction microscopy at beamline 9.0.1 is pointing the way to what lensless imaging can do.

This work was supported by the U.S. Department of Energy's Office of Science and the National Institutes for Health.
Parallel Electron Energy Loss Spectrum:

[img[http://www.gatan.com/images/slide_32.jpg]]
iVBORw0KGgoAAAANSUhEUgAAACwAAAArCAYAAAADgWq5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAk5SURBVFiF1ZlrbBzVFYC/O7Mz+16/vc47tmM7sZOQB5QGAkqiqhE0VKAqrSgJjfiRqpX4UyFaqCLLotDSIrVCoghKSyqSliYgSgpNVSC4SWlSIIoJBGPjPByIE9sbr1/7mp2d2x9jz67j9dp50Krn1+zcO+d+99xzzzn3rpBS8v8kyv8a4HLFdbUKHtzZWqWr1g1SUeqRsh5ENWCCHBEwIpEREIdMQz/4+H03j1zteOJKXKJl9/5QSrq/IRD3AOuZ2UqZCPEelvyLnhFPN29bN3jZA3OZwC07Wz2Gy/oRiAcB76XtLpeKz+tDCDDNDKZpYqQN8gwxBDxpKdovf/rttdEvBPjhXW9/XcCvgOrxd7qmURWuIFxZQcDvR9e1Sd+ZpslAdJCB6CCRgSixWPxS8O2Pblm/55oBf3PvXrUuVf5rYPv4u1AwQG3NQirKShFCzHQsAPojF+k63c3wcNadpeDJi7HQA89sX52+KuAf7D3s9aZSfwJ5B4CmuairqWbunNlcJuck6e3r50R7J2nTHCMRhzO6edvPNn9l6IqAW559zWf4A28i5RqAgN/HqhXL8Ho8V0eaI4lkkrYPP3asLaHV7Y5sbN682Zjqmyl3t+H3PTUOW1pSzI3Xr7ymsABej4cbV6+gorwMAAHrUqnynQKmXL+8wD/e/fZ9SLENoLgoxOoVy3G5rjpk5wdQFK5b1khxUQgAAXc/tPvAD6fqP8klHtrVukhBHge8uq6x5kur8bjdXwhsrqTTaY68f4x4PAEQN4VoePyedZ9f2m+ShRXkDsZi7PKmJZcHKyVKdATX2V6UodHLAtY0jaVLGsZ/+lQpf56v3wQL7/j9gVpLFR2AGq6sYMWyxhkN5jrbi378JEpkCJE2s/y6i0xFCcaqejJVpTPSdfyjds739tlwyJt/smXDvyaMlftDquIhQAWorV4wrXKRNnEfPoHWcTZ/u2HiOtePqydCYmkJxopGFE8xBfYU9XU19PVHyFgWFuL7wARgx8J22pVRwDMT64q0ie/Ph1AG7aVXXCrBcAmeoA/N68aIJ0kOxxmMnKO34g2S3nP2dy4//tpteObcPqXuHCvH9Hissnn7Jic9OhY2NHkzEg9AVbiiICyA+912B9ZXEqSqcQEuj+60+0qDGJkROgJPk7QGnPfSjDHa8RTC5cMdXpdX96yqynFgv+H33wn8YbzN2XRCsmH8ubS4uCCs2hNB+/gMAN4iP3NX1k2AHZeuwX0O7OxZfpY1laFp9pCxT3+DzCTy6i8vK82GUSlvy21zgKUQ64Epi5hc0T86DYBQFMKNC/O6ZCx9gc9HDwFQUe7lyzeEqastYnmTnSQsY5BE90t59QshCPh942D1eYGFlNWAE8ALidpvV4T+8hC6L3/Y64i+jJQWAMuashFi/rwgRSF7NRKfvYKVupj3e59vrHoV1OYFllAEoE1jXRFLIuIpADxBX94+A8lO+uMfADBvboDiouykhIClY1aWmRTxU7vy6vD7HN1lLTtbHR9VAL777FGNsWShqWpBYGUkW89qvny1haQjuhcAVRE0LSklOpii7XiEtuMRTp4eIlzhJVxpWzB54Q3M0TOTtOS6ZVLPOEukAJR5Bh0/UF2Fga0iv/OcjiUntZ+PvcdwqhuA2poifF4Xf3/rM1au3cPKtXu4/wHbr5c2ltklqpTET/5ukp6MmXGePUIdngA8OmSMAhZAMjVlZQeA9LqR/jHrjMQmTkaafBp9BQBdV2mos1cyGMxaKxi0/bcopLNgXhAA4+JR0gNtE3Q5dTLQMxJ0amQF4Mn7b0shOAtceoTJK5lwCQCxyDDJ4Wz/7uG3SJj2JlpcX+yEsGAgG/JCwexz4+JSVNUOMbGu35J7+EunncNHIvckkhuHOwFi8emBjesWgSKQUnLh4zPIjEXainFqaD8Afr9GzcJstAkGtLzPHo9KXa29CuboKVK9B5y26KBj1E9zx86JErIdIB5PYOYsRz7JlBfZ0IARS9L97id09L2CadmTXbqkFEXJBudADmQoNDHB1C8qwu22903s1AtIy8Aw0oyMOu72Vl5gRbIPsK3W118QGCC1qp5M2N68sXQfPYl/AlBa4mHObP+EvrlWzXUJAJdLobHBdjEr2U/ys1e5GM05+Qv5Rl5g16lDrUAPwPkLfdMCoyjEN63BWFVPtOzfSDE5STjAOZC58OOycEHI2Zjx7j30X+gebzIMyzyYF7i5udmS8CLAQHSQkZEZFOCKQmyRJOY/CcCcWX7KSifHZp/X5bjIpRaGsWSyZCyZmHG0i/vsBsmuX2z96oRQNOHEoUr1OSAD0N7ZNT0wEOt6boxd0NQ4dZEe8NsWzA1xuTKrykdFuR0uy2nDSzSjWPKxS/tNAH5k663twDNg79ILvYV9OdX/DumhdgCqF4QcqHyyYnk5DXXFVFZMuuFyZNnYhAUW89l/7pHvbDhZEBhAdxs7kAwAfNLZRSI5OZsBIE3iXTsB0DSFJQ2FS9J/7L+Ttne+xfUrK6fsU1zsZt7cAAAB8fn8l3ZtvGla4ObNGwekkA8ApAyDo20fkk5PDnOJc38lk+gBoKGuGF2fOqWPxtIsvfFFwrXP8+rrpwtOrCknJCpCeWJaYIDHtmx4XiCeADvzHTv+EWZObpeWQfy0fQjweV3U1hQVhHjnyHlOtA8wPGLw4suF94bP62JRVt+al/94+x3TAgM8umXdgyBfAtufD7971Ikc5uAJZNq+XlrcUIKqFL5ou/Wm2dxy0yzmzPZz39bFBfuCvWJO4snI9bltU17nSJAtprLVcEkv8LV4IsGR94/RsKiGSjW7Gf2+6W+EvF4XB/9217T9xkXTFHRNIZnKIATzZgQM0LxtXVLAHQ/vbn0YKVssy1LbO7s45xbUoQAWxz6IUL0whK5fu79L+vsTJFO2C4qxomxcZnyhveOFAxssIZ4H5gNUi9cp5cQ1g5xCzohM+vq77n3TOUfN2CyPbN1wQHdH6oSU3wPOdsuN9Mi1pAl8EaASOCIVuSkXFq70T5m9e3UjVXEvyDsF1q06Q0Fh1/+FJK2SOuiRA69VqUda3SIyRYAHN+7Iprv3RfK1XRFwrrS0trpSZzM3IJRbBLISIYJIAgipC5QzlrA6sUSn5cm0TXe7PhO5auD/tvwHQhyDgtGxXlsAAAAASUVORK5CYII=
!URL
http://www.nanowerk.com/news2/newsid=26086.php

!Description
Aduro is a scalable platform for quantitative electron microscopy of micro and nanomaterials. It revolutionizes the analytical capabilities of electron microscopes by enabling in situ experimentation at temperatures up to 1200 °C while maintaining atomic resolution. It’s the first commercially viable solution for real-time, dynamic thermal and electrical studies in a fast and versatile high-resolution system. The Aduro 300 is easy to use and includes a double-tilt option.

Read more: http://www.nanowerk.com/news2/newsid=26086.php#ixzz22hT5gp4l
|Symbol|Command|h
|$\large \displaystyle X \cdot Y$|X \\cdot Y|
|$\large \displaystyle \frac{d}{dx}\left(x^2\right) = 2x$|\\frac{d}{dx}\left(x^2\\right) = 2x|
|$\large \displaystyle \int 2x\,dx = x^2+C$|\\int 2x\,dx = x^2+C|
|$\large \displaystyle \int^5_1 2x\,dx = 24$|\\int^5_1 2x\,dx = 24|
|$\large \displaystyle \int^5_1 2x\,dx = 24$|\\displaystyle\int^5_1 2x\,dx = 24|
|$\large \displaystyle \frac{\partial^2U}{\partial x^2} + \frac{\partial^2U}{\partial y^2}$|\\frac{\\partial^2U}{\\partial x^2} + \\frac{\\partial^2U}{\\partial y^2}|
|$\large \displaystyle \frac{1}{4\pi}\oint_\Sigma\frac{1}{r}\frac{\partial U}{\partial n} ds$|\\displaystyle \\frac{1}{4\pi} \\oint_\\Sigma\\frac{1}{r}\frac{\partial U}{\partial n} ds|
/***
|''Name''|TiddlySpaceRevisionView|
|''Description''|Show tiddler revisions in a stack of cards view|
|''Author''|BenGillies|
|''Version''|0.2.0|
|''Status''|beta|
|''Source''|http://github.com/TiddlySpace/tiddlyspace|
|''CodeRepository''|http://github.com/TiddlySpace/tiddlyspace|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.6.0|
|''Requires''|TiddlyWebAdaptor|
!Usage
The viewRevisions macro can be attached to any element, which should be passed
in as a parameter.

For example:

<<viewRevisions page:10 link:"<<view modified date>>">>

would show the revisions "stack of cards" view, 10 at a time, when the modified
date is clicked.
!Code
***/
//{{{
(function($) {

var me = config.macros.viewRevisions = {
	revisionTemplate: "RevisionTemplate",
	revSuffix: " [rev. #%0]", // text to append to each tiddler title
	defaultPageSize: 5, // default number of revisions to show
	defaultLinkText: "View Revisions", // when there's nothing else to use
	offsetTop: 30, // in px
	offsetLeft: 10, // in px
	shiftDownDelay: 50, // in ms
	visibleSlideAmount: 20, // amount of revisions to show on left hand edge after sliding
	zIndex: 100, // default z-index
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		params = paramString.parseParams(null, null, true)[0];
		var tiddlerElem = story.findContainingTiddler(place);

		var revButton;
		var pageSize = parseInt(params.page[0], 10) || me.defaultPageSize;
		var linkObj = params.link ? params.link[0] || me.defaultLinkText : false;
		if(linkObj) {
			 revButton = $('<span class="button openRevisions" />')
				.appendTo(place);
			wikify(linkObj, revButton[0], null, tiddler);
		} else {
			revButton = place;
		}

		$(revButton).click(function() {
			if (!$(tiddlerElem).hasClass("revisions")) {
				me.showRevisions(tiddlerElem, tiddler, pageSize);
			} else {
				me.closeRevisions(tiddlerElem);
			}
		});
	},

	// initialisation for revision view
	showRevisions: function(tiddlerElem, tiddler, pageSize) {
		var context = {
			host: tiddler.fields["server.host"],
			workspace: tiddler.fields["server.workspace"]
		};
		$(tiddlerElem).addClass("revisions").attr("revName", tiddler.title);
		// ensure toolbar commands deactivate RevisionsView
		$("a", ".toolbar", tiddlerElem).each(function(index, btn) {
			var _onclick = btn.onclick;
			btn.onclick = function(e) {
				me.closeRevisions(tiddlerElem);
				_onclick.apply(this, arguments);
			};
		});
		// ensure default action deactivates RevisionsView
		var _ondblclick = tiddlerElem.ondblclick;
		tiddlerElem.ondblclick = function(e) {
			me.closeRevisions(tiddlerElem);
			_ondblclick.apply(this, arguments);
		};
		var type = tiddler.fields["server.type"];
		var adaptor = new config.adaptors[type]();
		var userParams = {
			tiddlerElem: tiddlerElem,
			pageSize: pageSize,
			title: tiddler.title
		};
		me.createCloak(tiddlerElem);
		adaptor.getTiddlerRevisionList(tiddler.title, null, context, userParams,
				function(context, userParams) {
					// strip the current revision
					context.revisions.shift();
					me.expandStack(context, userParams);
				});
	},

	// fetch the actual revision and put it in the tiddler div
	showRevision: function(place, revision, callback) {
		var context = {
			host: revision.fields["server.host"],
			workspace: revision.fields["server.workspace"]
		};
		var userParams = {
			revElem: place
		};
		var type = revision.fields["server.type"];
		var adaptor = new config.adaptors[type]();
		var revNo = revision.fields["server.page.revision"];
		adaptor.getTiddlerRevision(revision.title, revNo, context, userParams,
			function(context, userParams) {
				var tiddler = context.tiddler;
				tiddler.title += me.revSuffix
					.format([$(place).attr("revision")]);
				tiddler.fields.doNotSave = true;
				if (store.getTiddler(tiddler.title)) {
					store.deleteTiddler(tiddler.title);
				}
				store.addTiddler(tiddler);

				//now, populate the existing div
				var revElem = userParams.revElem;
				$(revElem).attr("id", story.tiddlerId(tiddler.title));
				$(revElem).attr("refresh", "tiddler");
				var getTemplate = function() {
					var themeName = config.options.txtTheme;
					if (themeName) {
						return store.getTiddlerSlice(themeName,
							me.revisionTemplate) || me.revisionTemplate ||
							"ViewTemplate";
					} else {
						return (store.getTiddler(me.revisionTemplate)) ?
							me.revisionTemplate : "ViewTemplate";
					}
				};
				var template = getTemplate();
				story.refreshTiddler(tiddler.title, template, true);
				callback(tiddler);
			});
	},

	createCloak: function(promoteElem) {
		var el = $(promoteElem);
		// cache styles for resetting later
		el.data({
			top: el.css("top"),
			left: el.css("left"),
			zIndex: el.css("z-index")
		});

		$('<div class="revisionCloak" />').css("z-index", me.zIndex)
			.click(function() {
				me.closeRevisions(promoteElem);
			})
			.appendTo(document.body);

		el.css("z-index", me.zIndex + 1);
	},

	// clean up, removing all evidence of revision view
	closeRevisions: function(promoteElem) {
		var el = $(promoteElem);
		// revert the original tiddler back to its previous state
		el.removeAttr("revName").removeClass("revisions").css({
			top: el.data("top"),
			left: el.data("left"),
			zIndex: el.data("zIndex")
		});

		// remove any revisions still in the store
		var revisions = $(".revisions");
		revisions.each(function(index, revision) {
			var revAttributes = revision.attributes;
			if ((revAttributes.revname) &&
					(revAttributes.revision)) {
				var revName = revAttributes.revname.value;
				var revNo = revAttributes.revision.value;
				var title = revName + me.revSuffix.format([revNo]);

				if (store.getTiddler(title)) {
					store.deleteTiddler(title);
				}
			}
		});

		// delete the previous revisions
		revisions.remove();

		// remove the cloak
		$(".revisionCloak").remove();
	},

	// calback from getting list of revisions
	expandStack: function(context, userParams) {
		var pageSize = userParams.pageSize;

		var from = userParams.from || 0;
		var tiddlerElem = userParams.tiddlerElem;

		userParams.defaultHeight = $(tiddlerElem).height();
		userParams.defaultWidth = $(tiddlerElem).width();
		if (from < context.revisions.length) {
			me.displayNextRevision(tiddlerElem, userParams, context, from,
				from + pageSize - 1);
		}
	},

	// place the next div above and behind the previous one
	displayNextRevision: function(tiddlerElem, userParams, context, from, to) {
		var revision = context.revisions[from];
		var callback = function() {
			var revText = revBtn.getRevisionText(tiddlerElem, revision);
			tiddlerElem = me.createRevisionObject(tiddlerElem, context,
				userParams, revText);
			$(tiddlerElem)
				.attr("revision", (context.revisions.length - from));
			if ((from < to) && ((from + 1) < context.revisions.length)){
				me.displayNextRevision(tiddlerElem, userParams, context,
					from + 1, to);
			} else if ((context.revisions.length - 1) > to) {
				me.showMoreButton(tiddlerElem, context, userParams, to + 1);
			}
		}
		me.shiftVisibleDown(userParams.title, callback);
	},

	createRevisionObject: function(tiddlerElem, context, userParams, text) {
		var newPosition = me.calculatePosition(tiddlerElem, context);
		return $('<div class="revisions tiddler" />')
			.css({
				position: "absolute",
				top: newPosition.top,
				left: newPosition.left,
				"z-index": me.zIndex + 1,
				height: userParams.defaultHeight,
				width: userParams.defaultWidth
			})
			.attr("revName", userParams.title)
			.append(text)
			.insertBefore(tiddlerElem);
	},

	// move the already present revisions down by 1 to fit the next one in
	shiftVisibleDown: function(title, callback) {
		var revisions = $("[revName=%0].revisions".format([title]));
		var revisionCount = revisions.length;

		$(revisions).animate({top: "+=" + me.offsetTop},
				me.shiftDownDelay, function() {
					revisionCount -= 1;
					if ((callback) && (!revisionCount)) {
						callback();
					}
				});
	},

	// where we put the new revision
	calculatePosition: function(elem, context) {
		var offset = $(elem).offset();
		var currentPosition = $(elem).position();
		var newPosition = {
			top: currentPosition.top - me.offsetTop
		};
		if ((context.restrictLeft) ||
				((offset.left - me.offsetLeft) <
				$("#contentWrapper").offset().left)) {
			newPosition.left = $(elem).position().left;
			context.restrictLeft = true;
		} else {
			newPosition.left = currentPosition.left - me.offsetLeft;
		}
		return newPosition;
	},

	// equivalent of displayNextRevision, but for the more button
	showMoreButton: function(tiddlerElem, context, userParams, moreIndex) {
		userParams.from = moreIndex + 1;
		me.shiftVisibleDown(userParams.title, function() {
			var btn = me.createRevisionObject(tiddlerElem, context, userParams,
				"");

			var more = createTiddlyButton(btn[0], "more...", "show more revisions",
				function() {
					if ($(".viewRevision").length) {
						return;
					}
					userParams.tiddlerElem = btn[0];
					$(btn).text("")
						.append(revBtn
							.getRevisionText(btn[0], context.revisions[moreIndex]))
						.attr("revision", context.revisions.length - moreIndex);
					me.expandStack(context, userParams);
				});
			$(more).css("float", "right");
		});
	},

	stripRevFromTitle: function(revisionTitle) {
		return revisionTitle.split(/ ?\[rev\. #[0-9]+\]$/)[0];
	},

	onClickRevision: function(revElem, revision, callback) {
		// don't do anything if we are still loading
		if ($(".revisions").hasClass("loading")) {
			return null;
		}

		var origTitle = me.stripRevFromTitle(revision.title);
		if ($(revElem).hasClass("viewRevision")) {
			$(".revisions").addClass("loading");
			me.slideIn(revElem, revision, origTitle, function() {
				store.deleteTiddler(revision.title);
				revision.title = origTitle;
				$(revElem).text("").append(revBtn.getRevisionText(revElem,
						revision))
					.removeAttr("tags").removeAttr("tiddler")
					.removeAttr("refresh").removeAttr("template")
					.removeAttr("id");
				$(".revisions").removeClass("loading");
				if (callback) {
					callback();
				}
			});
			$(revElem).removeAttr("prevPos").removeClass("viewRevision");
		} else {
			var viewRevision = function() {
				var prevPos = $(revElem).position().left;
				$(revElem).addClass("viewRevision").attr("prevPos", prevPos);
				$(".revisions").addClass("loading");
				me.showRevision(revElem, revision, function(rev) {
					me.slideOut(revElem, rev, origTitle, function() {
						$(".revisions").removeClass("loading");
					});
				});
			};
			// make sure another revision isn't already out
			if ($(".viewRevision").length) {
				var newRevElem = $(".viewRevision")[0];
				var newRevision = store.getTiddler($(newRevElem)
					.attr("tiddler"));
				me.onClickRevision(newRevElem, newRevision, viewRevision);
			} else {
				viewRevision();
			}
		}
	},

	slideOut: function(revElem, revision, title, callback) {
		var leftMostPos = $("[revName=%0].revisions".format([title]))
			.offset().left;
		var width = $(revElem).width();
		var originalLeftPos = $(story.getTiddler(title))
			.position().left;

		var slideAmount = leftMostPos + width - me.visibleSlideAmount;
		$("[revName=%0].revisions:not(.viewRevision)".format([title]))
			.animate({left: "-=" + slideAmount}, 1000);
		$(revElem)
			.attr("baseHeight", $(revElem).css("height"))
			.css("height", "auto")
			.animate({left: originalLeftPos}, 1000, callback);
	},

	slideIn: function(revElem, revision, title, callback) {
		var slideAmount = $(revElem).offset().left -
			$(story.getTiddler(title)).offset().left;
		var origRevPos = $(revElem).attr("prevPos");

		$("[revName=%0].revisions:not(.viewRevision)".format([title]))
			.animate({left: "+=" + slideAmount}, 1000);
		$(revElem).animate({left: origRevPos}, 1000, function() {
			$(revElem)
				.css("height", $(revElem).attr("baseHeight"))
				.removeAttr("baseHeight");
			callback();
		});
	}
};

var revBtn;
config.macros.slideRevision = revBtn = {
	btnText: "created by %0 at %1 on %2",
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var btn = revBtn.getRevisionText(place, tiddler);
		$(place).append(btn);
	},

	getRevisionText: function(place, revision) {
		var text = revBtn.btnText.format([revision.modifier,
			revision.modified.formatString("0hh:0mm"),
			revision.modified.formatString("0DD MMM YYYY")]);
		var btn = $('<a href="javascript:;" class="button revButton" />')
			.text(text)
			.click(function() {
				var revElem = story.findContainingTiddler(this);
				me.onClickRevision(revElem, revision);
			});
		return btn;
	}
};

})(jQuery);
//}}}
!URL
http://www.nanowerk.com/news/newsid=19597.php

!Description
Extracting cellular 'engines' may aid in understanding mitochondrial diseases
(Nanowerk News) Medical researchers who crave a means of exploring the genetic culprits behind a host of neuromuscular disorders may have just had their wish granted by a team working at the National Institute of Standards and Technology (NIST), where scientists have performed surgery on single cells to extract and examine their mitochondria ("Detection of Heteroplasmic Mitochondrial DNA in Single Mitochondria").
The scientists reached into these cells and extracted their "engines"—the mitochondria that are in large part responsible for our metabolism. Many human cells contain hundreds of mitochondria, which were thought to be free-swimming organisms millions of years ago and which still possess their own DNA. Mutations in this mitochondrial DNA (mtDNA) are directly related to a large class of mitochondrial-based diseases, which have a range of symptoms that include early onset blindness, seizures, hearing lo
[[StyleSheetTiddlySpace]]
!URL
http://www.microscopy-news.com/news/super-resolution-microscopy-for-pharmaceutical-industry-patents-granted-for-3d-complex-labeling.html

!Description
December 22, 2011. -- The LIMON 3D microscopy (LIght MicroscOpical Nanosizing) of Prof. Dr. Dr. Christoph Cremer opens new possibilities for pharmaceutical research. 3D molecular complexes so-called biomolecular machines, targets of drugs can thus be studied in vivo.
List of tiddlers containing video fragments:

<<forEachTiddler
 where
 'tiddler.tags.contains("Video")'
 sortBy 
        'tiddler.title.toUpperCase()'
 script
 '
 function getFirstLine(s) {
 var m = s.match(/\s*(.*)/);
 return m != null && m.length >= 1 ? m[1] : "";
 }
 '
 write
 '"[["+tiddler.title+"]]\n"' 

>>

In
TEM maximum possible EDX resolution is a bit less than regular STEM.
This is because of the [[interaction volume]] is a bit larger
<<formTiddler [[NewBookTemplate]]>><data>{"Author":"David Williams","Title":"How you make the sale","ReadingCompleted":false,"Rating":"****"}</data>

<html>
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&npa=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=httptiddlyweb-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=030645324X" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</html>
Go to system status.
Return parameters to 0: Works for:
* Beam shift
* Align drift
* Rotation centre
|MegaView
III|40k, Low|Supported on Titan, Special on Tecnai|||||
|KeenView
(special)|||||||
|MegaView III|40k, Low|Low||1k,
2k|||
|KeenView||Low||1k, 2k||Some specials honored, fiber optics
camera but witt cheap interline CCD. Should perform better than
MegaView III. |
|Morada|65l|Low||2.6K x 4K||Morada: only usable for
pathalogical anatomy: larger field of view|
<!doctype html>
<html>
	<head>
		<title>TiddlyApp Share</title>

		<link rel="stylesheet" href="/bags/common/tiddlers/profile.css" type="text/css"/>
		<script src="/bags/common/tiddlers/jquery.js" type="text/javascript"></script>
		<script src="/bags/tiddlyspace/tiddlers/chrjs" type="text/javascript"></script>
		<script src="/bags/common/tiddlers/chrjs-store.js" type="text/javascript"></script>
		<script src="/bags/common/tiddlers/chrjs.users" type="text/javascript"></script>
		<script type="text/javascript" src="/bags/common/tiddlers/backstage.js"></script>
		<script>
			// The templates of the links to display on the page
			var links = [
				{
					title: "Tiddlers",
					info: "Show a list of all the tiddlers in this space that a visitor currently has access to.",
					href: "{host}/tiddlers"
				}, {
					title: "Public Tiddlers",
					info: "Show a list of all the public tiddlers in this space in alphabetical order.",
					href: "{host}/bags/{subdomain}_public/tiddlers?select=tag:!excludeLists;sort=title"
				}, {
					title: "Atom Feed",
					info: "Get the Atom feed of the most recently changed tiddlers.",
					href: "{host}/tiddlers.atom?select=tag:!excludeLists;sort=-modified;limit=20"
				}, {
					title: "Specific Tiddler",
					info: "Show a specific tiddler in your space (GettingStarted in this example) as HTML, JSON or just plain text.",
					href: ["{host}/GettingStarted", "{host}/GettingStarted.json", "{host}/GettingStarted.txt"],
					more: "http://tiddlyweb.peermore.com/wiki/"
				}, {
					title: "Search for text",
					info: "Search tiddlers for some text contained inside a tiddler.",
					href: "{host}/search?q={subdomain}"
				}, {
					title: "List tiddlers with a tag",
					info: "Display all the tiddlers that have the tag specified (here the tag is systemConfig).",
					href: "{host}/tiddlers?select=tag:systemConfig"
				}
			];

			$(function() {

				var subdomain = document.location.host.split(".")[0];

				// Filter curly braces to display information
				for (var i in links) {
					var href = links[i].href;

					if (typeof href === "string")
						href = [href];

					for (var j in href) {

						href[j] =  href[j].replace("{host}", (document.protocol || "http:") + "//" + document.location.host);
						href[j] =  href[j].replace("{subdomain}", subdomain);
					}

					links[i].href = href;
				}

				// Display links to user
				var insertInto = $('#share_links');

				for (var i in links) {

					var linkBody = $('<div class="share_link"></div>');

					var linkDisplay = $('<div class="link_display"></div>');

					for (var j in links[i].href) {

						var a = $('<a class="link_href" target="_blank"/>');
						a.html(links[i].href[j]);
						a.attr('href', links[i].href[j]);

						linkDisplay.append(a);
						linkDisplay.append("<br/>");
					}
					
					var linkTitle = $('<b class="link_title"/>');
					linkTitle.html(links[i].title);

					var linkInfo = $('<div class="link_info"/>');
					linkInfo.html(links[i].info);

					linkBody.append(linkTitle);
					linkBody.append('<br/>');
					linkBody.append(linkInfo);
					linkBody.append(linkDisplay);

					if (links[i].more) {
						var linkMore = $('<a class="link_more">Learn more</a>');
						linkMore.attr('href', links[i].more);
						linkBody.append(linkMore);
					}

					insertInto.append(linkBody);
				}
			});
		</script>
		<style type="text/css">
			.link_display {
				display: block;
				background: #f2f2f2;
				border: 1px solid #aaa;
				padding: 10px;
				margin-top: 4px;
				word-wrap: break-word;
			}
			.link_more {
				display: block;
				text-align: right;
			}
			.share_link {
				margin-bottom: 10px;
			}
		</style>
	</head>
	<body>
		<div id="container">
			<div id="header">
				<h1>Share Space</h1>
			</div>
			<div class="main section">
				<p>Here are a number of methods that you can use to share this Space and its content in different ways.</p>
				<span id="share_links"></span>
			</div>
		</div>
	</body>
</html>
http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html
@@Please do not modify this tiddler; it was created automatically upon space creation.@@
<html>
<img src="/static/files/Work/Dirk-Jan/dsn.jpg" width="150" style="float:left;margin:5px 20px 5px 0" />
Dirk-Jan Swagerman is a result driven innovation and development director and coach. Capable of getting things done. Enjoying people, technology and multi site multi disciplinary innovation and development. Fulfilled software architecture, functional  management and project leading roles. Practical hands on manager with process affinity. Conceptual and creative thinker. Demonstrated ability to build strong cross site and cross functional relationships. Strong experience with Czech and United States work cultures. My goal is learn and expand my in company entrepreneurial business skills. This was the reason to start with Master of Business Innovation program at Tias Nimbas in March 2010. I completed this program in June 2012. In the context of the study i started to host my own tiddlyspace for notekeeping and bookmarking on different subjects.
<br>
<br>
After the MBI study I started to coach startups using my <a href="http://mbi.dirkjanswagerman.nl">Master of Business Innovation</a> website as a resource for learning and reference. If you are interest in a free first coaching session please contact me at <a href="mailto:djswagerman@chello.nl">Dirk-Jan Swagerman</a> or through my linkedin account below. You can read about the coaching approach <a href="http://blog.dirkjanswagerman.nl/innovation-coaching-for-startups/">here.</a> 
<br>
<br>
<br>
<br>
<iframe allowtransparency="true" frameborder="0" scrolling="no"
  src="//platform.twitter.com/widgets/follow_button.html?screen_name=djswagerman"
  style="width:300px; height:20px;"></iframe>
<br>
<a href="http://nl.linkedin.com/in/djswagerman">
      
          <img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.png" width="160" height="33" border="0" alt="View Dirk Jan Swagerman's profile on LinkedIn">
        
    </a>
</html>
|F114
(twee versies: stand-alone en in combinatie met F415 (off-axis))|High|||||Search mode camera': kan potentieel worden vervangen door bijvoorbeeld de flucam. Andere mogelijkheden: een andere nieuw design, retractable camera|
|F214 (twee versies: PXL (oud) en PVCAM (nieuw))|High|Lower Pixel DQE|Faster than 'bigger brothers'|2k|||
|F224 (twee versies: PXL (oud) en SCX (nieuw))|High||Relatively slow|2k||Concurrent Eagle 2K|
|F415 (twee versies: PXL (oud) en SCX (nieuw))|High||Relatively slow|4k||High end camera, concurrent Eagle 4K|
Fairchild
camera
4K
http://www.fairchildimaging.com/products/cameras/linescan/tdi/ccd_4k.htm

Eagles
are mechanically incompatible with Gatan Imaging Filters ([[GIF]])
<<forEachTiddler
 where
 'tiddler.tags.contains("Term")'
 sortBy 
        'tiddler.title.toUpperCase()'
 script
 '
 function getFirstLine(s) {
 var m = s.match(/\s*(.*)/);
 return m != null && m.length >= 1 ? m[1] : "";
 }
 '
 write
 '"|[["+tiddler.title+"]]"+"|"+ getFirstLine(tiddler.text)+"|\n"' 

>>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="450 366 38 57"
width="30" height="30">
	<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
		<g>
			<path d="M 452.1094 421.2422 L 450 421.2422 L 450 423 L 487.9688 423 L 487.9688 421.2422 L 485.8595 421.2422 
			L 485.8595 377.29688 L 487.9688 377.29688 L 487.9688 375.53906 L 485.8595 375.53906 
			C 485.8595 375.53906 481.12463 371.59341 473.02023 370.52802 C 472.6824 368.9689 471.72098 366.75 468.9844 366.75 
			C 466.24783 366.75 465.28638 368.9689 464.94864 370.52802 
			C 456.84418 371.59341 452.1094 375.53906 452.1094 375.53906 L 450 375.53906 L 450 377.29688 L 452.1094 377.29688 
			Z M 467.12247 370.32086 L 467.12247 370.32086 C 467.3805 369.42395 467.90762 368.50781 468.9844 368.50781 
			C 470.0612 368.50781 470.5883 369.42395 470.84634 370.32086 
			C 470.24136 370.2848 469.62054 370.26562 468.9844 370.26562 
			C 468.34827 370.26562 467.72748 370.2848 467.12247 370.32086 Z M 454.21875 420.92804 L 454.21875 420.92804 
			C 455.46762 420.42087 456.32816 419.35281 456.32816 418.11716 L 456.32816 377.29688 L 458.4375 377.29688 
			L 458.4375 421.2422 L 454.21875 421.2422 Z M 460.5469 420.92804 L 460.5469 420.92804 
			C 461.79578 420.42087 462.65625 419.35281 462.65625 418.11716 L 462.65625 377.29688 L 464.76566 377.29688 
			L 464.76566 421.2422 L 460.5469 421.2422 Z M 466.87503 420.92804 L 466.87503 420.92804 
			C 468.1239 420.42087 468.9844 419.35281 468.9844 418.11716 L 468.9844 377.29688 L 471.09378 377.29688 
			L 471.09378 421.2422 L 466.87503 421.2422 Z M 473.2032 420.92804 L 473.2032 420.92804 
			C 474.45203 420.42087 475.31256 419.35281 475.31256 418.11716 L 475.31256 377.29688 L 477.4219 377.29688 
			L 477.4219 421.2422 L 473.2032 421.2422 Z M 479.5313 420.92804 L 479.5313 420.92804 
			C 480.78018 420.42087 481.64066 419.35281 481.64066 418.11716 L 481.64066 377.29688 L 483.75006 377.29688 
			L 483.75006 421.2422 L 479.5313 421.2422 Z" fill="black" class="glyph"/>
		</g>
	</g>
</svg>
TBD
!URL
http://www.microscopy-news.com/news/simagis-live-for-quantitative-analysis-of-nuclear-stains.html

!Description
October 19, 2011 -- Smart Imaging Technologies has released Simagis Live Web Application for quantitative analysis of IHC Nuclear Stains (ER, PR, Ki-67 Markers).
/***
|''Name''|TiddlyWebConfig|
|''Description''|configuration settings for TiddlyWebWiki|
|''Author''|FND|
|''Version''|1.3.2|
|''Status''|stable|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/TiddlyWebConfig.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Requires''|TiddlyWebAdaptor ServerSideSavingPlugin|
|''Keywords''|serverSide TiddlyWeb|
!Code
***/
//{{{
(function($) {

if(!config.extensions.ServerSideSavingPlugin) {
	throw "Missing dependency: ServerSideSavingPlugin";
}
if(!config.adaptors.tiddlyweb) {
	throw "Missing dependency: TiddlyWebAdaptor";
}

if(window.location.protocol != "file:") {
	config.options.chkAutoSave = true;
}

var adaptor = tiddler.getAdaptor();
var recipe = tiddler.fields["server.recipe"];
var workspace = recipe ? "recipes/" + recipe : "bags/common";

var plugin = config.extensions.tiddlyweb = {
	host: tiddler.fields["server.host"].replace(/\/$/, ""),
	username: null,
	status: {},

	getStatus: null, // assigned later
	getUserInfo: function(callback) {
		this.getStatus(function(status) {
			callback({
				name: plugin.username,
				anon: plugin.username ? plugin.username == "GUEST" : true
			});
		});
	},
	hasPermission: function(type, tiddler) {
		var perms = tiddler.fields["server.permissions"];
		if(perms) {
			return perms.split(", ").contains(type);
		} else {
			return true;
		}
	}
};

config.defaultCustomFields = {
	"server.type": tiddler.getServerType(),
	"server.host": plugin.host,
	"server.workspace": workspace
};

// modify toolbar commands

config.shadowTiddlers.ToolbarCommands = config.shadowTiddlers.ToolbarCommands.
	replace("syncing ", "revisions syncing ");

config.commands.saveTiddler.isEnabled = function(tiddler) {
	return plugin.hasPermission("write", tiddler) && !tiddler.isReadOnly();
};

config.commands.deleteTiddler.isEnabled = function(tiddler) {
	return !readOnly && plugin.hasPermission("delete", tiddler);
};

// hijack option macro to disable username editing
var _optionMacro = config.macros.option.handler;
config.macros.option.handler = function(place, macroName, params, wikifier,
		paramString) {
	if(params[0] == "txtUserName") {
		params[0] = "options." + params[0];
		var self = this;
		var args = arguments;
		args[0] = $("<span />").appendTo(place)[0];
		plugin.getUserInfo(function(user) {
			config.macros.message.handler.apply(self, args);
		});
	} else {
		_optionMacro.apply(this, arguments);
	}
};

// hijack isReadOnly to take into account permissions and content type
var _isReadOnly = Tiddler.prototype.isReadOnly;
Tiddler.prototype.isReadOnly = function() {
	return _isReadOnly.apply(this, arguments) ||
		!plugin.hasPermission("write", this);
};

var getStatus = function(callback) {
	if(plugin.status.version) {
		callback(plugin.status);
	} else {
		var self = getStatus;
		if(self.pending) {
			if(callback) {
				self.queue.push(callback);
			}
		} else {
			self.pending = true;
			self.queue = callback ? [callback] : [];
			var _callback = function(context, userParams) {
				var status = context.serverStatus || {};
				for(var key in status) {
					if(key == "username") {
						plugin.username = status[key];
						config.macros.option.propagateOption("txtUserName",
							"value", plugin.username, "input");
					} else {
						plugin.status[key] = status[key];
					}
				}
				for(var i = 0; i < self.queue.length; i++) {
					self.queue[i](plugin.status);
				}
				delete self.queue;
				delete self.pending;
			};
			adaptor.getStatus({ host: plugin.host }, null, _callback);
		}
	}
};
(plugin.getStatus = getStatus)(); // XXX: hacky (arcane combo of assignment plus execution)

})(jQuery);
//}}}
!URL
http://www.microscopy-news.com/news/lvem5-benchtop-electron-microscope-on-display-at-iconn-2012.html

!Description
The LVEM5 is the only multi-modal desktop EM on the market. It is able to operate in transmission modes as a TEM and in scanning modes as a SEM or STEM. Users are able to obtain all three types of information from the same sample and even the same area of interest. The LVEM5 is also capable of preforming electron diffraction.
!URL
http://new.americanlaboratory.com/914-Application-Notes/1572-Microscopy-in-2011-The-Imaging-Suite-is-the-Microscope/

!Description
Today, imaging suites that control the microscope, camera, focusing mechanism, and sample positioning stages do not just serve the microscope—They define its capabilities and that of the application, and the suites are growing increasingly vertical in their focus. Examples include Metamorph and MetaFluor (Molecular Devices, Sunnyvale, CA), μManager (Vale Laboratory, University of California at San Francisco), ScanImage (HHMI Janelia Farm, Ashburn, VA), and SlideBook™ suite (Intelligent Imaging Innovations, Denver, CO), all of which support an impressive array of hardware from manufacturers committed to users’ quick productivity.
http://htmljs.tiddlyspace.com/jquery.js
http://htmljs.tiddlyspace.com/htmljs-wikiupgrade.js
!URL
http://www.materialsviews.com/details/news/969647/Cell_Studies_with_Fluorescence_Correlation_Spectroscopy.html

!Description
Cell Studies with Fluorescence Correlation Spectroscopy

by Guido Fuchs published: 2011-01-07
thumbnail image: Cell Studies with Fluorescence Correlation Spectroscopy

Text contributed by K. Maedefessel-Herrmann.

Since its advent more than 30 years ago, Fluorescence Correlation Spectroscopy (FCS) has developed into a versatile single molecule technique with numerous novel extensions, suiting a broad spectrum of applications. The high temporal and spatial resolution in combination with noninvasiveness and specificity makes it an ideal tool to study the dynamics, local concentrations and interactions of labeled molecules in vivo. Petra Schwille and colleagues from BIOTEC, Dresden University of Technology, and Max Planck Institute for Biophysical Chemistry, Göttingen (Germany) now give a comprehensive review how FCS and Fluorescence Cross-correlation Spectroscopy (FCCS) can be applied to the living cell and give an overview on a range of recent technical advancements. Practical issues an
!URL
http://www.sciencedaily.com/releases/2010/01/100122102427.htm

!Description
A team of researchers from the Max Planck Institute of Biochemistry, in Germany, led by the Spanish physicist Rubén Fernández-Busnadiego, has managed to obtain 3D images of the vesicles and filaments involved in communication between neurons. The method is based on a novel technique in electron microscopy, which cools cells so quickly that their biological structures can be frozen while fully active.
!URL
http://www.opticsinfobase.org/abstract.cfm?uri=CLEO-2010-CFM7

!Description
!URL
http://connectomeviewer.org/viewer

!Description
The Connectome Viewer connects Multi-Modal Multi-Scale Neuroimaging and Network Datasets For Analysis and Visualization in Python.
As the [[Contrast transfer function]] is determined by the Cs lens abberation (which cannot be influenced) and the focus (which can be influences)  it is possible to increase the resolution to the [[information limit]] by creating a focus series.

[img[http://tiddly.vanwill.com/uploads/workspace/default/FocusSeries.JPG][EmbeddedImages]]
A [[SiteIcon|SiteIcon tiddler]]@glossary helps provide some identity to your space.  Ideally it'd be a square and a minimum of 48*48 pixels size.  You can upload your site icon using the uploader below.

<<binaryUploadPublic title:SiteIcon>>
<html><hr><html>
!URL
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2492583/

!Description
<html>
<img src="http://en.wikipedia.org/wiki/File:Simple_harmonic_motion_animation.gif">
</html>
!URL
http://mdpp.med.nyu.edu/

!Description
!URL
http://www.microscopy-news.com/news/lucid-s-cellular-imaging-technology-part-of-german-association-of-scientific-medical-societies-dermatological-guidelines.html

!Description
The “Confocal Laser Microscopy in Dermatology” guidelines published by the AWMF under the auspices of the German Dermatological Society (DDG), for the first time combines the extensive knowledge of practical application and clinical research. In addition to information about the operating principles of CLSM and the currently available devices (VivaScope 1500, VivaScope 1500 Multilaser, VivaScope 3000 and VivaScope 2500 Multilaser, commercially available in Europe, the Middle East and Northern Africa from Lucid’s business partner, MAVIG, and in the rest of the world from Lucid directly), the guidelines also contain detailed explanations of examination and diagnostic techniques along with evidence-based findings in the most important in vivo and ex vivo application areas.
!URL
http://www.nanowerk.com/news/newsid=18098.php

!Description
!URL
http://www.microscopy-news.com/news/carl-zeiss-receives-iarpa-rundd-contract-for-its-gas-field-ion-source-gfis-technology.html

!Description
Carl Zeiss today announced that it has been awarded a $22.6 million contract to develop certain nano manufacturing and imaging applications based on its revolutionary ORION™ Gas Field Ion Source (GFIS) technology. The contract was awarded to US-based Carl Zeiss NTS, LLC by the Intelligence Advanced Research Projects Activity (IARPA) under the Circuit Analysis Tool (CAT) program
!URL
http://www.microscopy-news.com/news/jeol-asean-technical-center-to-open-at-thailand-science-park-tsp-.html

!Description
November 2, 2011. -- JEOL Ltd. (Gon’emon Kurihara, President) announced that their proposal to open a technical center, JEOL ASEAN Technical Center, in Thailand has been approved by the country's National Science and Technology Development Agency (NSTDA). Since 2004, the Thai government has stepped up their effort in developing technologies under the National Science and Technology Strategic Plan 2004-2013. Meanwhile, JEOL products, including electron microscopes, mass spectrometers, and NMR systems, have been widely used throughout Southeast Asia. The technical center will open at the Thailand Science Park (TSP) operated by the NSTDA, and will be used as a bases to provide technical support to the NSTDA, corporations, research institutes, and Japanese high tech firms in Southeast Asia and India. It will also upgrade and expand the research infrastructure in the area for local technological development.
!URL
http://www.microscopy-news.com/news/caltech-group-applies-new-techniques-and-sees-surprises-in-cell-division.html

!Description
September 8, 2011 - PASADENA, Calif. — Researchers at the California Institute of Technology (Caltech) have obtained the first high-resolution, three-dimensional images of a cell with a nucleus undergoing cell division. The observations, made using a powerful imaging technique in combination with a new method for slicing cell samples, indicate that one of the characteristic steps of mitosis is significantly different in some cells.
/***
!Description
due to bug in nodejs tags within a pre tag are interpretted as html rather than text. This fixes that with one line of code.
***/
$(document).ready(function() {
//$("#text-html pre").each(function(i, el) { var html = $(el).html(); $(el).text(html) });
});
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<title>Account</title>
	<link href="/bags/common/tiddlers/profile.css" type='text/css' rel='stylesheet' >
	<link href="/bags/common/tiddlers/admin.css" type='text/css' rel='stylesheet' >
	<link href="/bags/common/tiddlers/jquery-ui.custom.css" type='text/css' rel='stylesheet' >
	<script type="text/javascript" src="/bags/common/tiddlers/backstage.js"></script>
</head>
<body>

<div id="container">
	<div class="main section">
		<a class="app" href="/apps">back to apps</a>
		<div class="left">
		<h2>Find Space</h2>
		<form class="spaceSearch">
			<input class="inputBox" type="text" placeholder="find space" />
			<a href="http://docs.tiddlyspace.com/What%20is%20a%20Space%3F" class="help"
				title="What is a space?">What is a space?</a>
		</form>
		<h2>Create New Space</h2>
		<form class="ts-spaces">
			<input class="inputBox" type="text" name="spacename" placeholder="space name"><span class="hostSuffix">.tiddlyspace.com</span>
			<input type="submit" value="Create Space" />
		</form>
		</div>
		<div class="right">
		<h2>Change Password</h2>
		<form class="ts-password">
			<input class="inputBox" placeholder="existing password" type="password" name="password">
			<input class="inputBox" placeholder="new password" type="password" name="new_password">
			<input class="inputBox" placeholder="new password"	type="password" name="new_password_confirm">
			<input type="submit" value="Change password">
		</form>
		<h2>OpenID</h2>
		<h3>Why OpenID?</h3>
		<a href="http://openid.net/"><img src="/bags/common/tiddlers/openid.png" alt="openid" ></a><br />
		Use just one username and password across hundreds of OpenID-enabled sites.<br />
		It's an open standard.<br />
		<a href="http://openid.net/what/">learn more</a>
		<ul class="ts-identities"></ul>
		<form class="ts-openid" target="_top">
			<div>
				Add an openid:
			</div>
			<input class="inputBox" type="text" name="openid" placeholder="your openid" />
			<input type="submit" value="Register" />
			<a href="http://openid.net/get-an-openid/" class="help"
			title="What is an open id?">What is an open id?</a>
		</form>
		</div>
		<div class="clear"></div>
	</div>
</div>
<script type='text/javascript' src='/bags/common/tiddlers/jquery.js'></script>
<script type='text/javascript' src='/bags/common/tiddlers/jquery-json.js'></script>
<script type='text/javascript' src='/bags/tiddlyspace/tiddlers/chrjs'></script>
<script type='text/javascript' src='/bags/common/tiddlers/chrjs.space'></script>
<script type='text/javascript' src='/bags/common/tiddlers/chrjs.users'></script>
<script type='text/javascript' src='/bags/common/tiddlers/chrjs.identities'></script>
<script type='text/javascript' src="/bags/common/tiddlers/jquery-ui.custom.js"></script>
<script type='text/javascript' src='/bags/common/tiddlers/ts.js'></script>
<script type="text/javascript">
/*
 * jQuery UI Autocomplete HTML Extension
 *
 * Copyright 2010, Scott González (http://scottgonzalez.com)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * http://github.com/scottgonzalez/jquery-ui-extensions
 */
(function( $ ) {

var proto = $.ui.autocomplete.prototype,
	initSource = proto._initSource;

function filter( array, term ) {
	var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
	return $.grep( array, function(value) {
		return matcher.test( $( "<div>" ).html( value.label || value.value || value ).text() );
	});
}

$.extend( proto, {
	_initSource: function() {
		if ( this.options.html && $.isArray(this.options.source) ) {
			this.source = function( request, response ) {
				response( filter( this.options.source, request.term ) );
			};
		} else {
			initSource.call( this );
		}
	},

	_renderItem: function( ul, item) {
		return $( "<li></li>" )
			.data( "item.autocomplete", item )
			.append( $( "<a></a>" )[ this.options.html ? "html" : "text" ]( item.label ) )
			.appendTo( ul );
	}
});

})( jQuery );

/***
_accounts application specific javascript
***/
ts.init(function(ts) {
	if(ts.user.anon) { // redirect to homepage when user not logged in
		window.location = ts.getHost();
	}
	$(".hostSuffix").text("." + ts.getHost("").split("//")[1]);
	ts.getSpaces(function(spaces) {
		$("<div class='info' />").text("You have " + spaces.length + " spaces.").insertBefore($(".spaceSearch")[0]);
		$("form.spaceSearch input").autocomplete({
			html: true,
			source: function(req, response) {
				ts.getSpaces(function(spaces) {
					var selected = [];
					for(var i = 0; i < spaces.length; i++) {
						var space = spaces[i];
						if(space.name.indexOf(req.term) > -1) {
							var host = ts.getHost(space.name) ;
							var img = host + "/SiteIcon";
							selected.push({
								value: space.name,
								label: '<a href="' + host + '" target="_parent" class="autocompleteLink"><img src="' + img + '" style="height:24px;width:auto;max-height:24px;max-width:24px;"/>' + space.name + '</a>'
							});
						}
					}
					response(selected);
				});
			},
			select: function(event, ui) {
				window.top.location = ts.getHost(ui.item.value);
			}
		});
	});
});

if(window != window.top) {
	$("html").addClass("iframeMode");
	$("a").live("click",function(ev) {
		$(ev.target).attr("target", "_parent");
	});
}
</script>
<!--[if lt IE 8]>
<script type="text/javascript" src="/bags/common/tiddlers/json2.js"></script>
<![endif]-->
</body>
</html>
!URL
http://www.microscopy-news.com/news/witec-introduces-true-surface-microscopy-.html

!Description
WITec, worldwide leader in nano-analytical microscopy systems, has launched the new True Surface Microscopy option. The core element of this revolutionary imaging mode is an integrated sensor for optical profilometry. Large-area topographic coordinates from the profilometer measurement can be precisely correlated with the large-area confocal Raman imaging data. This allows for the first time confocal Raman imaging along heavily inclined or very rough samples with the true surface held in constant focus while maintaining the highest confocality. With the new imaging mode, samples that had previously required extensive preparation in order to obtain a certain surface flatness can now be effortlessly and automatically characterized as they are. Complete system control as well as extensive data evaluation are integrated within the WITec Control and WITec Project software environment, guaranteeing renowned ease-of-use.

“The integrated combination of optical profilometry and large-area conf
version.extensions.ta = {
	//VERSION
	major: 0, 
	minor: 1, 
	revision: 0, 
	date: new Date(2006,5,24),
	name:"TableAggregate",
	author:"MarceloAdamatti",
	source:"http://adamatti.tiddlyspot.com/#TableAggregatePlugin"	
}
config.macros.ta = {
	counter:0,
	//PROCESS ROW
	processR:function(funcao,idDiv){
		var div = document.getElementById("div" + idDiv);
		var td = div.parentNode;
		while(td.tagName!="TD" && td.tagName!="TH"){
			td=td.parentNode;	
		}
		var tr = td.parentNode;
		for (var i=0;i<tr.childNodes.length;i++){
			var aux = tr.childNodes[i];
			if (aux.tagName=="TD" || aux.tagName=="TH") {	
				try{	
					var x=0;
					if(document.all){
						x = parseFloat(aux.innerText);			
					}else{
						x = parseFloat(aux.textContent);			
					}
					if (!isNaN(x))
						funcao.process(x);
				}catch(e){}
			}
		}
		div.innerHTML=funcao.resultado.toFixed(2);
	},
	//PROCESS COL
	processC:function(funcao,idDiv){
		var div = document.getElementById("div" + idDiv);
		var td = div.parentNode;
		while(td.tagName!="TD" && td.tagName!="TH")
			td=td.parentNode;		
		var coluna = td.cellIndex;
		var tbody = td.parentNode.parentNode;
		for (var i=0;i<tbody.childNodes.length;i++){	
			var tr = tbody.childNodes[i];
			var aux = tr.childNodes[coluna];
			if (aux.tagName=="TD" || aux.tagName=="TH") {	
				try{	
					var x=0;
					if(document.all){
						x = parseFloat(aux.innerText);			
					}else{
						x = parseFloat(aux.textContent);			
					}
					if (!isNaN(x))
						funcao.process(x);
				}catch(e){}
			}
		}
		div.innerHTML=funcao.resultado.toFixed(2);
	},
	//FUNCTIONS
	funcs:{
		avg:function() {
			this.qtd=0;
			this.somador=0;
			this.resultado=0;
			this.process=function (valor){
				this.somador+=parseFloat(valor);
				this.qtd++;
				this.resultado=(this.somador/this.qtd);
			}				
		},
		sum:function (){
			this.resultado=0;	
			this.process=function (valor){
				this.resultado+=valor;
			}	
		},
		mul:function (){
			this.resultado=0;	
			this.process=function (valor){
				if (this.resultado > 0 )
					this.resultado=this.resultado * valor;
				if (this.resultado==0)
					this.resultado=valor;
			}	
		},
		min: function(){
			this.resultado="";
			this.process=function (valor){
				if (this.resultado=="")
					this.resultado=valor;
				if (valor<=this.resultado)
					this.resultado=valor;
			}
		},
		max:function(){
			this.resultado="";
			this.process=function (valor){
				if (this.resultado=="")
					this.resultado=valor;
				if (valor>=this.resultado)
					this.resultado=valor;
			}
		},
		count: function(){
			this.resultado=0;
			this.process=function (valor){
				this.resultado+=1;
			}
		}
	},
	handler:function(place,macroName,params) {
		var rowCol = params[0].toUpperCase();
		var func = params[1].toLowerCase();
		var counter=++config.macros.ta.counter;
		place.innerHTML="<div id=div" + counter + "></div><iframe "
					  + "onload='{var o=new config.macros.ta.funcs." + func + "();"
					  + "config.macros.ta.process" + rowCol + "(o," + counter + ");}' "
					  + "style='display:none'>"
					  "<\/iframe>";
	}
};
TEM
Application written by Max in Delphi. Used primairly in cryo life
science. Very rare usage in material science on sensitive materials.
Typical usage:

1) Focus on two different spots (certain distance of
the area of interest)
2) Assume the sample is linearly aligned with
the two focus spots.
3) Briefly (typically 1 second) expose the region
of interest using the average focus of step 1)
!UserUnplugged
<<TiddlySpaceLogin>>

!SpaceUnplugged
{{unpluggedSpaceTab{
{{wizard{
<<image unsyncedIcon width:48>> <<message messages.syncExplanation>>
}}}
{{wizard syncKey{
{{keyHeading{
Key}}}
{{changedServer keyItem{<<message macros.sync.syncStatusList.changedServer.text>>}}} {{changedBoth keyItem{<<message macros.sync.syncStatusList.changedBoth.text>>}}} {{changedLocally keyItem{<<message macros.sync.syncStatusList.changedLocally.text>>}}} {{notFound keyItem{<<message macros.sync.syncStatusList.notFound.text>>}}}
}}}
<<sync>>

!User
{{textRight{
<<TiddlySpaceLogout>>
<<tabs txtUserTab
	"Your Identities" "Manage your identities" [[Backstage##Identities]]
	"Your Spaces" "Maintain your spaces and create new ones" [[Backstage##UserSpaces]]
	"Your Password" "Change your password" [[Backstage##Password]]
>>
}}}

!Menu
{{tiddlyspaceMenu{
<<message messages.memberStatus>> <<homeLink>>
{{unsyncedList{<<message messages.syncListHeading>> <<list filter [is[unsynced]]>>}}}

<<tabs txtTiddlySpaceTab
search "search across TiddlySpace" Backstage##Search
help "quick access to useful space resources" Backstage##Resources
>>
running TiddlySpace@glossary version <<message extensions.tiddlyweb.status.tiddlyspace_version>>
}}}

!Resources
[[blog|@@blog]]
[[documentation|@@docs]]
[[featured spaces|@@featured]]

!Search
<<tsSearch>>

!Space
<<followSpace>>
<<tabs txtSpaceTab
	members Members Backstage##SpaceMembers
	includes "include spaces" Backstage##SpaceInclusions
	tiddlers "tiddlers control panel" Backstage##Tiddlers
	plugins "Manage installed plugins" PluginManager
	batch "Perform batch operations on public/private tiddlers" Backstage##BatchOps
	options "TiddlyWiki options" Backstage##Options
	tweaks "Tweak the appearance and behaviour of TiddlyWiki" AdvancedOptions
	import "Import tiddlers from a TiddlyWiki" Backstage##FileImport
	export "Export this TiddlySpace for offline use" Backstage##Export
>>

!FileImport
<<fileImport>>

!Export
You can download this TiddlySpace as an offline TiddlyWiki:
{{chunkyButton{<<exportSpace>>}}}

!Identities
You can associate your account with multiple identities. If you have an open id for example you could log into TiddlySpace with that as well as a TiddlySpace user account.
<<TiddlySpaceIdentities add>>
{{inlineList{
	<<TiddlySpaceIdentities list>>
}}}
{{backstageClear{}}}

!Login
<<tabs txtLoginTab 
"TiddlySpace Username" "Login via a TiddlySpace username and password" Backstage##UserUnplugged
"OpenID" "Login via an OpenID"  Backstage##TabOpenID
"Register" "Register a TiddlySpace account" Backstage##TabRegister
>>

!TabOpenID
<<TiddlySpaceLogin openid>>

!TabRegister
<<TiddlySpaceRegister>>

!Options
upload a <<message messages.privacySetting>> file:
<<binaryUpload>>
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>

!Password
<<TiddlySpaceChangePassword>>

!SpaceInclusions
This space includes the public tiddlers from the following spaces:
<<TiddlySpaceInclusion list>>
<<TiddlySpaceInclusion passive>>

!SpaceMembers
The following people are members of the space ''<<message extensions.tiddlyspace.currentSpace.name>>''. Only members have access to the private tiddlers in a space.
<<TiddlySpaceMembers list>>
<<TiddlySpaceMembers add>>

!Tiddlers
<<tabs
	txtMainTab
	"Recent" "Recently edited tiddlers" TabTimeline
>>

!BatchOps
<<tabs
	txtPublisherTab
	"Private" "Move tiddlers from private to public" Backstage##BatchPrivate
	"Public" "Move tiddlers from public to private" Backstage##BatchPublic
>>

!BatchPrivate
<<TiddlySpacePublisher type:private>>

!BatchPublic
<<TiddlySpacePublisher type:public>>

!UserSpaces
<<TiddlySpaceSpaces add>>
You are currently a member of the following spaces.
{{inlineList{
<<TiddlySpaceSpaces list>>
}}}
{{backstageClear{}}}
/***
|Name|TagCloudPlugin|
|Source|http://www.TiddlyTools.com/#TagCloudPlugin|
|Version|1.7.0|
|Author|Eric Shulman|
|Original Author|Clint Checketts|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|present a 'cloud' of tags (or links) using proportional font display|
!Usage
<<<
{{{
<<cloud type action:... limit:... tag tag tag ...>>
<<cloud type action:... limit:... +TiddlerName>>
<<cloud type action:... limit:... -TiddlerName>>
<<cloud type action:... limit:... =tagvalue>>
}}}
where:
* //type// is a keyword, one of:
** ''tags'' (default) - displays a cloud of tags, based on frequency of use
** ''links'' - displays a cloud of tiddlers, based on number of links //from// each tiddler
** ''references'' - displays a cloud of tiddlers, based on number of links //to// each tiddler
* ''action:popup'' (default) - clicking a cloud item shows a popup with links to related tiddlers<br>//or//<br> ''action:goto'' - clicking a cloud item immediately opens the tiddler corresponding to that item
* ''limit:N'' (optional) - restricts the cloud display to only show the N most popular tags/links
* ''tag tag tag...'' (or ''title title title'' if ''links''/''references'' is used)<br>shows all tags/links in the document //except// for those listed as macro parameters
* ''+TiddlerName''<br>show only tags/links read from a space-separated, bracketed list stored in a separate tiddler.
* ''-TiddlerName''<br>show all tags/links //except// those read from a space-separated, bracketed list stored in a separate tiddler.
* ''=tagvalue'' (//only if type=''tags''//)<br>shows only tags that are themselves tagged with the indicated tag value (i.e., ~TagglyTagging usage)
//note: for backward-compatibility, you can also use the macro {{{<<tagCloud ...>>}}} in place of {{{<<cloud ...>>}}}//
<<<
!Examples
<<<
//all tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud systemConfig excludeMissing script>>}}}
//top 10 tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud limit:10 systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud limit:10 systemConfig excludeMissing script>>}}}
//tags listed in// [[FavoriteTags]]
{{{<<cloud +FavoriteTags>>}}}
{{groupbox{<<cloud +FavoriteTags>>}}}
//tags NOT listed in// [[FavoriteTags]]
{{{<<cloud -FavoriteTags>>}}}
{{groupbox{<<cloud -FavoriteTags>>}}}
//links to tiddlers tagged with 'package'//
{{{<<cloud action:goto =package>>}}}
{{groupbox{<<cloud action:goto =package>>}}}
//top 20 most referenced tiddlers//
{{{<<cloud references limit:20>>}}}
{{groupbox{<<cloud references limit:20>>}}}
//top 20 tiddlers that contain the most links//
{{{<<cloud links limit:20>>}}}
{{groupbox{<<cloud links limit:20>>}}}
<<<
!Revisions
<<<
2009.07.17 [1.7.0] added {{{-TiddlerName}}} parameter to exclude tags that are listed in the indicated tiddler
2009.02.26 [1.6.0] added {{{action:...}}} parameter to apply popup vs. goto action when clicking cloud items
2009.02.05 [1.5.0] added ability to show links or back-links (references) instead of tags and renamed macro to {{{<<cloud>>}}} to reflect more generalized usage.
2008.12.16 [1.4.2] corrected group calculation to prevent 'group=0' error
2008.12.16 [1.4.1] revised tag filtering so excluded tags don't affect calculations
2008.12.15 [1.4.0] added {{{limit:...}}} parameter to restrict the number of tags displayed to the top N most popular
2008.11.15 [1.3.0] added {{{+TiddlerName}}} parameter to include only tags that are listed in the indicated tiddler
2008.09.05 [1.2.0] added '=tagname' parameter to include only tags that are themselves tagged with the specified value (i.e., ~TagglyTagging usage)
2008.07.03 [1.1.0] added 'segments' property to macro object.  Extensive code cleanup
<<<
!Code
***/
//{{{
version.extensions.TagCloudPlugin= {major: 1, minor: 7 , revision: 0, date: new Date(2009,7,17)};
//Originally created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
//Currently maintained and enhanced by Eric Shulman
//}}}
//{{{
config.macros.cloud = {
	tagstip: "%1 tiddlers tagged with '%0'",
	refslabel: " (%0 references)",
	refstip: "%1 tiddlers have links to '%0'",
	linkslabel: " (%0 links)",
	linkstip: "'%0' has links to %1 other tiddlers",
	groups: 9,
	init: function() {
		config.macros.tagCloud=config.macros.cloud; // for backward-compatibility
		config.shadowTiddlers.TagCloud='<<cloud>>';
		config.shadowTiddlers.StyleSheetTagCloud=
			'/*{{{*/\n'
			+'.tagCloud span {line-height: 3.5em; margin:3px;}\n'
			+'.tagCloud1{font-size: 80%;}\n'
			+'.tagCloud2{font-size: 100%;}\n'
			+'.tagCloud3{font-size: 120%;}\n'
			+'.tagCloud4{font-size: 140%;}\n'
			+'.tagCloud5{font-size: 160%;}\n'
			+'.tagCloud6{font-size: 180%;}\n'
			+'.tagCloud7{font-size: 200%;}\n'
			+'.tagCloud8{font-size: 220%;}\n'
			+'.tagCloud9{font-size: 240%;}\n'
			+'/*}}}*/\n';
		setStylesheet(store.getTiddlerText('StyleSheetTagCloud'),'tagCloudsStyles');
	},
	getLinks: function(tiddler) { // get list of links to existing tiddlers and shadows
		if (!tiddler.linksUpdated) tiddler.changed();
		var list=[]; for (var i=0; i<tiddler.links.length; i++) {
			var title=tiddler.links[i];
			if (store.isShadowTiddler(title)||store.tiddlerExists(title))
				list.push(title);
		}
		return list;
	},
	handler: function(place,macroName,params) {
		// unpack params
		var inc=[]; var ex=[]; var limit=0; var action='popup';
		var links=(params[0]&&params[0].toLowerCase()=='links'); if (links) params.shift();
		var refs=(params[0]&&params[0].toLowerCase()=='references'); if (refs) params.shift();
		if (params[0]&&params[0].substr(0,7).toLowerCase()=='action:')
			action=params.shift().substr(7).toLowerCase();
		if (params[0]&&params[0].substr(0,6).toLowerCase()=='limit:')
			limit=parseInt(params.shift().substr(6));
		while (params.length) {
			if (params[0].substr(0,1)=='+') { // read taglist from tiddler
				inc=inc.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='-') { // exclude taglist from tiddler
				ex=ex.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='=') { // get tag list using tagged tags
				var tagged=store.getTaggedTiddlers(params[0].substr(1));
				for (var t=0; t<tagged.length; t++) inc.push(tagged[t].title);
			} else ex.push(params[0]); // exclude params
			params.shift();
		}
		// get all items, include/exclude specific items
		var items=[];
		var list=(links||refs)?store.getTiddlers('title','excludeLists'):store.getTags();
		for (var t=0; t<list.length; t++) {
			var title=(links||refs)?list[t].title:list[t][0];
			if (links)	var count=this.getLinks(list[t]).length;
			else if (refs)	var count=store.getReferringTiddlers(title).length;
			else 		var count=list[t][1];
			if ((!inc.length||inc.contains(title))&&(!ex.length||!ex.contains(title)))
				items.push({ title:title, count:count });
		}
		if(!items.length) return;
		// sort by decending count, limit results (optional)
		items=items.sort(function(a,b){return(a.count==b.count)?0:(a.count>b.count?-1:1);});
		while (limit && items.length>limit) items.pop();
		// find min/max and group size
		var most=items[0].count;
		var least=items[items.length-1].count;
		var groupSize=(most-least+1)/this.groups;
		// sort by title and draw the cloud of items
		items=items.sort(function(a,b){return(a.title==b.title)?0:(a.title>b.title?1:-1);});
		var cloudWrapper = createTiddlyElement(place,'div',null,'tagCloud',null);
		for (var t=0; t<items.length; t++) {
			cloudWrapper.appendChild(document.createTextNode(' '));
			var group=Math.ceil((items[t].count-least)/groupSize)||1;
			var className='tagCloudtag tagCloud'+group;
			var tip=refs?this.refstip:links?this.linkstip:this.tagstip;
			tip=tip.format([items[t].title,items[t].count]);
			if (action=='goto') { // TAG/LINK/REFERENCES GOTO
				var btn=createTiddlyLink(cloudWrapper,items[t].title,true,className);
				btn.title=tip;
				btn.style.fontWeight='normal';
			} else if (!links&&!refs) { // TAG POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,onClickTag,className);
				btn.setAttribute('tag',items[t].title);
			} else { // LINK/REFERENCES POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,
					function(ev) { var e=ev||window.event; var cmt=config.macros.cloud;
						var popup = Popup.create(this);
						var title = this.getAttribute('tiddler');
						var count = this.getAttribute('count');
						var refs  = this.getAttribute('refs')=='T';
						var links = this.getAttribute('links')=='T';
						var label = (refs?cmt.refslabel:cmt.linkslabel).format([count]);
						createTiddlyLink(popup,title,true);
						createTiddlyText(popup,label);
						createTiddlyElement(popup,'hr');
						if (refs) {
							popup.setAttribute('tiddler',title);
							config.commands.references.handlePopup(popup,title);
						}
						if (links) {
							var tiddler = store.fetchTiddler(title);
							var links=config.macros.cloud.getLinks(tiddler);
							for(var i=0;i<links.length;i++)
								createTiddlyLink(createTiddlyElement(popup,'li'),
									links[i],true);
						}
						Popup.show();
						e.cancelBubble=true; if(e.stopPropagation) e.stopPropagation();
						return false;
					}, className);
				btn.setAttribute('tiddler',items[t].title);
				btn.setAttribute('count',items[t].count);
				btn.setAttribute('refs',refs?'T':'F');
				btn.setAttribute('links',links?'T':'F');
				btn.title=tip;
			}
		}
	}
};
//}}}
Enegery
loss < 100eV

Here, the electrons that have induced plasmon
oscillations occur. Since the plasmon generation is the most frequent
inelastic interaction of electron with the sample, the intensity in
this region is relatively high. Intensity and number of plasmon peaks
increases with specimen thickness.
ColorPalette
StyleSheet
SiteSubtitle
GettingStarted
SiteTitle
MainMenu
SiteIcon
DefaultTiddlers
ViewTemplate
PageTemplate
SideBarOptions
EditTemplate
SiteInfo
SideBarTabs
ToolbarCommands
In [[Fluorescence microscopy]] ''widefield imaging'' is the imaging mode where the sample is illuminated as a whole with a parallel beam:

<<QuickTimeFragment  "/static/files/Microscopy/2008.02.20-mse640-l4.mp4">>

Find the slides at:
/static/files/Microscopy/2008.02.20-mse640-l4.pdf
Orignally copied material from: http://nanohub.org/resources/4092
!URL
http://ht.ly/2B6U9

!Description
You can change the title and subtitle of your space, this will be visible to people visiting your space as well as being what is shown the browser tabs.  The content these are stored in two tiddlers, clicking on the links below will open up these tiddlers which you can edit to make changes.
* [[SiteTitle]]
* [[SiteSubtitle]]
<html><hr><html>
!URL
http://www.microscopy-news.com/news/true-surface-microscopy-wins-pittcon-2011-editor-s-gold-award.html

!Description
WITec´s new True Surface Microscopy mode allows confocal Raman imaging guided by surface topography. True Surface Microscopy follows the surface topography with high precision, so that even rough or inclined samples always stay in focus while performing confocal Raman imaging. To achieve this unique capability, the WITec alpha500 series integrates a highly precise sensor for optical profilometry. The topographic coordinates from the profilometer measurement are used to perfectly follow the sample surface in confocal Raman imaging mode. The result is an image revealing optical or chemical properties at the surface of the sample, even if this surface is very rough or heavily inclined. On such surfaces this information was only partially accessible thus far and with the new imaging mode, samples that had previously required extensive preparation in order to obtain a certain surface flatness can now be effortlessly and automatically characterized as they are
!URL
http://www.nanowerk.com/news2/newsid=26106.php

!Description
(Nanowerk News) A novel X-ray microscope at DESY offers the world's sharpest X-ray vision: Thanks to the extraordinary brilliance of DESY's X-ray source PETRA III, this microscope is able to resolve details as small as ten nanometres – which is about ten thousand times thinner than a human hair. Only few facilities worldwide are able to reach a comparable optical resolution.


Read more: http://www.nanowerk.com/news2/newsid=26106.php#ixzz22nJ1jwQY
!URL
http://www.biochem.mpg.de/en/rd/baumeister/tom_e/

!Description
[[TEM]]
<!DOCTYPE html>
<html manifest="/bags/common/tiddlers/takenote_manifest.appcache">
	<head>
		<title>takenote</title>
		<link rel="stylesheet" href="/bags/common/tiddlers/notabene.css" />
		<link rel="apple-touch-icon" href="/bags/common/tiddlers/touchicon_takenote.png"/>
		<link rel="apple-touch-icon-precomposed" href="/bags/common/tiddlers/touchicon_takenote.png"/>
		<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=0,initial-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
	</head>
	<body>
		<ul id="backstage">
			<!-- no not add a newline between li elements or you will get a margin with inline blocks -->
			<li><a href="/dashboard">dashboard</a></li><li><a href="/takenote">takenote</a></li>
			<li><a class='connectionStatus'></a></li>
		</ul>
		<div class="takenotecontainer">
			<div class='messageArea'></div>
			<div id="note">
				<div class="toolbar">
					<a id="cancelnote" title="cancel this note">cancel</a>
					<a id="deletenote" title="delete this note">delete</a>
					<a id="newnote" title="complete this note">complete</a>
				</div>
				<div class="note_title_container">
					<textarea class="note_title" placeholder="Note Title"></textarea>
				</div>
				<div id="notebody">
					<span class="notedate"></span> 
					<textarea class="note_text" placeholder="Write here..."></textarea>
				</div>
				<div id="tips">
				<div>Tips for cleverer notes:
				''<span class="boldTip">bold</span>'' //<span class="italicTip">italic</span>// _<span class="underlineTip">underline</span>_ #tag</div>
				<div>[[<a href="http://tiddlyspace.com">Link Name</a>|http://tiddlyspace.com]]
				[[<a href="/Note title">Note title</a>]] <span class="imageTip">[img[/SiteIcon<img src="/SiteIcon" />]]</span></div>
				</div>
				<div id="notemeta"></div>
				<div style="display:none">
				  <a class="syncButton"></a>
				</div>
			</div>
		</div>
		<noscript>
			Takenote requires javascript to work correctly. Sorry!
		</noscript>
		<script src="/bags/common/tiddlers/backstage.js" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/common/tiddlers/bookmark_bubble.js" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/common/tiddlers/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/tiddlyspace/tiddlers/chrjs" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/common/tiddlers/chrjs-store.js" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/common/tiddlers/jquery-json.js" type="text/javascript" charset="utf-8"></script>
		<script src="/bags/common/tiddlers/notabene.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var takenote;
			takenote = notes($(".takenotecontainer")[0], {
				host: "/"
			});
		</script>
	</body>
</html>
!URL
http://biosciencetechnology.com/News/2011/05/Atomic-scale-Structures-of-Ribosome-Could-Help-Improve-Antibiotics/?utm_source=twitterfeed&utm_medium=twitter

!Description
This is first time we’ve seen the ribosome at the endpoint of this motion at this resolution,” says Cate. “And the question is, when you have these big motions, why doesn’t the ribosome fall apart. We found that the ribosome has RNA springs that adjust their shape and allow it to stay together during these large-scale motions.”
Phase contrast in images arises from differences in phase between scattered and unscattered rays in different parts of the image and interference between these rays. In a fully transparent (i.e. no variation in refractive index) object, there are no phase differences and, hence no phase contrast in the image

[img[http://tiddly.vanwill.com/uploads/workspace/default/phasecontrast.JPG][EmbeddedImages]]

Illustration of electron wave passing through under phase object approximation. The phase changes (contrast) is imaged.

[[Defocus]]ing, in which path lengths for scattered rays are changed more than for the unscattered rays, can be used to enhance phase contrast. Contrast due to phase differences is more important for thin objects and when working near the resolution limit than contrast due to amplitude differences.
!URL
http://www.cloudpak.com/

!Description
What if you could view, share, and annotate all of your image data anywhere, anytime, for dramatically lower cost and trouble than doing it yourself?

Coming soon - the Cloudpak MIST service for your 2D, 3D, and 4D high precision multispectral image data.
/***
|''Name''|TiddlySpaceBackstage|
|''Version''|0.8.0|
|''Description''|Provides a TiddlySpace version of the backstage and a homeLink macro|
|''Status''|@@beta@@|
|''Contributors''|Jon Lister, Jon Robson, Colm Britton|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceBackstage.js|
|''Requires''|TiddlySpaceConfig ImageMacroPlugin TiddlySpaceViewTypes|
!StyleSheet
.publicLightText {
	color: #C0E5FC;
}

.privateLightText {
	color: #E2C1D6;
}

.tiddler .error.annotation .button{
	display: inline-block;
}

#backstageArea #backstageToolbar a.task_tiddlyspace {
	margin: 0px auto auto -75px;
	font-weight: bold;
	width: 150px;
	line-height:24px;
	font-size: 1.2em;
	padding: 0;
	top: 0;
	position: absolute;
	left: 50%;
}

.task_tiddlyspace .image,
.task_tiddlyspace .svgIcon {
	display: inline;
}

.task_tiddlyspace .svgIconText {
	display: none;
}

.task_tiddlyspace .logoText {
	position: absolute;
	top: 0px;
	margin-left: 5px;
}

#backstageArea {
	z-index: 49;
	color: white;
	background-color: black;
	background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #222),color-stop(0.5, #333),color-stop(1, #555));
	background: -moz-linear-gradient(center bottom,#222 0%, #333 50%, #555 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222);
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222)";
	height: 24px;
	padding: 0;
	border-bottom: solid 1px black;
}

.backstageBackground {
	fill: black;
}

#backstageButton {
	overflow: hidden;
}

#backstageButton #backstageShow,
#backstageButton #backstageHide {
	margin: 0px;
	padding: 0px;
}

#backstageButton #backstageShow:hover,
#backstageButton #backstageHide:hover {
	background: none;
	color: none;
}

#backstageButton img,
#backstageButton svg {
	width: 24px;
	height: 24px;
}

#messageArea {
	top: 50px;
}

#backstageToolbar {
	position: relative;
}

#backstageArea a {
	padding: 0px;
	margin-left: 0px;
	color: white;
	background: none;
}

#backstageArea a:hover {
	background-color: white;
}

#backstage .tabContents ol,
#backstage .tabContents ul {
	padding: auto;
}

#backstageButton a {
	margin: 0;
}

.backstagePanelBody .tabContents ul {
	padding: 5px;
	margin: 5px;
}

#backstage #backstagePanel {
	margin-left: 5%;
	padding: 0em;
	margin-right: 5%;
	text-align: center;
}

#backstageToolbar a {
	position: relative;
}

#backstageArea a.backstageSelTab,
#backstageToolbar .backstageTask {
	line-height: 24px;
	color: #767676;
}

.backstageTask .externalImage,
.backstageTask .image {
	display: inline;
}

.backstageTask .txtUserName,
.backstageTask .spaceName {
	color: #fff;
}

.backstageSelTab .txtUserName,
.backstageSelTab .spaceName,
a:hover .txtUserName,
a:hover .spaceName {
	color: #000;
}

.spaceSiteIcon {
	margin-right: 10px;
}

.userSiteIcon {
	margin-left: 10px;
}

#backstageToolbar .task_space {
	position: absolute;
	top: 0px;
	left: 0%;
}

#backstageToolbar .task_user,
#backstageToolbar .task_login {
	display: block;
	position: absolute;
	top: 0px;
	right: 5%;
}

#backstageToolbar .task_login img {
	position: relative;
	display: inline;
}

#backstageToolbar .task_login img,
#backstageToolbar .task_user img {
	float: right;
}

#backstageToolbar .task_space .svgIcon {
	float: left;
	position: relative;
	z-index: 2;
}

#backstageToolbar a span {
	z-index: 2;
}

#backstageToolbar .spaceSiteIcon {
	float: left;
}

a.backstageTask {
	display: block;
}

#backstageToolbar a span.txtUserName,
#backstageToolbar a .txtUserName span {
	display: inline;
	float: none;
}

#backstage .deleteButton {
	margin-left: 0.3em;
	font-weight: bold;
	color: red;
	font-size: 1.6em;
}

#backstage .deleteButton:hover {
	background: none;
}

#backstageArea .siteIcon {
	display: inline;
}

#backstagePanel .TiddlySpaceLogin {
	display: inline;
}

.backstagePanelBody .tabContents .button {
	display: inline-block;
	margin-right: 10px;
}

.backstagePanelBody .tab {
	margin: 0 0 0 0.6em;
	padding: 0.4em 0.5em 1px 0.5em;
}

#backstage .tabContents {
	padding: 1.5em;
	text-align: left;
}

#backstage table {
	margin: auto;
}

#backstage .wizard table {
	border: 0px;
	margin: 0;
}

#backstage .txtSpaceTab li {
	border: 1px solid #ddd;
	background: #eee;
	list-style: none;
	margin: 0.5em;
	padding: 0.5em;
	width: 80%;
}

#backstage .txtSpaceTab li.annotation {
	border: 2px solid [[ColorPalette::SecondaryMid]];
}

#backstage div  li.listLink {
	border: 0px;
	width: 78%;
	font-size: 0.7em;
}

#backstage div li.listTitle {
	font-weight: bold;
	text-decoration: underline;
	font-size: 1em;
	background: #ccc;
	width: 100%;
}

#backstage div.txtSpaceTab li .deleteButton {
	float: right;
}

#backstage fieldset {
	border: solid 1px [[ColorPalette::Background]];
}

#backstage .viewer table,#backstage table.twtable {
	border: 0px;
}

#backstageToolbar img {
	padding: 0;
}

#backstage .wizard,
#backstage .wizardFooter {
	background: none;
}

.viewer td, .viewer tr, .twtable td, .twtable tr {
	border: 1px solid #eee;
}

#backstage .inlineList ul li {
	background-color: [[ColorPalette::Background]];
	border: solid 1px [[ColorPalette::TertiaryMid]];
	display: block;
	float: left;
	list-style: none;
	margin-right: 1em;
	padding: 0.5em;
}

.backstageClear, .inlineList form {
	clear: both;
	display: block;
	margin-top: 3em;
}

.tiddlyspaceMenu {
	text-align: center;
}

span.chunkyButton {
	display: inline-block;
	padding: 0;
	margin: 0;
	border: solid 2px #000;
	background-color: #04b;
}

span.chunkyButton a.button, span.chunkyButton a:active.button {
	white-space: nowrap;
	font-weight: bold;
	font-size: 1.8em;
	color: #fff;
	text-align: center;
	padding: 0.5em 0.5em;
	margin: 0;
	border-style: none;
	display: block;
}

span.chunkyButton:hover {
	background-color: #014;
}

span.chunkyButton a.button:hover {
	border-style: none;
	background: none;
	color: #fff;
}

a.baskstageTask.task_login,
a.baskstageTask.task_user {
	_width: 200px;
	_text-align: right;
}

#backstageArea #backstageToolbar .task_login img,
#backstageArea #backstageToolbar .task_user img {
	_display: inline;
	_float: none;
}

#backstage .unpluggedSpaceTab .wizard,
.unpluggedSpaceTab .wizard {
	background: white;
	border: 2px solid #CCC;
	padding: 5px;
}

.syncKey .keyItem {
	border: 1px solid black;
	display: inline-block;
	margin: 0.2em;
	padding: 0.1em 0.1em 0.1em 0.1em;
}

.keyHeading {
	font-size: 2em;
	font-weight: bold;
	margin: 0.4em 0em -0.2em;
}

.unpluggedSpaceTab .putToServer,
.unpluggedSpaceTab .notChanged {
	display: none;
}

.tiddlyspaceMenu ul {
	margin: 0;
	padding: 0;
}

.tiddlyspaceMenu ul li {
	list-style: none;
}

.unsyncedChanges .unsyncedList {
	display: block;
}

.unsyncedList {
	display: none;
}

#backstage iframe {
	height: 600px;
	width: 100%;
	border: none;
}
!Code
***/
//{{{
(function($) {
var name = "StyleSheet" + tiddler.title;
config.shadowTiddlers[name] = "/*{{{*/\n%0\n/*}}}*/".
	format(store.getTiddlerText(tiddler.title + "##StyleSheet")); // this accesses the StyleSheet section of the current tiddler (the plugin that contains it)
store.addNotification(name, refreshStyles);

if(!config.extensions.tiddlyweb.status.tiddlyspace_version) { // unplugged
	config.extensions.tiddlyweb.status.tiddlyspace_version = "<unknown>";
	config.extensions.tiddlyweb.status.server_host = {
		url: config.extensions.tiddlyweb.host }; // TiddlySpaceLinkPlugin expects this
}
var disabled_tabs_for_nonmembers = ["PluginManager", "Backstage##FileImport",
	"Backstage##BatchOps", "Backstage##SpaceMembers",
	"TiddlySpaceTabs##Private", "TiddlySpaceTabs##Drafts"];
var tweb = config.extensions.tiddlyweb;
var tiddlyspace = config.extensions.tiddlyspace;
var currentSpace = tiddlyspace.currentSpace.name;
var imageMacro = config.macros.image;

if(config.options.chkBackstage === undefined) {
	config.options.chkBackstage = true;
}

config.tasks.user = {
	text: "user: ",
	tooltip: "user control panel",
	unpluggedText: "unplugged user",
	content: "<html><iframe frameBorder='0' src='" + config.extensions.tiddlyweb.host + "/_account'></iframe></html>"
};

config.tasks.space = {
	text: "space: ",
	tooltip: "space control panel",
	className: "right"
};

config.tasks.tiddlyspace = {
	text: "",
	tooltip: "",
	content: "<<tiddler Backstage##Menu>>"
};

if(window.location.protocol == "file:") {
	config.unplugged = true; // TODO: move into extensions.tiddly{web/space} namespace!?
	config.tasks.space.content = "<<tiddler Backstage##SpaceUnplugged>>";
} else {
	config.tasks.space.content = "<html><iframe frameBorder='0' src='/_space'></iframe></html>";
}
config.backstageTasks = ["tiddlyspace", "user", "space"];

config.messages.backstage.prompt = "";
// initialize state
var _show = backstage.show;
backstage.show = function() {
	// selectively hide backstage tasks and tabs based on user status
	var tasks = $("#backstageToolbar .backstageTask").show();
	if(!config.unplugged) {
		tweb.getUserInfo(function(user) {
			if(user.anon) {
				$(".task_user", tasks).hide();
				tiddlyspace.disableTab(disabled_tabs_for_nonmembers);
			} else {
				$(".task_login", tasks).hide();
			}
		});
	}
	// display backstage
	return _show.apply(this, arguments);
};
if(readOnly) {
	tiddlyspace.disableTab(disabled_tabs_for_nonmembers);
}

var tasks = config.tasks;
var commonUrl = "/bags/common/tiddlers/%0";

// mock out renderAvatar if unavailable -- XXX: temporary hotfix, not a permanent solution!
tiddlyspace.renderAvatar = tiddlyspace.renderAvatar || function() {};

backstage.tiddlyspace = {
	locale: {
		member: "You are a member of this space.",
		nonmember: "You are not a member of this space.",
		loggedout: "You are currently logged out of TiddlySpace.",
		unplugged: "You are unplugged."
	},
	checkSyncStatus: function(tiddler) {
		var bs = backstage.tiddlyspace;
		var t = store.filterTiddlers("[is[unsynced]]");
		var unsyncedList = $("#backstage .tiddlyspaceMenu .unsyncedList");
		if(t.length > 0 && !readOnly) {
			bs.tweakMiddleButton("unsyncedIcon");
			$("#backstage").addClass("unsyncedChanges");
		} else {
			bs.tweakMiddleButton();
			$("#backstage").removeClass("unsyncedChanges");
		}
		refreshElements($("#backstage")[0]);
		if(tiddler) {
			var title = typeof(tiddler) === "string" ? tiddler : tiddler.title;
			var el = story.getTiddler(title) || false;
			if(el) {
				refreshElements(el);
			}
		}
	},
	userButton: function(backstageArea, user) {
		// override user button (logged in) to show username
		var userBtn = $("[task=user]", backstageArea).empty();
		if(config.unplugged && user.anon) {
			$("<span />").text(tasks.user.unpluggedText).appendTo(userBtn);
		} else if(!config.unplugged && user.anon) {
			userBtn.remove();
		} else {
			$("<span />").text(tasks.user.text).appendTo(userBtn);
			$("<span />").addClass("txtUserName").text(user.name).appendTo(userBtn);
			var container = $("<span />").appendTo(userBtn)[0];
			tiddlyspace.renderAvatar(container, user.name,
				{ imageOptions: { imageClass:"userSiteIcon", height: 24, width: 24 },
				labelOptions: { include: false } });
		}
	},
	showButton: function() {
		var showBtn = $("#backstageShow")[0];
		var altText = $(showBtn).text();
		$(showBtn).empty();
		imageMacro.renderImage(showBtn, "backstage.svg",
			{ altImage: commonUrl.format("backstage.png"), alt: altText});
	},
	hideButton: function() {
		var hideBtn = $("#backstageHide")[0];
		altText = $(hideBtn).text();
		$(hideBtn).empty();
		imageMacro.renderImage(hideBtn, "close.svg",
			{ altImage: commonUrl.format("close.png"), alt: altText, width: 24, height: 24 });
	},
	middleButton: function(backstageArea, user) {
		var bs = backstage.tiddlyspace;
		var backstageToolbar = $("#backstageToolbar", backstageArea)[0];
		if(config.unplugged) {
			config.messages.memberStatus = bs.locale.unplugged;
		} else if(!user.anon) {
			config.messages.memberStatus = readOnly ? bs.locale.nonmember : bs.locale.member;
		} else {
			config.messages.memberStatus = bs.locale.loggedout;
		}
		// construct the tiddlyspace logo
		var backstageLogo = $("#[task=tiddlyspace]").empty()[0];
		$("<span />").addClass("iconContainer").appendTo(backstageLogo);
		$('<span class="logoText"><span class="privateLightText">tiddly</span>' +
				'<span class="publicLightText">space</span></span>').
			appendTo(backstageLogo);
		bs.tweakMiddleButton();
	},
	tweakMiddleButton: function(iconName) {
		var backstageLogo = $("#[task=tiddlyspace] .iconContainer").empty()[0];
		var backstageToolbar = $("#backstageToolbar");
		var plugin = backstage.tiddlyspace;
		if(!iconName) {
			iconName = readOnly ? "publicIcon" : "privateAndPublicIcon";
		}
		config.macros.image.renderImage(backstageLogo, iconName, { width: 24, height: 24 });
	},
	spaceButton: function(backstageArea, user) {
		// override space button to show SiteIcon
		var btn = $("[task=space]", backstageArea).show();
		if(user && user.anon && config.unplugged) {
			btn.hide();
			return;
		}
		btn.empty();
		tiddlyspace.renderAvatar(btn[0], currentSpace,
			{ imageOptions: { imageClass:"spaceSiteIcon", height: 24, width: 24 },
			labelOptions: { include: false } });
		$("<span />").text(tasks.space.text).appendTo(btn);
		$("<span />").addClass("spaceName").text(currentSpace).appendTo(btn);
	},
	addClasses: function(backstageArea) {
		var tasks = $(".backstageTask", backstageArea);
		for(var i = 0; i < tasks.length; i++) {
			var btn = $(tasks[i]);
			var taskName = btn.attr("task");
			btn.addClass("task_%0".format(taskName));
		}
	}
};

var _init = backstage.init;
backstage.init = function() {
	_init.apply(this, arguments);
	var init = function(user) {
		var backstageArea = $("#backstageArea")[0];
		var bs = backstage.tiddlyspace;
		store.addNotification(null, bs.checkSyncStatus);
		bs.userButton(backstageArea, user);
		bs.showButton();
		bs.hideButton();
		bs.middleButton(backstageArea, user);
		bs.spaceButton(backstageArea, user);
		bs.addClasses(backstageArea); // for IE styling purposes
		bs.checkSyncStatus();
	};
	tweb.getUserInfo(init);
};

var home = config.macros.homeLink = {
	locale: {
		linkText: "your home space"
	},
	handler: function(place) {
		var container = $("<span />").appendTo(place)[0];
		tweb.getUserInfo(function(user) {
			if(!user.anon && user.name != currentSpace) {
				createSpaceLink(container, user.name, null, home.locale.linkText);
			}
		});
	}
};

config.macros.exportSpace = {
	handler: function(place, macroName, params) {
		var filename = params[0] ||
			"/?download=%0.html".format(currentSpace);
		$('<a class="button">download</a>'). // XXX: i18n
			attr("href", filename).appendTo(place);
	}
};

$.extend(config.messages, {
	syncExplanation: "You are currently viewing an offline version of this TiddlySpace. From here you can sync your offline copy with the online version.",
	syncListHeading: "Unsaved tiddlers listed below"});

config.extensions.ServerSideSavingPlugin.reportSuccess = function(msg, tiddler) {
	backstage.tiddlyspace.checkSyncStatus(tiddler);
	msg = config.extensions.ServerSideSavingPlugin.locale[msg];
	var link = "/" + encodeURIComponent(tiddler.title);
	displayMessage(msg.format([tiddler.title]), link);
};

})(jQuery);
//}}}
<<YouTubeFragment nkGRhYv01ag>>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAKGmlDQ1BJQ0MgUHJvZmlsZQAAeAHVlmdUFMkWx6t7ciLNkNOQc84gOSfJUVSGAYY4wpAxIbK4AooiIgLKEpao4KoEWQMiigERUEBF3UEWAWVdDIiKyuuBd9w977z99r6826eqfn3r9q3quvXhDwDpIyMpKQEWACCRncrxdbajB4eE0nGTAAIUgAe6wJDBTEmy9fb2AP9oH8aRaMTua/Fy/WPYf58QjIxKYQIAeSPTEZEpzESEzyNsyEzipCI8h/BwRmoSwnA3wjQOskGEB3nMWmcujyPW+f1ajL+vPQAoPAB4MoPBYQFAoiF+ejqTheQhGSKsy46MZSMcibAVM4aBjKR6hDUTE7fxeBhh1Yi/5WH9jRmMiO85GQzWd17/F+RLZGGH2JSkBEbW2sv/sktMSEPOa814p06OYgf4IaMY0qSAA3AEHshDB/rABKmeCQgCTsA7NSoT+W8A7LclZXFiWTGpdFukUlGadFc2U1uTrq+rp8eb/r8x3h1d3+y7e2t3DxLjlf/fvmRtAMwakPr3/uULfw5A510ARPr/8ineAID/AADdTcw0Tvp6PjRvwAAi4Ac0IA5kgAJQBVrIaRoDC2CDnK4b8AL+IARsAUwQAxIBB2SAHWAPyAeF4BA4CipANagDTeA0OAu6wEVwFdwAd8AwGAOTgAtmwCuwCD6AFQiCcBAFokLikCykBGlA+pApZAU5Qh6QLxQChUMsiA2lQTugvVAhVAJVQDVQM/QLdAG6Ct2CRqBH0BQ0D72FPsMomAzTYGlYGdaBTWFb2B32hzfDLDgZzobz4INwOVwLn4I74avwHXgM5sKv4CUUQJFQIig5lBbKFGWP8kKFoqJRHNQuVAGqDFWLakP1oAZQ91Fc1ALqExqLpqLpaC20BdoFHYBmopPRu9BF6Ap0E7oT3Y++j55CL6K/YSgYKYwGxhzjignGsDAZmHxMGaYB04G5jhnDzGA+YLFYEawK1gTrgg3BxmG3Y4uwJ7Dt2F7sCHYau4TD4cRxGjhLnBeOgUvF5eOO407hruBGcTO4j3gSXhavj3fCh+LZ+Fx8Gb4Ffxk/ip/FrxAECEoEc4IXIZKQRSgm1BN6CPcIM4QVoiBRhWhJ9CfGEfcQy4ltxOvEJ8R3JBJJnmRG8iHFknJI5aQzpJukKdInshBZnWxPDiOnkQ+SG8m95EfkdxQKRZliQwmlpFIOUpop1yjPKB/5qHzafK58kXy7+Sr5OvlG+V7zE/iV+G35t/Bn85fxn+O/x78gQBBQFrAXYAjsEqgUuCAwIbAkSBXUE/QSTBQsEmwRvCU4J4QTUhZyFIoUyhOqE7omNE1FURWo9lQmdS+1nnqdOkPD0lRorrQ4WiHtNG2ItigsJGwoHCicKVwpfEmYK4ISURZxFUkQKRY5KzIu8llUWtRWNEp0v2ib6KjospikmI1YlFiBWLvYmNhncbq4o3i8+GHxLvGnEmgJdQkfiQyJkxLXJRYkaZIWkkzJAsmzko+lYCl1KV+p7VJ1UoNSS9Iy0s7SSdLHpa9JL8iIyNjIxMmUylyWmZelylrJxsqWyl6RfUkXptvSE+jl9H76opyUnItcmlyN3JDciryKfIB8rny7/FMFooKpQrRCqUKfwqKirKKn4g7FVsXHSgQlU6UYpWNKA0rLyirKQcr7lLuU51TEVFxVslVaVZ6oUlStVZNVa1UfqGHVTNXi1U6oDavD6kbqMeqV6vc0YA1jjViNExojmhhNM022Zq3mhBZZy1YrXatVa0pbRNtDO1e7S/u1jqJOqM5hnQGdb7pGugm69bqTekJ6bnq5ej16b/XV9Zn6lfoPDCgGTga7DboN3hhqGEYZnjR8aEQ18jTaZ9Rn9NXYxJhj3GY8b6JoEm5SZTJhSjP1Ni0yvWmGMbMz22120eyTubF5qvlZ8z8ttCziLVos5jaobIjaUL9h2lLekmFZY8m1oluFW/1kxbWWs2ZY11o/t1GwibRpsJm1VbONsz1l+9pO145j12G3bG9uv9O+1wHl4OxQ4DDkKOQY4Fjh+MxJ3onl1Oq06GzkvN251wXj4u5y2GXCVdqV6drsuuhm4rbTrd+d7O7nXuH+3EPdg+PR4wl7unke8XyyUWkje2OXF/By9Tri9dRbxTvZ+1cfrI+3T6XPC1893x2+A35Uv61+LX4f/O38i/0nA1QD0gL6AvkDwwKbA5eDHIJKgrjBOsE7g++ESITEhnSH4kIDQxtClzY5bjq6aSbMKCw/bHyzyubMzbe2SGxJ2HJpK/9WxtZz4ZjwoPCW8C8ML0YtYynCNaIqYpFpzzzGfBVpE1kaOR9lGVUSNRttGV0SPceyZB1hzcdYx5TFLMTax1bEvolziauOW473im+MX00ISmhPxCeGJ15gC7Hj2f3bZLZlbhtJ0kjKT+ImmycfTV7kuHMaUqCUzSndqTREDAymqab9kDaVbpVemf4xIzDjXKZgJjtzMEs9a3/WbLZT9s/b0duZ2/t2yO3Ys2Nqp+3Oml3QrohdfbsVduftnslxzmnaQ9wTv+durm5uSe77vUF7e/Kk83Lypn9w/qE1ny+fkz+xz2Jf9Y/oH2N/HNpvsP/4/m8FkQW3C3ULywq/FDGLbh/QO1B+YPVg9MGhYuPik4ewh9iHxg9bH24qESzJLpk+4nmks5ReWlD6/ujWo7fKDMuqjxGPpR3jlnuUdx9XPH7o+JeKmIqxSrvK9iqpqv1VyyciT4yetDnZVi1dXVj9+afYnx7WONd01irXltVh69LrXtQH1g/8bPpzc4NEQ2HD10Z2I7fJt6m/2aS5uUWqpbgVbk1rnT8Vdmr4tMPp7jattpp2kfbCM+BM2pmXv4T/Mn7W/WzfOdNzbeeVzld1UDsKOqHOrM7FrpgubndI98gFtwt9PRY9Hb9q/9p4Ue5i5SXhS8WXiZfzLq9eyb6y1JvUu3CVdXW6b2vf5LXgaw/6ffqHrrtfv3nD6ca1AduBKzctb168ZX7rwm3T2113jO90DhoNdtw1utsxZDzUec/kXvew2XDPyIaRy6PWo1fvO9y/8cD1wZ2xjWMj4wHjDyfCJrgPIx/OPUp49OZx+uOVyZwnmCcFTwWelj2Telb7m9pv7Vxj7qUph6nB537PJ6eZ069+T/n9y0zeC8qLslnZ2eY5/bmL807zwy83vZx5lfRqZSH/D8E/ql6rvj7/p82fg4vBizNvOG9W3xa9E3/X+N7wfd+S99KzD4kfVpYLPop/bPpk+mngc9Dn2ZWML7gv5V/VvvZ8c//2ZDVxdTWJwWGsaQEU0sPR0QC8bQSAEgIAFdGExN51DbkWAa3rXoR5SozXePYfvK4z12aMAajrBcDfBgAPZKzMAUAZYX6k8eSvP7KegcH3hnh4lhJtoL8GEFkCkSa9q6tvVwHAhQPwdWh1daV8dfVrGaJ13gNwZeO6duVFC5xCZDPVUE/Xry/9cA7P83f7FxpgvJtcDRvaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAH+ElEQVRoBdVZa2xcxRWemXv37vq5dvxIbMdvEoNLCJQkJlBofkRR0poFq7hSBYlCBeIVojZ2ALWoriWo1OAEVaEhpKJINJUqWQ3CDgKqBKlNKdhJFCck69he4ziO4/gRr3dt7+69e+9MzxjZLLuz9u7m7g9Gsjz3zMyZ75s558yZWcwYQ9/nQr7P4Dl22WwC+9o77pMwrkMMlRGMixnCpQizPIywByE2DDs+zCgeoIS2+c76P2tq2qTfCgZshgm1fPC/fCzJOwkhv2SIVRGCDauisBSrVVIUC7ZYLEjXdaQFg0jTdMPn9yODUuCJJxmlrRozWl5xbHQlQuSWCRxo66xHEvkLYizTnpnBVuTmkLxlWUiSpKh4KKXI7fGisZtuNOF2AxemM8p+N3POdyDeHUmYQPPfOzIz7PggQnhHZnq6UVVRKqWm2KKCjtbAd8U1OMTGb7ox9DlPg8EtjXX3j0XrHy5PiMDugx9by8tz/o0QWV+6soCUFK5AYA7huuP6nnBPocuuAb4b5w335EON27fMxqIgoShUWp7zLjjnhupVFaS0qGBR8NzHVE0DC1s8XOdmZyHQx+3ubpyV3drc3BwTtrij0IH2jkaMyeMVxUUoF2xdVILgsAND19GU16sHAhoBxyYQhajNZqXgH3JJYQH4SCS+ZVl2tKq8mPQOXN2Wds/Wn4Puf4j0h8riMqE/tp6wW1LsQ7BaGT9YXRmqZ6F+c8qDLvdfgaBjUAB+DMJpL4TRIUbRSrCytUDeoSgyrb6tQrZnpC+Mm6/wnTr7ldOYDajde366bs28PNr/uHZATrE/B4rSS1cWCvX5Ayrq7vvaMBjtQkH2eEPdht7wjvvaOtdhLXj0Ul9/5bo11bICITa0cF8qKSqQul0Dd77RdnrrXsf6T0Lbw+uR+xjeI+Qb3PTXObDN6akpIdJvq7DyAJ7N+H36o3sE4HnPlxwbzugqfTioG2rfwFWhY+Qty+Z+RTFmP/pWu7gWM4E/HDtVACrywU6F4YbHde/MjIQMY89v6zcOi6f7Rrr3ZzV9cIAd4eYGphbRle+CzapQmGhVRGOYIGYCsqzczsdGi/XXR8cZTDwxrV49GjaH8JNhdAbsHQdUVdiearPJkIpUCRtDhDETIJjk8XEWOdJtAqqGbkIchyD+TlN9vRaiP3qVsrm5iSAa8UGUh12MA9EVfNMSMwGm0XN8CD9wwsvw6BgEG0bVgPF2eFu0b8iXfmGxyDrkS8IuAUiaKKNDwsYQYcwEuN0CyqOD10bo8I0xMHUDwamJRsYm0LWRUR793lvK9ufn3X+88ylY3p+UFKyQub2HF76jfn9AgvnmFi28PfQ70h5CW8PqwYBnF5wDaZC71PVD/gIgAPecKXw2HDB2h3UXfrZ8+OVmSZbfyrZn0qIV+cIFHBkbh7GYGUH6vlBJiDCug2x+3BvtX/yYMKkG5rCBKXcuFavnx81lroQcTUuxSWurV0sif/LOzKKuSz2wt/Sfe2o38NN40ZIQgUU1RmlsOX56N0H4zcyMNLRmdSWRBcGAh9QzF526qmp+nWq3v+R44HoUdQviuExoYVSclf3tna9DSPxN7jI7u6OyHMPFJ0IDd6Ker68wAE8YNXbGAp4rSTqB/e2n/wyO+nxBfi5aVVYC1Uin5Rccp2uAQSjGFKFfNTruOxbBMIogqQQOtJ9+E/A+X1ywHFWUrBRC4GZzsa+ferwzEPzRC42O9TGHYq4waT7QcrzjSYLIX4uW56PbyoqF4DUtiC709BmzPj9kFnR7o6NmyfQ5XFFSCOxr+7xQJooL0gHl3jXVEhxa4fMiXyCALnT3GkBC1RGt21tb86+ITjEIkmJChFhehbltVZVl4LAC8P4A6uru4XeGKarTrXsfrTkbA1Zhl8hwIOwWu/CZI0cskDftWJ6bgzPT0yIGcrPpcvYYelB3UxZ8sOEWwHPlphOoKrznIbgAp+XlZEeA54KeK4MUrpwaNeimhtqNl4Wd4hCaTgDieTWfX7T607M+NOn2wJzs1YZHapxx4Iza1XwCc8+IiMmCh62JSTcAgRTH7303KqI4G0wnACcRPEBg4VXRMzML5xTqerl+M7yTmlNMJwDwe8GMiA8iTWjh6beXH1YMnQiV32rddAJMNz6FHfD0DQ5R/mzIC08VIAXnlx5sGDjuw2oxkkk5yPZ/2PEYlsnfMMOKYrVQCJmYv0bD8v8eUuTmxQDF25YUAhxES3tnOWH4CUZYFTxqjWLCPmiorflvvACX6p80AktNbFa76T5gFrBY9SQlF+KTXz58shZesLdD/n8XY9QFT0AftY6dOtLU1MRDqWklKSbkPHziIKTSu2SrRVfSbLIe0AzNp/Kn8/8MBNUt217cJn7NSoCW6TvgPHTyMbgy7soszEFZJfnzzybS7LgHTbiGHyyTFR6FXkkAq3CI6T5AJPy0kmo1ADx/oF2YNC3PjuCPXymfXRCaUDGdAOQRP1QyUvkvkBHwrBmpXGa/cPBj8f0yYsTSAtMJwJTXDE0X5kIG3AWgBOXJmZh/xFuKgukE4AeCT/zuaaRO+78zN5BC0zfcOghPVTfF+AD8HQ3iD9MJ6D79NTCfwVHnFWNqaBz5gIzn+gQaOd9vUB0eC2nwGTGUxKRJCaMX/3RyuaTgw+AGDoDFF4n/dvC5StWn7npua09iUMWjkkJgfirnodZ0gu1Vs17iuvdl8+4A8/r5/6QSCJ0oWfX/A3UKXhQwWVptAAAAAElFTkSuQmCC
!URL
http://www.labspaces.net/105631/Brain_s_wiring__More_network_than_pyramid_

!Description
<<QuickTimeFragment /static/files/Microscopy/2008.02.13-mse640-l2-part1.mp4>>

Find the slides at:
/static/files/Microscopy/2008.02.13-mse640-l2-part1.pdf
Orignally copied material from: http://nanohub.org/resources/4092

As preperation for the math in this lecture read:
[[Wave Equation]]
[[Eulers formula]]
iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAABGdBTUEAALGPC/xhBQAACkNpQ0NQSUNDIFByb2ZpbGUAAHgBnZZ3VFNZE8Dvey+90BJCkRJ6DU1KAJESepFeRSUkAUIJGBKwV0QFVxQVaYoiiyIuuLoUWSuiWFgUFLAvyCKgrIuriIplX/QcZf/Y/b6z88ec35s7c+/cmbnnPAAovoFCUSasAECGSCIO8/FgxsTGMfHdAAZEgAPWAHB52VlB4d4RABU/Lw4zG3WSsUygz/p1/xe4xfINYTI/m/5/pcjLEkvQnULQkLl8QTYP5TyU03MlWTL7JMr0xDQZwxgZi9EEUVaVcfIXNv/s84XdZMzPEPFRH1nOWfwMvow7UN6SIxWgjASinJ8jFOSifBtl/XRphhDlNyjTMwTcbAAwFJldIuCloGyFMkUcEcZBeR4ABEryLE6cxRLBMjRPADiZWcvFwuQUCdOYZ8K0dnRkM30FuekCiYQVwuWlccV8JiczI4srWg7AlzvLooCSrLZMtMj21o729iwbC7T8X+VfF796/TvIevvF42Xo555BjK5vtm+x32yZ1QCwp9Da7PhmSywDoGUTAKr3vtn0DwAgnwdA841Z92HI5iVFIslysrTMzc21EAp4FrKCfpX/6fDV859h1nkWsvO+1o7pKUjiStMlTFlReZnpmVIxMzuLyxMwWX8bYnTr/xw4K61ZeZiHCZIEYoEIPSoKnTKhKBltt4gvlAgzRUyh6J86/B/DZuUgwy9zjQKt5iOgL7EACjfoAPm9C2BoZIDE70dXoK99CyRGAdnLi9Ye/TL3KKPrn/XfFFyEfsLZwmSmzMwJi2DypOIcGaNvQqawgATkAR2oAS2gB4wBC9gAB+AM3IAX8AfBIALEgsWAB1JABhCDXLAKrAf5oBDsAHtAOagCNaAONIAToAWcBhfAZXAd3AR94D4YBCPgGZgEr8EMBEF4iArRIDVIGzKAzCAbiA3Nh7ygQCgMioUSoGRIBEmhVdBGqBAqhsqhg1Ad9CN0CroAXYV6oLvQEDQO/Qm9gxGYAtNhTdgQtoTZsDscAEfAi+BkeCm8As6Dt8OlcDV8DG6GL8DX4T54EH4GTyEAISMMRAdhIWyEgwQjcUgSIkbWIAVICVKNNCBtSCdyCxlEJpC3GByGhmFiWBhnjC8mEsPDLMWswWzDlGOOYJoxHZhbmCHMJOYjlorVwJphnbB+2BhsMjYXm48twdZim7CXsH3YEexrHA7HwBnhHHC+uFhcKm4lbhtuH64Rdx7XgxvGTeHxeDW8Gd4FH4zn4iX4fHwZ/hj+HL4XP4J/QyATtAk2BG9CHEFE2EAoIRwlnCX0EkYJM0QFogHRiRhM5BOXE4uINcQ24g3iCHGGpEgyIrmQIkippPWkUlID6RLpAeklmUzWJTuSQ8lC8jpyKfk4+Qp5iPyWokQxpXAo8RQpZTvlMOU85S7lJZVKNaS6UeOoEup2ah31IvUR9Y0cTc5Czk+OL7dWrkKuWa5X7rk8Ud5A3l1+sfwK+RL5k/I35CcUiAqGChwFrsIahQqFUwoDClOKNEVrxWDFDMVtikcVryqOKeGVDJW8lPhKeUqHlC4qDdMQmh6NQ+PRNtJqaJdoI3Qc3YjuR0+lF9J/oHfTJ5WVlG2Vo5SXKVcon1EeZCAMQ4YfI51RxDjB6Ge8U9FUcVcRqGxVaVDpVZlWnaPqpipQLVBtVO1TfafGVPNSS1Pbqdai9lAdo26qHqqeq75f/ZL6xBz6HOc5vDkFc07MuacBa5hqhGms1Dik0aUxpaml6aOZpVmmeVFzQouh5aaVqrVb66zWuDZNe762UHu39jntp0xlpjsznVnK7GBO6mjo+OpIdQ7qdOvM6BrpRupu0G3UfahH0mPrJent1mvXm9TX1g/SX6Vfr3/PgGjANkgx2GvQaTBtaGQYbbjZsMVwzEjVyM9ohVG90QNjqrGr8VLjauPbJjgTtkmayT6Tm6awqZ1pimmF6Q0z2MzeTGi2z6zHHGvuaC4yrzYfYFFY7qwcVj1ryIJhEWixwaLF4rmlvmWc5U7LTsuPVnZW6VY1Vvetlaz9rTdYt1n/aWNqw7OpsLk9lzrXe+7aua1zX9ia2Qps99vesaPZBdlttmu3+2DvYC+2b7Afd9B3SHCodBhg09kh7G3sK45YRw/HtY6nHd862TtJnE44/eHMck5zPuo8Ns9onmBezbxhF10XrstBl8H5zPkJ8w/MH3TVceW6Vrs+dtNz47vVuo26m7inuh9zf+5h5SH2aPKY5jhxVnPOeyKePp4Fnt1eSl6RXuVej7x1vZO9670nfex8Vvqc98X6Bvju9B3w0/Tj+dX5Tfo7+K/27wigBIQHlAc8DjQNFAe2BcFB/kG7gh4sMFggWtASDIL9gncFPwwxClka8nMoLjQktCL0SZh12KqwznBa+JLwo+GvIzwiiiLuRxpHSiPbo+Sj4qPqoqajPaOLowdjLGNWx1yPVY8VxrbG4eOi4mrjphZ6LdyzcCTeLj4/vn+R0aJli64uVl+cvvjMEvkl3CUnE7AJ0QlHE95zg7nV3KlEv8TKxEkeh7eX94zvxt/NHxe4CIoFo0kuScVJY8kuybuSx1NcU0pSJoQcYbnwRapvalXqdFpw2uG0T+nR6Y0ZhIyEjFMiJVGaqCNTK3NZZk+WWVZ+1uBSp6V7lk6KA8S12VD2ouxWCR39meqSGks3SYdy5udU5LzJjco9uUxxmWhZ13LT5VuXj67wXvH9SsxK3sr2VTqr1q8aWu2++uAaaE3imva1emvz1o6s81l3ZD1pfdr6XzZYbSje8Gpj9Ma2PM28dXnDm3w21efL5YvzBzY7b67agtki3NK9de7Wsq0fC/gF1wqtCksK32/jbbv2nfV3pd992p60vbvIvmj/DtwO0Y7+na47jxQrFq8oHt4VtKt5N3N3we5Xe5bsuVpiW1K1l7RXunewNLC0tUy/bEfZ+/KU8r4Kj4rGSo3KrZXT+/j7eve77W+o0qwqrHp3QHjgzkGfg83VhtUlh3CHcg49qYmq6fye/X1drXptYe2Hw6LDg0fCjnTUOdTVHdU4WlQP10vrx4/FH7v5g+cPrQ2shoONjMbC4+C49PjTHxN+7D8RcKL9JPtkw08GP1U20ZoKmqHm5c2TLSktg62xrT2n/E+1tzm3Nf1s8fPh0zqnK84onyk6Szqbd/bTuRXnps5nnZ+4kHxhuH1J+/2LMRdvd4R2dF8KuHTlsvfli53uneeuuFw5fdXp6qlr7Gst1+2vN3fZdTX9YvdLU7d9d/MNhxutNx1vtvXM6znb69p74Zbnrcu3/W5f71vQ19Mf2X9nIH5g8A7/ztjd9Lsv7uXcm7m/7gH2QcFDhYcljzQeVf9q8mvjoP3gmSHPoa7H4Y/vD/OGn/2W/dv7kbwn1Cclo9qjdWM2Y6fHvcdvPl34dORZ1rOZifzfFX+vfG78/Kc/3P7omoyZHHkhfvHpz20v1V4efmX7qn0qZOrR64zXM9MFb9TeHHnLftv5Lvrd6Ezue/z70g8mH9o+Bnx88Cnj06e/AAOb8/zszueKAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAIeUlEQVRYCe1Zb2xb1RU/9/k9O26TJqVpSByn+UNC3JZuQMukaWirBR9BGtJAIAqlEkgg+ABCsLVFWhAU0DRp8IlNYkIskSYhPvKBDxRvKIwVSin9Q9MmTRziJG7aQtrYcWw/v7tzrn1v3nOe/eIC+cKOZN97zz3n3J/vO+/cc48B/k9rswPs+y5z8B+xXZxZd6GdfuDsZmDQhf06m91L2E9wYMMA1iQ3tfde2xeN2+Zr7l4T6IG3Y01Z3XqUAduLK0bwo9e48jD+wL/7O2BoIBo1a9TFfamBBt6N1edz8HvO+dOoVu9QZYw3bWiAYF2A+f0B0A0f5HJ5sKwCLKQWIZ1ehEKh4FQBSALnLxod2lu1gF816BcGY7stxt8GLh6/WFzXdau1pVlrb2uFhoZ68Pl8DlD2Af5QmJ+/ComZGZi9cBGxcjWNID7IM/bYn/ZEE4pZpbMq0PuHDv+BcfYS2hFuQGB7ezq1jvYQaJpWxbz7VDabg6npGRiPf6PAI5Aks9hDL++Nfuiutcz1BH1gKPYmWn5cqoTbQ1akr0ertqtS1qtdSKXg5Omz6D4pJcoZu/fVPdH3FMOlUxW0HTDTNL5jW4S1Xb/Zxcy1s8hNRs9PwMTklDRiIvB7EPj7klHeVgR9YPDwAAD7IymQO+z8+U1aU1Njuf4PNp6cSsDIufPSXgqjyy9feTh6SjLsrSvoYuzln6Kg7tN81q5bdvyogCWgsfE4nJ+YLA45jPjr2G0D90WXfackuOItorDGgQ8SYJLZvq1/TQDTWr09XaDcj0Ekm4VXiV9OK0Bnc9ZTGL3pwICOcGjZSLnmjzTe2t8HgYBfWGfAn6KnXr6U4ySjXc5l+ZMk5DN03t/b4+o+5UbEuGCBPpkEfWoOtMtXgeHBAj4NrOs2gBneDGZPCLjhWM7VjGEYELmxD746ebo0b9F7dbdd2AHq4NDhpzlnfyGBvt5u6OncYpet2DfOTELgszNFoBWkuN+A7G0RyG/rqiDhZB/54jgeRleIidvBIq89FB2TEg73QMAP0gQGYd4ZbpcylVuLQ/DwF1A3fMIBWNN9YAT9QK0k2vm6T06i/FEBQ/IrtX3dXXLKpzF4Vg6oVTv9/FAsrHM+gTw9HGqF7Vv77XKufQKsj8+IOcYYNIY2QRO6grG+DmhMlF/Mwvz0JZhHt5FHt9nTBpnoTtwdtbyQLf/65MhRSKXSxL7sD7AuGUnUThvc+i1OCqcLtbaW668Yk0vYAYdv6YWWyBbw1wcVYFIy1gVgc187hHfeCKyUm+jjs2CMTK6wWc5obVEH2SY8+XfLeQXa4toNxKTjubGxQc67t+hl5MNEtKPhW/sguLG6TrBxPdAP00q7G/h8xOFSbguFWq9XbI3Db+RAgcbM8nZirgsGPZMgfWJGLdjY3gzBJmeWKo2XtwS8Mdwi2OTj+sRsuYhjHAzW0WkseBZwFfoUaJzpotmG+nXUVCUdfVRSE4KuhezyeuKip2pDw3ohg94flsJ20GL1QCAg5yq2FIeJRJTAl64WIh+XUUX7tminmv463O0SdciOHbTgaXggeJE4OFDIh7cTGSW8dOzzpCcI3w0v8hvF0xHl1G6uQGitwhAdFESFfEGFMcFY5RfpCVrFBrltoh30EhnKYpbiRdamDULEMguQTws1LxU1T3Gb9IjoiPcit01cBs0hTgbSGW8Qpu3lo4OjFrLLU07iRTm8SZdoXnYUaAy3cWIuLKTwBl3d18xuTH5KLnIFQWfmU9Je1TZzJQ1XEnNChvTN7raq8jRJN/kSxWVHgcY3CpMCfGQIOL2oBKWcs0VfzP5iq+DR0Zw4NuoJnAAnvhxD+1zoUfIkf7jT+PKIbFPpgahY7CnOKdCsAP8usgAuzHk/8vzWTpFuCoMl4HNnpyCXdr4T+UwOLo5Ow/Sxc8BLdQ/KPfKRTrlcxfbq1QVbrcRS575KcHULhvMaJHEfWmeTc+IWUdFaaSITvRWCuAeUS9CuzONhQR+KwxTWKErIl07aIsBLv77ZM1ki+SmskUjCi7UqLaidHtgXXeKMf0BCi5kMXLr8nZSv3GIekbljFyz9aofjUYuogjtsB0yuQHKU3a3mMmCaJj7xy3Lt4688GD0uB2qnBYNpb+CWPUL9sYk4NG/aKNheX5TY5/u3YC4xA8bURWDfLRRzE3lzCTWDecPyy+tlj+anZ5NAwIkwL3pHdEpfeKQ7af/gRzFk7ibuz27atuZ3RFqXwH78n88gn8crG8C832Td6AkrQx7NEmmcPYeN+Ilnzo7iYaPipJhfi6/R83EJGLAc91c7YFpf+bQEc+jh6FEs4b5OY/qlI+dG5dSatHOXvhV1vtJiY0YdHCpfeAVoEjDCsB+bU9RPYvijIspaENX0Tpz6WuUzuMv75BXLvr4raFEr5uwBFBQBm6o+tlqbXf8H69PN+/NjJ1RcxuzxZXzqw24LuIImQaqjaZYALs7oc2PjQB95OXUzdq08qlcfPX5S+TGef0NGO7xYyd6K6FEuuH8o9jvG+T+RL8JjQ3097Njejzec+nLRmsf0z8DpM2dFkX1Zmb/lD2tPVPtnwBM0GXvhndidlob/ApSuPJT4d20JAxXV6R5XK9HTmp69gO/KhCM6YTx+5tCeO0QQqGZzVaDJANVFDMt6E2vHdymDuEpbSzMLtbXBdRsbPS/EVMNIzCTx5Z5zghX/vbB7K/mwWq/UWTVoqXhgMPYoBs+D9v9eaI6qUuuDQUYXY7pn0o2DEnjKh9OLS0DJj0vKa2KE+DOFNbcoIdcsb2sGTQYGYjE9Nw33Y0l4L+NwZ7lRrzEumsTDeQjvL3+z1+i89OT8NYGWytQKt8HqFBV70FtuR1YXfsTNHluiJXwqcbpk4I88ooH2L92E/1KCVpz+iXz/D36BLy8VVzwEAAAAAElFTkSuQmCC
/***
|''Name''|ImageMacroPlugin|
|''Version''|0.9.4|
|''Description''|Allows the rendering of svg images in a TiddlyWiki|
|''Author''|Osmosoft|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Notes''|Currently only works in modern browsers (not IE)|
|''Requires''|BinaryTiddlersPlugin|
!Usage
{{{<<image SVG>>}}} will render the text of the tiddler with title SVG as an SVG image (but not in ie where it will fail silently)
!!Parameters
width/height: specify width/height parameters
link: make the image link to a given location
tiddlyLink: link to a tiddler

!Notes
Binary tiddlers in TiddlyWeb when passed through the wikifier will be shown as images.
eg. {{{<<view text wikified>>}}} on a binary tiddler will show the image.
{{{<<view fieldname image>>}}}
will render the value of the tiddler field 'fieldname' as an image. This field can contain a tid
{{{<<image SiteIcon>>}}}
will create an image tag where the tiddler has content type beginning image and not ending +xml
will attempt to create svg object in other scenarios
{{{<<image /photos/x.jpg>>}}}
will create an image tag with src /photos/x.jpg as long as there is not a tiddler called /photos/x.jpg in 
which case it will render that tiddler as an image. Note for the case of svg files it will attempt to render as an svg if possible via the image
tag. It doesn't embed the svg in the dom for security reasons as svg code can contain javascript.
!Code
***/
//{{{
(function($) {

var macro = config.macros.image = {
	shim: "/bags/common/tiddlers/shim",
	ieVersion: config.browser.isIE ? parseInt(config.browser.ieVersion[1], 10) : false,
	svgns: "http://www.w3.org/2000/svg",
	xlinkns: "http://www.w3.org/1999/xlink", 
	svgAvailable: document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"),
	_fixPrefix: 1,
	_external_cache: {},
	_image_tag_cache: {},
	_image_dimensions: {},
	locale: {
		badImage: "This image cannot be displayed."
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler){
		var imageSource = params[0];
		// collect named arguments
		var args = macro.getArguments(paramString, params);
		this.renderImage(place, imageSource, args);
	},
	init: function() {
		var startupImages = store.getTaggedTiddlers("systemImage");
		var place = $("<div />").attr("id", "systemImageArea").appendTo("body").hide()[0];
		for(var i = 0; i < startupImages.length; i++) {
			var image = startupImages[i];
			macro.renderImage(place, image.title, { idPrefix: "" });
		}
		var data = new Image();
		data.onload = function() {
			// note ie 8 only supports data uris up to 32k so cannot be relied on
			macro.supportsDataUris = this.width != 1 || this.height != 1 ? false : true;
			macro.supportsDataUris = macro.ieVersion && macro.ieVersion < 9 ? false : macro.supportsDataUris;
		};
		data.onerror = data.onload;
		data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
	},
	refreshImage: function(src) {
		var elements = macro._image_tag_cache[src] ? macro._image_tag_cache[src] : [];
		if(macro._image_dimensions[src]) {
			macro._image_dimensions[src] = false;
		}
		for(var i = 0; i < elements.length; i++) {
			var el = $(elements[i]);
			var newSrc = "%0?nocache=%1".format(src, Math.random());
			el.attr("src", newSrc); // force reload
		}
	},
	isBinaryImageType: function(contentType) {
		return (contentType && contentType.indexOf("image") === 0 &&
			contentType.indexOf("+xml") != contentType.length - 4) ? true : false;
	},
	isImageTiddler: function(tiddler) {
		return macro.isSVGTiddler(tiddler) || macro.isBinaryImageTiddler(tiddler);
	},
	isSVGTiddler: function(tiddler) {
		var type = tiddler ? tiddler.fields['server.content-type'] : false;
		return type == "image/svg+xml";
	},
	isBinaryImageTiddler: function(tiddler) {
		return macro.isBinaryImageType(tiddler.fields['server.content-type']);
	},
	renderImage: function(place, imageSource, options) {
		var imageTiddler = store.getTiddler(imageSource);
		var container;
		var classes = ["image"];
		if(options.link) {
			classes = classes.concat(["imageLink", "externalLink"]);
			container = $("<a />").attr("href", options.link).appendTo(place)[0];
		} else if(options.tiddlyLink) {
			classes.push("imageLink");
			container = createTiddlyLink(place, options.tiddlyLink, false);
		} else {
			container = $("<span />").appendTo(place)[0];
		}
		$(container).addClass(classes.join(" "));

		options = options ? options : {};
		if(imageTiddler && macro.isBinaryImageTiddler(imageTiddler)) { // handle the case where we have an image url
			return macro._renderBinaryImageTiddler(container, imageTiddler, options);
		} else if(imageTiddler){ // handle the case where we have a tiddler
			return macro._renderSVGTiddler(container, imageTiddler, options);
		} else { // we have a string representing a url
			return macro._renderBinaryImageUrl(container, imageSource, options);
		}
	},
	_renderAlternateText: function(container, options) {
		var img;
		var src = options.src || "";
		if(options.width && options.height) {
			img = $("<img />").attr("src", src).addClass("svgImageText").attr("width", options.width).
				attr("height", options.height).appendTo(container);
		}
		var alt = options.alt;
		if(img && alt) {
			img.attr("alt", alt).attr("title", alt);
		} else if(alt) {
			$(container).addClass("svgImageText").text(alt);
		}
		macro._image_tag_cache[src] = img;
	},
	_renderSVGTiddler: function(place, tiddler, options) {
		if(!options) {
			options = {};
		}
		merge(options, { tiddler: tiddler, fix: true});

		if(macro.svgAvailable) {
			this._importSVG(place, options); // display the svg
		} else if(options.altImage) {
			var image = options.altImage;
			delete options.altImage;
			this._renderBinaryImageUrl(place, image, options);
		} else {
			this._renderAlternateText(place, options); // instead of showing the image show the alternate text.
		}
	},
	_renderBinaryImageTiddler: function(place, tiddler, options) {
		var resourceURI;
		var fields = tiddler.fields;
		if(fields["server.type"] == "tiddlyweb") { // construct an accurate url for the resource
			resourceURI = "%0/%1/tiddlers/%2".format(config.defaultCustomFields["server.host"],
				fields["server.workspace"], encodeURI(fields["server.title"]));
		} else { // guess the url for the resource
			resourceURI = tiddler.title;
		}
		var ctype = fields["server.content-type"] || tiddler.type;
		var text = tiddler.text;
		if(macro.supportsDataUris && ctype && text.indexOf("<html") == -1) {
			var uri = "data:%0;base64,%1".format(ctype, text);
			options.src = resourceURI;
			return macro._renderBinaryImageUrl(place, uri, options);
		} else if(options.src) {
			return macro._renderBinaryImageUrl(place, options.src, options);
		} else {
			return macro._renderBinaryImageUrl(place, resourceURI, options);
		}
	},
	_renderImageTag: function(container, src, width, height, options) {
		var img;
		img = $("<img />").appendTo(container);
		if(height) {
			img.attr("height", height);
		}
		if(width) {
			img.attr("width", width);
		}
		if(macro.ieVersion && macro.ieVersion < 7 && macro.shim && options.ie6png) {
			$(img).css({width: userW, height: userH,
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%0', sizingMethod='scale')".format(src)
				}).attr("src", macro.shim);
		} else {
			img.attr("src", src);
		}
		if(!macro._image_tag_cache[options.srcUrl]) {
			macro._image_tag_cache[options.srcUrl] = [];
		}
		img = $(img).addClass(options.imageClass)[0];
		macro._image_tag_cache[options.srcUrl].push(img);
		return img;
	},
	_getDimensions: function(realDimensions, reqDimensions, preserve) {
		var w = realDimensions.width;
		var h = realDimensions.height;
		var reqh = reqDimensions.height;
		var reqw = reqDimensions.width;
		var finalw = w, finalh = h;
		var ratiow = reqw / w, ratioh = reqh / h;
		var scaledw = ratioh * w;
		var scaledh = ratiow * h;
		if(!reqw && reqh) {
			finalw = scaledw;
			finalh = reqh;
		} else if(reqw && !reqh) {
			finalw = reqw;
			finalh = scaledh;
		} else if(reqh && reqw) {
			var preserveWidth = w > h ? true : false;
			if(preserve) {
				if(preserveWidth && scaledh < reqh) {
					finalh = scaledh;
					finalw = reqw;
				} else {
					finalh = reqh;
					finalw = scaledw;
				}
			} else {
				finalw = reqw;
				finalh = reqh;
			}
		}
		return { width: parseInt(finalw, 10), height: parseInt(finalh, 10) };
	},
	_renderBinaryImageUrl: function(container, src, options) {
		var srcUrl = options.src ? options.src : src;
		srcUrl = srcUrl.indexOf("/") === -1 ? "/%0".format(srcUrl) : srcUrl; // for IE. 
		var image_dimensions = macro._image_dimensions[srcUrl];
		var image = new Image(); // due to weird scaling issues where you use just a width or just a height
		var createImageTag = function(dimensions, error) {
			if(error) {
				var altImage = options.altImage;
				if(altImage) {
					delete options.altImage;
					macro._renderBinaryImageUrl(container, altImage, options);
				} else {
					options.src = src;
					macro._renderAlternateText(container, options);
				}
			} else {
				var dim = macro._getDimensions(dimensions, { 
					width: options.width, height: options.height }, options.preserveAspectRatio);
				options.srcUrl = srcUrl;
				macro._renderImageTag(container, src, dim.width, dim.height, options);
			}
		};

		if(!image_dimensions) {
			image.onload = function() {
				var dimensions = { width: image.width, height: image.height};
				macro._image_dimensions[srcUrl] = dimensions;
				createImageTag(dimensions);
			};
			image.onerror = function() {
				createImageTag(null, true);
			};
			image.src = src;
		} else {
			createImageTag(image_dimensions);
		}
	},
	_generateIdPrefix: function(){
		return "twsvgfix_" + (this._fixPrefix++).toString() + "_";
	},
	_fixSVG: function(childNodes, idPrefix) {
		var urlPattern = /url\(\#([^\)]*)\)*/ig;
		var fixes = [
		{ attr: "id", pattern: /^(.*)$/ig },
		{ attr: "href", namespace: macro.xlinkns, pattern: /^#(.*)$/ig }
		];
		var url_fixes = ["filter", "fill", "mask", "stroke", "style"];
		for(var i = 0; i < url_fixes.length; i++) {
			fixes.push({ attr: url_fixes[i], pattern: urlPattern });
		}
		for(var t = 0; t < childNodes.length; t++) {
			var node = childNodes[t];
			for(var a = 0; a < fixes.length; a++) {
				var fix = fixes[a];
				var attr = fix.attr;
				var ns = fix.namespace || "";
				if(node.hasAttributeNS && node.hasAttributeNS(ns, attr)) {
					var v = node.getAttributeNS(ns, attr);
					fix.pattern.lastIndex = 0;
					var match = fix.pattern.exec(v);
					if(match) {
						// Make sure replacement string doesn't contain any single dollar signs
						var toReplace = match[1];
						if(toReplace.indexOf(idPrefix) !== 0 && toReplace.indexOf("twglobal_") !== 0) {
							var replacement = (idPrefix + toReplace).replace("$", "$$$$"); 
							v = v.replace(match[1], replacement);
						}
						node.setAttributeNS(ns, attr,v);
					}
				}
			}
			var children = node.childNodes;
			if(children.length > 0) {
				this._fixSVG(children, idPrefix);
			}
		}
	},
	_importSVG: function(place, options){
		options = options ? options : {};
		var svgDoc, tiddlerText = options.tiddler.text;
		if (window.DOMParser) {
			svgDoc = new DOMParser().parseFromString(tiddlerText, "application/xml").documentElement;
			var idPrefix = options.idPrefix || this._generateIdPrefix();
			this._fixSVG([svgDoc], idPrefix);
			var el = document.importNode(svgDoc, true);
			var svgHolder = document.createElementNS(macro.svgns,"svg");
			var width = options.width;
			var height = options.height;
			if(width || height) {
				if(width && height) { // set view box of containing svg element based on the svg viewbox and width and height.
					var viewBox = el.getAttribute("viewBox");
					var topLeft = "0 0";
					if(viewBox) {
						topLeft = viewBox.replace(/([0-9]*) +([0-9]*) +([0-9]*) +([0-9]*) */gi,"$1 $2");
					}
					svgHolder.setAttributeNS(macro.svgns, "viewBox", "0 0 %0 %1".format(width, height));
				} else {
					if(!width) {
						width = el.getAttribute("width");
					}
					if(!height) {
						height = el.getAttribute("height");
					}
				}
				svgHolder.setAttribute("width", width);
				svgHolder.setAttribute("height", height);

				el.setAttribute("width", "100%");
				el.setAttribute("height", "100%");
				svgHolder.setAttribute("class", "svgImage svgIcon %0".format(options.imageClass || ""));
				svgHolder.appendChild(el);
				place.appendChild(svgHolder);
			}
			else {
				var existing = el.className ? el.className.baseVal : "";
				el.setAttribute("class","svgImage %0".format(existing));
				place.appendChild(el);
			}
			// if a tiddler attribute is set this is read as a link
			$("[tiddler], [tiddlyLink]", place).attr("refresh", "link").click(function(ev) {
				var tiddler = $(ev.target).attr("tiddlyLink");
				if(tiddler) {
					story.displayTiddler(ev.target, tiddler);
				}
			});
		}
	},
	getArguments: function(paramString, params) {
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var options = {};
		for(var id in args) {
			if(true) {
				var p = args[id];
				if(id == "def") {
					options[id] = p;
				} else {
					options[id] = p[0];
				}
			}
		}
		var width = isNaN(params[1]) ? false : parseInt(params[1], 10);
		var height = isNaN(params[2]) ? false : parseInt(params[2], 10);

		options.width = macro.lookupArgument(options, "width", width);
		options.height = macro.lookupArgument(options, "height", height);
		options.preserveAspectRatio = args.preserveAspectRatio && 
			args.preserveAspectRatio[0] == "yes" ? true : false;
		options.tiddlyLink = macro.lookupArgument(options, "tiddlyLink", false);
		options.link = macro.lookupArgument(options, "link", false);
		return options;
	},
	lookupArgument: function(args, id, ifEmpty) {
		return args[id] ? args[id] : ifEmpty;
	}
};

// update views
var _oldwikifiedview = config.macros.view.views.wikified;
// update wikifier to check tiddler type before rendering
merge(config.macros.view.views, {
	wikified: function(value, place, params, wikifier, paramString, tiddler) {
		if(macro.isImageTiddler(tiddler) && params[0] == "text") {
			var newplace = $("<div />").addClass("wikifiedImage").appendTo(place)[0];
			macro.renderImage(newplace, tiddler.title, { alt: macro.locale.badImage });
		} else {
			_oldwikifiedview.apply(this, arguments);
		}
	},
	image: function(value, place, params, wikifier, paramString, tiddler) {
		// a field can point to another tiddler whereas text is the current tiddler.
		var title = params[0] == "text" ? tiddler.title : value;
		var args = macro.getArguments(paramString, params);
		macro.renderImage(place, title, args);
	}
});
config.shadowTiddlers.StyleSheetImageMacro = [".wikifiedImage svg, .wikifiedImage .image { width: 80%; }",
	".svgImageText { background-color:[[ColorPalette::Error]]; color:#ddd; display: inline-block; }",
	"span.svgImageText { display: inline-block; overflow: hidden; }"
].join("");
store.addNotification("StyleSheetImageMacro", refreshStyles);

})(jQuery);
//}}}
/*{{{*/
Background: #e5e1f3
Foreground: #0f0b1d
PrimaryPale: #bab0e0
PrimaryLight: #8471c8
PrimaryMid: #543fa2
PrimaryDark: #130e24
SecondaryPale: #b0e0b5
SecondaryLight: #71c879
SecondaryMid: #3fa249
SecondaryDark: #0e2410
TertiaryPale: #e0c0b0
TertiaryLight: #c88e71
TertiaryMid: #a2603f
TertiaryDark: #24150e
Error: #f88
ColorPaletteParameters: HSL([253|53], [0.44122348783304],[0.1|0.7855399828822682])
/*}}}*/
!URL
http://www.imaging-git.com/news/tescan-delivered-its-1000th-microscope

!Description
1000 microscopes for Tescan
!URL
http://www.nanowerk.com/news/newsid=21528.php

!Description
Grenoble, France, has developed a novel technique that is suitable exactly for this purpose. The researchers use extremely bright X-rays from a synchrotron light source to form images of the chemical bond distribution of different carbon forms embedded deep in an opaque material; an achievement previously thought to be impossible without destroying the sample.
//~~(Part of the [[ForEachTiddlerPlugin]])~~//

Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.

''Syntax:'' 
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]] is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|


''Using JavaScript''

To give you a lot of flexibility the [[ForEachTiddlerMacro]] uses JavaScript in its arguments. Even if you are not that familiar with JavaScript you may find forEachTiddler useful. Just have a look at the various ready-to-use [[ForEachTiddlerExamples]] and adapt them to your needs.

''The Elements of the Macro''

The arguments of the ForEachTiddlerMacro consist of multiple parts, each of them being optional.

<<slider chkFETInClause [[inClause]] "inClause" "inClause">>
<<slider chkFETWhereClause [[whereClause]] "whereClause" "whereClause">>
<<slider chkFETSortClause [[sortClause]] "sortClause" "sortClause">>
<<slider chkFETScriptClause [[scriptClause]] "scriptClause" "scriptClause">>
<<slider chkFETActions [[Action Specification]] "Action Specification" "Action Specification">>

''Using Macros and ">" inside the forEachTiddler Macro''

You may use other macro calls into the expression, especially in the actionParameters. To avoid that the {{{>>}}} of such a macro call is misinterpreted as the end of the {{{<<forEachTiddler...>>}}} macro you must escape the {{{>>}}} of the inner macro with {{{$))}}} E.g. if you want to use {{{<<tiddler ...>>}}} inside the {{{forEachTiddler}}} macro you have to write {{{<<tiddler ...$))}}}.

In addition it is necessary to escape single {{{>}}} with the text {{{$)}}}.

''Using {{{<<tiddler ... with: ...>>}}} to re-use ForEachTiddler definitions''

Sometimes you may want to use a certain ForEachTiddler definition in slight variations. E.g. you may want to list either the tiddlers tagged with "ToDo" and in the other case with "Done". To do so you may use "Tiddler parameters". Here an example:

Replace the variable part of the ForEachTiddler definition with $1 ($2,... $9 are supported). E.g. you may create the tiddler "ListTaggedTiddlers" like this
{{{
<<forEachTiddler 
 where 
 'tiddler.tags.contains("$1")'
>>
}}}

Now you can use the ListTaggedTiddlers for various specific tags, using the {{{<<tiddler ...>>}}} macro:
{{{
<<tiddler ListTaggedTiddlers with: "systemConfig">>
}}}
{{{
<<tiddler ListTaggedTiddlers with: "Plugin">>
}}}


See also [[ForEachTiddlerExamples]].
!URL
http://biosciencetechnology.com/News/Feeds/2011/01/products-instrumentation-new-molecular-imaging-technologies-for-detecting-c/

!Description
Home > News

RSS Feeds   Newsletters   Bookmarks  

[-] Text [+]  
New molecular imaging technologies for detecting cellular processes

Featured In: Instrumentation
By EurekAlert Tuesday, January 11, 2011
newsvine 	diigo 	google
slashdot 		

Email 	Print
Print
 Share
0diggsdigg
Loading...

The work carried out by these scientists has ranged from the initial design of an electronic architecture for gamma ray detectors to industry transfer of a complete scanner, after having adequately validated a prototype through experimental studies at the Gregorio Marañón Hospital. The results of this research, headed by professors Juan José Vaquero and Manuel Desco, from the Department of de Bioengineering and Aerospace Engineering at UC3M, have been recently published in the journals IEEE Transactions on Nuclear Science (two articles) and Physics in Medicine and Biology (one article).

The electronic technology equipment designed by the researchers- which is in patent process-is based on molecular
http://www.gatan.com/imaging/600_w.php
[[GATAN Cameras]]
[[SIS Cameras]]
[[Tietz Cameras]]
[[AMT Cameras]]

|[[Eagle]]|Fairchild camera, 4k versie|||||||
|[[Eagle]]|Fairchild camera, 2k versie|||||||
|Flucam|JAI camera, type: CV-M4+CL|||||||
|FEI|CMOS (in studie)|150K||Very fast||Dedicated NanoBio low dose camera|Heeft alleen zin met Nemo|
!URL
http://emlab.rose2.brandeis.edu/

!Description
!URL
http://coan.burnham.org/other-projects/

!Description
(function() {
var getCSRFToken = function(window) {
	// XXX: should not use RegEx - cf.
	// http://www.quirksmode.org/js/cookies.html
	// https://github.com/TiddlySpace/tiddlyspace/commit/5f4adbe009ed4bda3ce39058a3fb07de1420358d
	var regex = /^(?:.*; )?csrf_token=([^(;|$)]*)(?:;|$)/;
	var match = regex.exec(document.cookie);
	var csrf_token = null;
	if (match && (match.length === 2)) {
		csrf_token = match[1];
	}

	return csrf_token;
};

if (typeof config !== 'undefined' && config.extensions &&
		config.extensions.tiddlyspace &&
		config.extensions.tiddlyspace.getCSRFToken === null) {
	config.extensions.tiddlyspace.getCSRFToken = getCSRFToken;
} else {
	window.getCSRFToken = getCSRFToken;
}
})(window);
Welcome to your brand new [[TiddlySpace]]@glossary.

To get started with this blank [[TiddlySpace]]@glossary, you'll need to modify the following [[tiddlers|Tiddler]]@glossary:
* If you don't like the color scheme click <<RandomColorPaletteButton>> to generate a new random color scheme.
* Upload a [[SiteIcon|SiteIcon tiddler]]@glossary. [[Your SiteIcon|SiteIcon]] gives your space an identity to make it recognisable to others. A good site icon will be square and at least 48*48 pixels size.
<<binaryUploadPublic title:SiteIcon>>
* [[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 ~TiddlySpace is opened
* Many features of ~TiddlySpace are accessed via the backstage bar located at the top of the page. You can toggle it on or off using the button in the top right corner of the screen.
$\tan (x) / y $
<<PlotFunction "y = tan(x) / sin(x)" "600" "200">>
!URL
http://sparx-em.org/sparxwiki/

!Description
SparxWiki - SPARX Wiki
!URL
http://www.macobserver.com/tmo/article/Macnification_Manages_Digital_Electron_Microscopy_Workflow/

!Description
<<view title link>>
//<<view ##Description text>>//
Code:
{{annotation{
http://htmljs.tiddlyspace.com/ <<view title text>>
}}}
!URL
http://www.microscopy-news.com/news/resolution-optics-wins-microscopy-award.html

!Description
Resolution Optics has successfully developed the world"s most versatile, most time efficient, and most powerful 3D and 4D digital holographic microscopes on the market today . With little installation, no sample preparation, live in-situ micro-organism/particle tracking and analysis, these instruments are designed to save time and money for research and industry while producing incredible results.
!URL
http://www.nytimes.com/2010/12/28/science/28brain.html?_r=1&src=twt&twt=nytimesscience

!Description
In Pursuit of a Mind Map, Slice by Slice
By ASHLEE VANCE
Published: December 27, 2010

    * Recommend
    * Twitter
    * Sign In to E-Mail
    * Print
    * Single Page
    *
      Reprints
    * ShareClose
          o Linkedin
          o Digg
          o Mixx
          o MySpace
          o Yahoo! Buzz
          o Permalink
o

CAMBRIDGE, Mass — Dr. Jeff Lichtman likes his brains sliced thin — very, very thin.
Enlarge This Image
C.J. Gunther for The New York Times

TEAM LEADER Dr. Jeff Lichtman, with a 3-D image of a section of mouse brain and a magnified section of a dendrite (red), in his office at Harvard.
Related

    *
      The Thinnest Cut: A Device for Discovery (December 28, 2010)

RSS Feed
RSS Get Science News From The New York Times »
Enlarge This Image
C.J. Gunther for The New York Times

ILLUMINATING A section of a mouse brain about 30 nanometers thick, ready for an electron microscope at Harvard. Researchers liken the cutting to shaving off the surface of a football fi
<<QuickTimeFragment "/static/files/Microscopy/2008.03.31-mse640-l12-part1.mp4">>

/static/files/Microscopy/2008.03.31-mse640-l12-part1.pdf
Orignally copied material from: http://nanohub.org/resources/4092
!URL
http://www.vsg3d.com/vsg_extranet_event_description.php?id=21&te=3

!Description
In microscopy, TIRF stands for ''T''otal ''I''nternal ''R''eflection ''F''luorescence microscopy
!URL
http://www.nanowerk.com/news/newsid=20451.php

!Description
According to the authors of the study, imaging such highly dynamic processes in the cell and in 3D poses major technical challenges in a complex cell monolayer due to cell-to-cell variations in thickness and temporal properties of protein transport. Previous imaging techniques were slow and suffered from poor z-localization/3D-tracking capability.
<html>A
fourier image can be interpreted as follows. Imagine the image as an
axes plane. Each pixel in the image has a greyscale<br
/><ul><li>Each (x,y) position denotes a frequency that
is present in the image.<br /></li><li>The grayscale
level at a position (x,y) indicates the change in contrast level
present in the image for that
frequency.<span><span></span></span></li></ul><span><span>For
example, suppose that there is the value 20 at the point that
represents the frequency 0.1 (or 1 period every 10 pixels). This means
that in the corresponding spatial domain image I the intensity values
vary from dark to light and back to dark over a distance of 10 pixels,
and that the contrast between the lightest and darkest is 40 gray
levels (2 times 20). Black indicates 'no variation'. White indicates
'maximum variation'.<br /><br
/></span></span>The example image on the left shows 2
pixel wide vertical stripes. On the right you can see the fourier
image.<br /><span><span><br
/></span></span><span><span>
<img
src="http://homepages.inf.ed.ac.uk/rbf/HIPR2/images/stp2.gif"
/></span></span><span><span><img
src="http://homepages.inf.ed.ac.uk/rbf/HIPR2/images/stp2fur1.gif"
/><br /></span></span><br /> If we look
carefully, we can see that it contains 3 main values: the DC-value and,
since the Fourier image is symmetrical to its center, two points
corresponding to the frequency of the stripes in the original image.
Note that the two points lie on a horizontal line through the image
center, because the image intensity in the spatial domain changes the
most if we go along it horizontally. The distance of the points to the
center can be explained as follows: the maximum frequency which can be
represented in the spatial domain are one pixel wide stripes:<br
/><br /> <span
class="AM">`f_max=1/1text{pixelsize}`</span><br /><br
/><span class="AM">`f =
1/2text{pixelsize}=f_max/2`</span> <br /><br
/>Further investigation of the Fourier image shows that the
magnitude of other frequencies in the image is less than of<img
align="middle"
src="http://homepages.inf.ed.ac.uk/rbf/HIPR2/eqns/eqnfoura.gif"
alt="Eqn:eqnfoura" /> the average grayscale value,
<em>i.e.</em> they don't make any significant contribution
to the image. The magnitudes of the two minor points are each
two-thirds of the average grayscale -value.<br /><br
/><img
src="file:///C:/DOCUME~1/dsn/LOCALS~1/Temp/moz-screenshot.jpg"
/><br /><br /></html>
!URL
http://www.broadinstitute.org/science/platforms/imaging/imaging-platform

!Description
The Broad's Imaging Platform is a world leader in developing advanced methods to quantify and mine the rich information present in cellular images to yield biological discoveries. The integration of data resulting from systems biology/functional genomics studies and image-based screens from the Imaging Platform generates novel biological hypotheses. Additionally, we develop open-source software tools and help biologists to apply them to significant questions in the life sciences. The platform's major activities include:
!URL
http://www.microscopy-news.com/news/flexible-learning-in-a-virtual-microscope-lab.html

!Description
Researchers at the IIS, the Erlangen University Clinic as well as at the University of Erlangen-Nürnberg have now created an additional facility that is available to students around the clock: a platform for web-based microscopy. So far, the project partners have made digital images of 200 specimens at 40x magnification and have put them into a database. Here, students can look up and research specimens using specific keywords such as body part or diagnostic findings. At the click of a mouse, the image can be viewed with a specific degree of enlargement (5x, 10x, 20x, 40x) or with seamless zooming. Image details which present the relevant tissue changes or other characteristics are interactively labeled.
!URL
http://www.nanowerk.com/news/newsid=20189.php

!Description
A key problem in microscopy is that when the light shines on a biological sample, such as a slice of brain tissue, light waves hit the cells and bounce off in different directions. The larger the piece of tissue, the more interesting and diverse its collection of parts, which makes the light waves bend and scatter in unpredictable ways.
<<deliciousImport djswagerman>>
<<list filter [tag[bookmark]][sort[-modified]]>>
!URL
http://www.nanowerk.com/news/newsid=24058.php

!Description
To meet this challenge, which has called upon the resources of many researchers around the world for more than 15 years, the teams led by Bruno Klaholz and Dino Moras, both CNRS senior researchers at IGBMC, resorted to an innovative technique: cryo-electron microscopy (cryo-EM), which requires a next-generation "high-resolution" electron microscope. This technological marvel makes it possible to observe biological objects at the molecular and even atomic scale. In France, the first such EM was installed at IGBMC in 2008. Before this work was carried out, it was widely assumed that studying VDR with cryo-EM was impossible. In fact, until now, the smallest molecules observed using this technique weighed more than 300 kilodaltons (kDa), or even several thousand kDa, in other words much more than the VDR, which weighs 100 kDa and measures a mere 10 nm.
http://www.msm.cam.ac.uk/doitpoms/tlplib/tem/index.php
!URL
http://www.microscopy-news.com/news/mac-microscopy-software-looking-for-interested-hardware-vendors.html

!Description
February 3, 2012, Leuven,Belgium. -- Macnification is an innovative microscopy application for Mac OS X, covering the entire workflow, from capturing and organizing images to analyzing and enhancing them. Leading universities and institutes, such as NIH, MIT, Yale, Harvard University, UC Berkeley, … are currently using Macnification.
http://en.wikipedia.org/wiki/Flange
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="301 225 48 52"
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 333.00003 234 L 306 258.75003 L 301.5 270 L 312.75 265.50003 L 339.75 240.74998 Z M 337.5 229.50002 
		L 335.24988 231.75008 L 341.99997 238.50003 L 344.24997 236.24995 Z M 342 225.00003 L 339.74988 227.25009 
		L 346.5 234.00005 L 348.75 231.75003 Z M 301.5 273.9719 C 301.5 273.9719 309.59888 277.99927 317.70013 273.97183 
		C 325.80066 269.94437 341.99997 276.65686 341.99997 276.65686 L 341.99997 273.97195 
		C 341.99997 273.97195 325.80014 267.2594 317.70013 271.28687 C 309.6 275.31451 301.5 271.28683 301.5 271.28683 Z" 
		fill="#101010" class="glyph"/>
	</g>
</g>
</svg>
Contrast in the electron image can arise from both "amplitude" and "phase" effects. [[Amplitude contrast]] is produced by the loss of amplitude (i.e. electrons) from the beam; [[Phase contrast]] originates fromshifts in the relative phases of the portions of the beam which contribute to the image.

The terms "amplitude" and "phase" contrast can be somewhat misleading. More appropriate terms could have been scattering contrast and interference contrast instead of amplitude and phase contrast.
@@Please do not modify this tiddler; it was created automatically upon space creation.@@
/***
|''Name:''|DataTiddlerPlugin|
|''Version:''|1.0.7 (2012-04-19)|
|''Summary:''|Enhance your tiddlers with structured data (such as strings, booleans, numbers, or even arrays and compound objects) that can be easily accessed and modified through named fields (in JavaScript code).|
|''Source:''|http://tiddlywiki.abego-software.de/#DataTiddlerPlugin|
|''Twitter:''|[[@abego|https://twitter.com/#!/abego]]|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''License:''|[[BSD open source license|http://www.abego-software.de/legal/apl-v10.html]]|
!Description
Enhance your tiddlers with structured data (such as strings, booleans, numbers, or even arrays and compound objects) that can be easily accessed and modified through named fields (in JavaScript code).

Such tiddler data can be used in various applications. E.g. you may create tables that collect data from various tiddlers. 

''//Example: "Table with all December Expenses"//''
{{{
<<forEachTiddler
    where
        'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
    write
        '"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
}}}
//(This assumes that expenses are stored in tiddlers tagged with "expense".)//
<<forEachTiddler
    where
        'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
    write
        '"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
For other examples see DataTiddlerExamples.




''Access and Modify Tiddler Data''

You can "attach" data to every tiddler by assigning a JavaScript value (such as a string, boolean, number, or even arrays and compound objects) to named fields. 

These values can be accessed and modified through the following Tiddler methods:
|!Method|!Example|!Description|
|{{{data(field)}}}|{{{t.data("age")}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{data(field,defaultValue)}}}|{{{t.data("isVIP",false)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{data()}}}|{{{t.data()}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{setData(field,value)}}}|{{{t.setData("age",42)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{setData(field,value,defaultValue)}}}|{{{t.setData("isVIP",flag,false)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|

Alternatively you may use the following functions to access and modify the data. In this case the tiddler argument is either a tiddler or the name of a tiddler.
|!Method|!Description|
|{{{DataTiddler.getData(tiddler,field)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{DataTiddler.getData(tiddler,field,defaultValue)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{DataTiddler.getDataObject(tiddler)}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{DataTiddler.setData(tiddler,field,value)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{DataTiddler.setData(tiddler,field,value,defaultValue)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|
//(For details on the various functions see the detailed comments in the source code.)//


''Data Representation in a Tiddler''

The data of a tiddler is stored as plain text in the tiddler's content/text, inside a "data" section that is framed by a {{{<data>...</data>}}} block. Inside the data section the information is stored in the [[JSON format|http://www.crockford.com/JSON/index.html]]. 

//''Data Section Example:''//
{{{
<data>{"isVIP":true,"user":"John Brown","age":34}</data>
}}}

The data section is not displayed when viewing the tiddler (see also "The showData Macro").

Beside the data section a tiddler may have all kind of other content.

Typically you will not access the data section text directly but use the methods given above. Nevertheless you may retrieve the text of the data section's content through the {{{DataTiddler.getDataText(tiddler)}}} function.


''Saving Changes''

The "setData" methods respect the "ForceMinorUpdate" and "AutoSave" configuration values. I.e. when "ForceMinorUpdate" is true changing a value using setData will not affect the "modifier" and "modified" attributes. With "AutoSave" set to true every setData will directly save the changes after a setData.


''Notifications''

No notifications are sent when a tiddler's data value is changed through the "setData" methods. 

''Escape Data Section''
In case that you want to use the text {{{<data>}}} or {{{</data>}}} in a tiddler text you must prefix the text with a tilde ('~'). Otherwise it may be wrongly considered as the data section. The tiddler text {{{~<data>}}} is displayed as {{{<data>}}}.


''The showData Macro''

By default the data of a tiddler (that is stored in the {{{<data>...</data>}}} section of the tiddler) is not displayed. If you want to display this data you may used the {{{<<showData ...>>}}} macro:

''Syntax:'' 
|>|{{{<<}}}''showData '' [''JSON''] [//tiddlerName//] {{{>>}}}|
|''JSON''|By default the data is rendered as a table with a "Name" and "Value" column. When defining ''JSON'' the data is rendered in JSON format|
|//tiddlerName//|Defines the tiddler holding the data to be displayed. When no tiddler is given the tiddler containing the showData macro is used. When the tiddler name contains spaces you must quote the name (or use the {{{[[...]]}}} syntax.)|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
!Source Code
***/
/***
This plugin's source code is compressed (and hidden). 
Use this [[link|http://tiddlywiki.abego-software.de/archive/DataTiddlerPlugin/1.0.7/DataTiddlerPlugin-1.0.7-src.js]] to get the readable source code.
***/
///%
if(!version.extensions.DataTiddlerPlugin){version.extensions.DataTiddlerPlugin={major:1,minor:0,revision:7,date:new Date(2012,3,19),type:"plugin",source:"http://tiddlywiki.abego-software.de/#DataTiddlerPlugin"};if(!window.story){window.story=window}if(!TiddlyWiki.prototype.getTiddler){TiddlyWiki.prototype.getTiddler=function(b){var a=this.tiddlers[b];return(a!==undefined&&a instanceof Tiddler)?a:null}}function DataTiddler(){}DataTiddler={stringify:null,parse:null};window.DataTiddler=DataTiddler;DataTiddler.getData=function(c,d,a){var b=(typeof c=="string")?store.getTiddler(c):c;if(!(b instanceof Tiddler)){throw"Tiddler expected. Got "+c}return DataTiddler.getTiddlerDataValue(b,d,a)};DataTiddler.setData=function(c,e,d,a){var b=(typeof c=="string")?store.getTiddler(c):c;if(!(b instanceof Tiddler)){throw"Tiddler expected. Got "+c+"("+b+")"}DataTiddler.setTiddlerDataValue(b,e,d,a)};DataTiddler.getDataObject=function(b){var a=(typeof b=="string")?store.getTiddler(b):b;if(!(a instanceof Tiddler)){throw"Tiddler expected. Got "+b}return DataTiddler.getTiddlerDataObject(a)};DataTiddler.getDataText=function(b){var a=(typeof b=="string")?store.getTiddler(b):b;if(!(a instanceof Tiddler)){throw"Tiddler expected. Got "+b}return DataTiddler.readDataSectionText(a)};DataTiddler.extendJSONError=function(a){if(a.name=="JSONError"){a.toString=function(){return a.name+": "+a.message+" ("+a.text+")"}}return a};DataTiddler.getTiddlerDataObject=function(a){if(a.dataObject===undefined){var b=DataTiddler.readData(a);a.dataObject=(b)?b:{}}return a.dataObject};DataTiddler.getTiddlerDataValue=function(b,d,a){var c=DataTiddler.getTiddlerDataObject(b)[d];return(c===undefined)?a:c};DataTiddler.setTiddlerDataValue=function(c,f,e,a){var d=DataTiddler.getTiddlerDataObject(c);var b=d[f];if(e==a){if(b!==undefined){delete d[f];DataTiddler.save(c)}return}d[f]=e;DataTiddler.save(c)};DataTiddler.readDataSectionText=function(a){var b=DataTiddler.getDataTiddlerMatches(a);if(b===null||!b[2]){return null}return b[2]};DataTiddler.readData=function(b){var c=DataTiddler.readDataSectionText(b);try{return c?DataTiddler.parse(c):null}catch(a){throw DataTiddler.extendJSONError(a)}};DataTiddler.getDataTextOfTiddler=function(a){var b=DataTiddler.getTiddlerDataObject(a);return DataTiddler.stringify(b)};DataTiddler.indexOfNonEscapedText=function(c,a,d){var b=c.indexOf(a,d);while((b>0)&&(c[b-1]=="~")){b=c.indexOf(a,b+1)}return b};DataTiddler.getDataSectionInfo=function(e){var a="<data>{";var f="}</data>";var d=DataTiddler.indexOfNonEscapedText(e,a,0);if(d<0){return null}var c=e.indexOf(f,d);if(c<0){return null}var b;while((b=e.indexOf(f,c+1))>=0){c=b}return{prefixEnd:d,dataStart:d+(a.length)-1,dataEnd:c,suffixStart:c+(f.length)}};DataTiddler.getDataTiddlerMatches=function(a){var f=a.text;var e=DataTiddler.getDataSectionInfo(f);if(!e){return null}var c=f.substr(0,e.prefixEnd);var b=f.substr(e.dataStart,e.dataEnd-e.dataStart+1);var d=f.substr(e.suffixStart);return[f,c,b,d]};DataTiddler.save=function(a){var e=DataTiddler.getDataTiddlerMatches(a);var d;var f;if(e===null){d=a.text;f=""}else{d=e[1];f=e[3]}var b=DataTiddler.getDataTextOfTiddler(a);var c=(b!==null)?d+"<data>"+b+"</data>"+f:d+f;if(c!=a.text){a.isDataTiddlerChange=true;a.set(a.title,c,config.options.txtUserName,config.options.chkForceMinorUpdate?undefined:new Date(),a.tags);delete a.isDataTiddlerChange;store.dirty=true;if(config.options.chkAutoSave){saveChanges()}}};DataTiddler.MyTiddlerChangedFunction=function(){if(this.dataObject&&!this.isDataTiddlerChange){delete this.dataObject}DataTiddler.originalTiddlerChangedFunction.apply(this,arguments)};config.formatters.push({name:"data-escape",match:"~<\\/?data>",handler:function(a){a.outputText(a.output,a.matchStart+1,a.nextMatch)}});config.formatters.push({name:"data",match:"<data>",handler:function(a){var b=DataTiddler.getDataSectionInfo(a.source);if(b&&b.prefixEnd==a.matchStart){a.nextMatch=b.suffixStart}else{a.outputText(a.output,a.matchStart,a.nextMatch)}}});DataTiddler.originalTiddlerChangedFunction=Tiddler.prototype.changed;Tiddler.prototype.changed=DataTiddler.MyTiddlerChangedFunction;Tiddler.prototype.data=function(b,a){return(b)?DataTiddler.getTiddlerDataValue(this,b,a):DataTiddler.getTiddlerDataObject(this)};Tiddler.prototype.setData=function(c,b,a){DataTiddler.setTiddlerDataValue(this,c,b,a)};config.macros.showData={label:"showData",prompt:"Display the values stored in the data section of the tiddler"};config.macros.showData.handler=function(a,g,h){var c=0;var d=false;if((c<h.length)&&h[c]=="JSON"){c++;d=true}var b=story.findContainingTiddler(a).getAttribute("tiddler");if(c<h.length){b=h[c];c++}try{if(d){this.renderDataInJSONFormat(a,b)}else{this.renderDataAsTable(a,b)}}catch(f){this.createErrorElement(a,f)}};config.macros.showData.renderDataInJSONFormat=function(a,b){var c=DataTiddler.getDataText(b);if(c){createTiddlyElement(a,"pre",null,null,c)}};config.macros.showData.renderDataAsTable=function(a,b){var f="|!Name|!Value|\n";var e=DataTiddler.getDataObject(b);if(e){for(var c in e){var d=e[c];f+="|"+c+"|"+DataTiddler.stringify(d)+"|\n"}}wikify(f,a)};config.macros.showData.createErrorElement=function(a,b){var c=(b.description)?b.description:b.toString();return createTiddlyElement(a,"span",null,"showDataError","<<showData ...>>: "+c)};setStylesheet(".showDataError{color: #ffffff;background-color: #880000;}","showData")}var JSON={copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(c){var b=[];function f(a){b[b.length]=a}function d(a){var j,h=undefined,e,g;switch(typeof a){case"object":if(a){if(a instanceof Array){f("[");e=b.length;for(h=0;h<a.length;h+=1){g=a[h];if(typeof g!="undefined"&&typeof g!="function"){if(e<b.length){f(",")}d(g)}}f("]");return}else{if(typeof a.toString!="undefined"){f("{");e=b.length;for(h in a){g=a[h];if(a.hasOwnProperty(h)&&typeof g!="undefined"&&typeof g!="function"){if(e<b.length){f(",")}d(h);f(":");d(g)}}return f("}")}}}f("null");return;case"number":f(isFinite(a)?+a:"null");return;case"string":e=a.length;f('"');for(h=0;h<e;h+=1){j=a.charAt(h);if(j>=" "){if(j=="\\"||j=='"'){f("\\")}f(j)}else{switch(j){case"\b":f("\\b");break;case"\f":f("\\f");break;case"\n":f("\\n");break;case"\r":f("\\r");break;case"\t":f("\\t");break;default:j=j.charCodeAt();f("\\u00"+Math.floor(j/16).toString(16)+(j%16).toString(16))}}}f('"');return;case"boolean":f(String(a));return;default:f("null");return}}d(c);return b.join("")},parse:function(text){var p=/^\s*(([,:{}\[\]])|"(\\.|[^\x00-\x1f"\\])*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)\s*/,token=undefined,operator=undefined;function error(m,t){throw {name:"JSONError",message:m,text:t||operator||token}}function next(b){if(b&&b!=operator){error("Expected '"+b+"'")}if(text){var t=p.exec(text);if(t){if(t[2]){token=null;operator=t[2]}else{operator=null;try{token=eval(t[1])}catch(e){error("Bad token",t[1])}}text=text.substring(t[0].length)}else{error("Unrecognized token",text)}}else{token=operator=undefined}}function val(){var k,o;switch(operator){case"{":next("{");o={};if(operator!="}"){for(;;){if(operator||typeof token!="string"){error("Missing key")}k=token;next();next(":");o[k]=val();if(operator!=","){break}next(",")}}next("}");return o;case"[":next("[");o=[];if(operator!="]"){for(;;){o.push(val());if(operator!=","){break}next(",")}}next("]");return o;default:if(operator!==null){error("Missing value")}k=token;next();return k}}next();return val()}};DataTiddler.format="JSON";DataTiddler.stringify=JSON.stringify;DataTiddler.parse=JSON.parse;
//%/
!URL
http://www.microscopy-news.com/news/metamorph-nx-software-module-from-molecular-devices-sheds-new-light-on-multidimensional-datasets-from-the-inside-out.html

!Description
The MetaMorph NX Software 4D Viewer offers an extraordinary perspective of images, allowing researchers to thoroughly examine datasets in not just three dimensions, but in the fourth dimension that shows how the dataset changes over time. By combining volumetric and isosurface displays of channels with configurable levels of transparency, intensity thresholds, and color, the 4D Viewer presents the most holistic visualization possible of a multidimensional dataset.
!URL
http://ir.perkinelmer.com/releasedetail.cfm?ReleaseID=621462

!Description
PerkinElmer, Inc. (NYSE: PKI), a global leader focused on improving the health and safety of people and the environment, today announced that the Company has completed its acquisition of Caliper Life Sciences, Inc. (NASDAQ: CALP), a Hopkinton, Massachusetts-based leader in imaging and detection solutions for life sciences research, diagnostics and environmental markets. In September, PerkinElmer announced its intent to acquire Caliper for $10.50 per share, for a total net purchase price of approximately $600 million in cash.
''Method 1''
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost
Escape character is '^]'.
220 local.sendmail.org ESMTP Sendmail Sendmail 8.12.0/8.12.0; Sun, 30 Sep 2001 10:47:28 -0700 (PDT)
ehlo localhost
250-local.sendmail.org Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-DSN
250-STARTTLS
250 HELP
quit

''Method 2''
openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25
Diffraction
mode with a non-parallel beam. Main purposes:

# You want to hit the
sample with a cone: a lot of angles at the same time.
# It enables you
to see holtz lines
# It enables you to interpret more structural
information

Interpretation seems black magic.
<html>1)
Focus the beam using the intensity button<br />2) Centre the
beam<br />3) Defocus the beam using the intensity button<br
/>4) Manually center the beam (on a system with automated apertures
use the center checkbox)<br />5) Done</html>
/***
<<checkForDataTiddlerPlugin>>
|''Name:''|FormTiddlerPlugin|
|''Version:''|1.0.7 (2012-04-19)|
|''Summary:''|Use form-based tiddlers to enter your tiddler data using text fields, listboxes, checkboxes etc. (All standard HTML Form input elements supported).|
|''Documentation:''|[[Introduction|FormTiddler Introduction]], [[Examples|FormTiddler Examples]]|
|''Source:''|http://tiddlywiki.abego-software.de/#FormTiddlerPlugin|
|''Twitter:''|[[@abego|https://twitter.com/#!/abego]]|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''License:''|[[BSD open source license|http://www.abego-software.de/legal/apl-v10.html]]|
|''Requires:''|DataTiddlerPlugin|
!Description
Use form-based tiddlers to enter your tiddler data using text fields, listboxes, checkboxes etc. (All standard HTML Form input elements supported).

''Syntax:'' 
|>|{{{<<}}}''formTiddler'' //tiddlerName//{{{>>}}}|
|//tiddlerName//|The name of the FormTemplate tiddler to be used to edit the data of the tiddler containing the macro.|

|>|{{{<<}}}''newTiddlerWithForm'' //formTemplateName// //buttonLabel// [//titleExpression// [''askUser'']] {{{>>}}}|
|//formTemplateName//|The name of the tiddler that defines the form the new tiddler should use.|
|//buttonLabel//|The label of the button|
|//titleExpression//|A (quoted) JavaScript String expression that defines the title (/name) of the new tiddler.|
|''askUser''|Typically the user is not asked for the title when a title is specified (and not yet used). When ''askUser'' is given the user will be asked in any case. This may be used when the calculated title is just a suggestion that must be confirmed by the user|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|

For details and how to use the macros see the [[introduction|FormTiddler Introduction]] and the [[examples|FormTiddler Examples]].

!Source Code
***/
/***
This plugin's source code is compressed (and hidden). 
Use this [[link|http://tiddlywiki.abego-software.de/archive/FormTiddlerPlugin/1.0.7/FormTiddlerPlugin-1.0.7-src.js]] to get the readable source code.
***/
///%
if(!window.abego){window.abego={}}abego.getOptionsValue=function(c,b){var a=c.options[b].value;if(!a&&c.options[b].text){a=c.options[b].text}return a};version.extensions.FormTiddlerPlugin={major:1,minor:0,revision:7,date:new Date(2012,3,19),type:"plugin",source:"http://tiddlywiki.abego-software.de/#FormTiddlerPlugin"};if(!window.story){window.story=window}if(!TiddlyWiki.prototype.getTiddler){TiddlyWiki.prototype.getTiddler=function(a){return t=this.tiddlers[a];return(t!=undefined&&t instanceof Tiddler)?t:null}}config.macros.formTiddler={label:"formTiddler",prompt:"Edit tiddler data using forms",setter:{button:function(b,a){},checkbox:function(b,a){b.checked=a},file:function(b,a){try{b.value=a}catch(b){}},hidden:function(b,a){b.value=a},password:function(b,a){b.value=a},radio:function(b,a){b.checked=(b.value==a)},reset:function(b,a){},"select-one":function(b,a){config.macros.formTiddler.setSelectOneValue(b,a)},"select-multiple":function(b,a){config.macros.formTiddler.setSelectMultipleValue(b,a)},submit:function(b,a){},text:function(b,a){b.value=a},textarea:function(b,a){b.value=a}},getter:{button:function(b,a){return undefined},checkbox:function(b,a){return b.checked},file:function(b,a){return b.value},hidden:function(b,a){return b.value},password:function(b,a){return b.value},radio:function(b,a){return b.checked?b.value:undefined},reset:function(b,a){return undefined},"select-one":function(b,a){return config.macros.formTiddler.getSelectOneValue(b)},"select-multiple":function(b,a){return config.macros.formTiddler.getSelectMultipleValue(b)},submit:function(b,a){return undefined},text:function(b,a){return b.value},textarea:function(b,a){return b.value}}};config.macros.formTiddler.handler=function(g,c,f,h,d,n){if(!config.macros.formTiddler.checkForExtensions(g,c)){return}var j=0;var l=undefined;if(j<f.length){l=f[j];j++}if(!l){config.macros.formTiddler.createErrorElement(g,"No form template specified in <<"+c+">>.");return}var a=store.getTiddler(l);if(!a){config.macros.formTiddler.createErrorElement(g,"Form template '"+l+"' not found.");return}var m=a.text;if(!m){return}var b=config.macros.formTiddler.getContainingTiddlerName(g);var o="form"+l+"__"+b;var k=document.createElement("form");k.setAttribute("name",o);g.appendChild(k);wikify(m,k);config.macros.formTiddler.initValuesAndHandlersInFormElements(o,DataTiddler.getDataObject(b))};config.macros.formTiddler.initValuesAndHandlersInFormElements=function(l,f){var b=config.macros.formTiddler.findForm(l);if(!b){return}try{var a=b.elements;for(var g=0;g<a.length;g++){var j=a[g];var d=config.macros.formTiddler.setter[j.type];if(d){var k=f[j.name];if(k!=null){d(j,k)}j.onchange=onFormTiddlerChange}else{config.macros.formTiddler.displayFormTiddlerError("No setter defined for INPUT element of type '"+j.type+"'. (Element '"+j.name+"' in form '"+l+"')")}}}catch(h){config.macros.formTiddler.displayFormTiddlerError("Error when updating elements with new formData. "+h)}};config.macros.formTiddler.findForm=function(c){var a=window.document.forms;for(var b=0;b<a.length;b++){var d=a[b];if(d.name==c){return d}}return null};config.macros.formTiddler.setSelectOneValue=function(b,c){var d=b.options.length;for(var a=0;a<d;a++){b.options[a].selected=abego.getOptionsValue(b,a)==c}};config.macros.formTiddler.setSelectMultipleValue=function(c,d){var a={};for(var b=0;b<d.length;b++){a[d[b]]=true}var e=c.length;for(var b=0;b<e;b++){c.options[b].selected=!(!a[abego.getOptionsValue(c,b)])}};config.macros.formTiddler.getSelectOneValue=function(b){var a=b.selectedIndex;return(a>=0)?abego.getOptionsValue(b,a):null};config.macros.formTiddler.getSelectMultipleValue=function(c){var a=[];var d=c.length;for(var b=0;b<d;b++){if(c.options[b].selected){a.push(abego.getOptionsValue(c,b))}}return a};config.macros.formTiddler.checkForExtensions=function(a,b){if(!version.extensions.DataTiddlerPlugin){config.macros.formTiddler.createErrorElement(a,"<<"+b+">> requires the DataTiddlerPlugin. (You can get it from http://tiddlywiki.abego-software.de/#DataTiddlerPlugin)");return false}return true};config.macros.formTiddler.trace=function(a){displayMessage("Trace: "+a)};config.macros.formTiddler.displayFormTiddlerError=function(a){alert("FormTiddlerPlugin Error: "+a)};config.macros.formTiddler.createErrorElement=function(a,b){return createTiddlyElement(a,"span",null,"formTiddlerError",b)};config.macros.formTiddler.getContainingTiddlerName=function(a){return story.findContainingTiddler(a).getAttribute("tiddler")};function onFormTiddlerChange(f){if(!f){f=window.event}var d=resolveTarget(f);var b=config.macros.formTiddler.getContainingTiddlerName(d);var a=config.macros.formTiddler.getter[d.type];if(a){var c=a(d);DataTiddler.setData(b,d.name,c)}else{config.macros.formTiddler.displayFormTiddlerError("No getter defined for INPUT element of type '"+d.type+"'. (Element '"+d.name+"' used in tiddler '"+b+"')")}}window.onFormTiddlerChange=onFormTiddlerChange;setStylesheet(".formTiddlerError{color: #ffffff;background-color: #880000;}","formTiddler");config.macros.checkForDataTiddlerPlugin={label:"checkForDataTiddlerPlugin",version:{major:1,minor:0,revision:0,date:new Date(2005,12,14)},prompt:"Check if the DataTiddlerPlugin exists"};config.macros.checkForDataTiddlerPlugin.handler=function(a,b,c){config.macros.formTiddler.checkForExtensions(a,config.macros.formTiddler.label)};config.macros.newTiddlerWithForm={label:"newTiddlerWithForm",version:{major:1,minor:0,revision:1,date:new Date(2006,1,6)},prompt:"Creates a new Tiddler with a <<formTiddler ...>> macro"};config.macros.newTiddlerWithForm.handler=function(place,macroName,params){var i=0;var formTemplateName=undefined;if(i<params.length){formTemplateName=params[i];i++}if(!formTemplateName){config.macros.formTiddler.createErrorElement(place,"No form template specified in <<"+macroName+">>.");return}var buttonLabel=undefined;if(i<params.length){buttonLabel=params[i];i++}if(!buttonLabel){config.macros.formTiddler.createErrorElement(place,"No button label specified in <<"+macroName+">>.");return}var tiddlerNameScript=undefined;var askUser=false;if(i<params.length){tiddlerNameScript=params[i];i++;if(i<params.length&&params[i]=="askUser"){askUser=true;i++}}if(!readOnly){var onClick=function(){var tiddlerName=undefined;if(tiddlerNameScript){try{tiddlerName=eval(tiddlerNameScript)}catch(ex){}}if(!tiddlerName||askUser){tiddlerName=prompt("Please specify a tiddler name.",askUser?tiddlerName:"")}while(tiddlerName&&store.getTiddler(tiddlerName)){tiddlerName=prompt("A tiddler named '"+tiddlerName+"' already exists.\n\nPlease specify a tiddler name.",tiddlerName)}if(tiddlerName){var body="<<formTiddler [["+formTemplateName+"]]>>";var tags=[];store.saveTiddler(tiddlerName,tiddlerName,body,config.options.txtUserName,new Date(),tags);story.displayTiddler(null,tiddlerName,1)}};createTiddlyButton(place,buttonLabel,buttonLabel,onClick)}};
//%/
<<QuickTimeFragment "/static/files/Microscopy/2008.02.15-mse640-l2-part2.mp4">>

Find the slides at:
/static/files/Microscopy/2008.02.15-mse640-l2-part2.pdf
Orignally copied material from: http://nanohub.org/resources/4092
Higher resolution than a [TWIN Lens]]. Tolerances are more narrow. Optical specifications are better.
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2010.12.15 1.9.6 allow (but ignore) type="..." syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 6, date: new Date(2010,12,15)};

config.formatters.push( {
	name: "inlineJavascript",
	match: "\\<script",
	lookahead: "\\<script(?: type=\\\"[^\\\"]*\\\")?(?: src=\\\"([^\\\"]*)\\\")?(?: label=\\\"([^\\\"]*)\\\")?(?: title=\\\"([^\\\"]*)\\\")?(?: key=\\\"([^\\\"]*)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var src=lookaheadMatch[1];
			var label=lookaheadMatch[2];
			var tip=lookaheadMatch[3];
			var key=lookaheadMatch[4];
			var show=lookaheadMatch[5];
			var code=lookaheadMatch[6];
			if (src) { // external script library
				var script = document.createElement("script"); script.src = src;
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (code) { // inline code
				if (show) // display source in tiddler
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (label) { // create 'onclick' command link
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
					var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
					link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
					link.tiddler=w.tiddler;
					link.onclick=function(){
						this.bufferedHTML="";
						try{ var r=eval(this.code);
							if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
								var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
							if(this.bufferedHTML.length)
								s.innerHTML=this.bufferedHTML;
							if((typeof(r)==="string")&&r.length) {
								wikify(r,s,null,this.tiddler);
								return false;
							} else return r!==undefined?r:false;
						} catch(e){alert(e.description||e.toString());return false;}
					};
					link.setAttribute("title",tip||"");
					var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
					URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
					URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
					link.setAttribute("href",URIcode);
					link.style.cursor="pointer";
					if (key) link.accessKey=key.substr(0,1); // single character only
				}
				else { // run script immediately
					var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
					var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
					try	 { var out=eval(c); }
					catch(e) { out=e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
//}}}

// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
	if(limit > 0) text = text.substr(0,limit);
	var wikifier = new Wikifier(text,formatter,null,tiddler);
	return wikifier.wikifyPlain();
}
//}}}

// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
!URL
http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6V47-4PHSFS1-4&_user=10&_coverDate=11%2F30%2F2007&_rdoc=1&_fmt=high&_orig=search&_origin=search&_sort=d&_docanchor=&view=c&_searchStrId=1549548847&_rerunOrigin=google&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=d5d57c9310c5a0be36133fe69e977307&searchtype=a

!Description
Three dimensional chip inspection with sub micron resolution is essential for physical failure analysis. The established approaches often require cross sections, destroying the device under test. This paper presents a non destructive way to gain precise geometrical information of the transistor- and metal-one-layer with the use of state of the art backside FIB preparation and backscattered electron microscopy.
Energy
loss > 100eV

For the ionization of atoms, a specific minimum
energy, the critical ionization energy EC or ionization threshold, must
be transferred from the incident electron to the expelled inner-shell
electron, which leads to ionization edges in the spectrum at energy
losses that are characteristic for an element. Thus, EELS is
complementary to X-ray spectroscopy, and it can be utilized for
qualitative and quantitative element analysis as well. In particular,
the detection of light elements is a main task of EELS. 
Compared to
the plasmon generation, the inner-shell ionization is a much less
probable process, leading to a low intensity of the peaks. In the
high-loss region, the amount of inelastically scattered electrons
drastically decreases with increasing energy loss, thus small peaks are
superimposed on a strongly decreasing background (s. spectrum). Because
of the low intensity, the representation of the high-loss region is
often strongly enhanced (here: intensity gap at about 220 eV).
$\large \alpha$ = \alpha
$\large \beta$ = \beta
$\large \gamma$ = \gamma
$\large \delta$ = \delta
$\large \epsilon$ = \epsilon
$\large \zeta$ = \zeta
$\large \eta$ = \eta
$\large \theta$ = \theta
$\large \iota$ = \iota
$\large \kappa$ = \kappa
$\large \lambda$ = \lambda
$\large \mu$ = \mu
$\large \nu$ = \nu
$\large \xi$ = \xi
$\large \pi$ = \pi
$\large \rho$ = \rho
$\large \sigma$ = \sigma
$\large \tau$ = \tau
$\large \upsilon$ = \upsilon
$\large \phi$ = \phi
$\large \chi$ = \chi
$\large \psi$ = \psi
$\large \omega$ = \omega
$\large \Gamma$ = \Gamma
$\large \Delta$ = \Delta
$\large \Theta$ = \Theta
$\large \Lambda$ = \Lambda
$\large \Xi$ = \Xi
$\large \Pi$ = \Pi
$\large \Sigma$ = \Sigma
$\large \Upsilon$ = \Upsilon
$\large \Phi$ = \Phi
$\large \Psi$ = \Psi
$\large \Omega$ = \Omega
<<sync>>
|~ViewToolbar|closeTiddler +editTiddler +cloneTiddler > fields publishTiddler pubRev revisions syncing permalink references jump closeOthers snapshotPrint|
|~EditToolbar|+saveTiddler saveDraft -cancelTiddler deleteTiddler|
|~RevisionToolbar|> fields revert|
!URL
http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6V06-4JX9V3K-1&_user=10&_coverDate=10%2F31%2F2006&_rdoc=1&_fmt=high&_orig=search&_origin=search&_sort=d&_docanchor=&view=c&_searchStrId=1549581724&_rerunOrigin=scholar.google&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=8ef8cf710b009bce5bf7eb8b8b1bd801&searchtype=a

!Description
At iGrid 2005 we demonstrated the transparent operation of a biology experiment on a test-bed of globally distributed visualization, storage, computational, and network resources. These resources were bundled into a unified platform by utilizing dynamic lambda allocation, high bandwidth protocols for optical networks, a Distributed Virtual Computer (DVC) [N. Taesombut, A. Chien, Distributed Virtual Computer (DVC): Simplifying the development of high performance grid applications, in: Proceedings of the Workshop on Grids and Advanced Networks, GAN 04, Chicago, IL, April 2004 (held in conjunction with the IEEE Cluster Computing and the Grid (CCGrid2004) Conference)], and applications running over the Scalable Adaptive Graphics Environment (SAGE) [L. Renambot, A. Rao, R. Singh, B. Jeong, N. Krishnaprasad, V. Vishwanath, V. Chandrasekhar, N. Schwarz, A. Spale, C. Zhang, G. Goldman, J. Leigh, A. Johnson, SAGE: The Scalable Adaptive Graphics Environment, in: Proceedings of WACE 2004, 23–24 S
!URL
http://www.sciencedaily.com/releases/2011/01/110124091247.htm

!Description
the method builds on the advantages of a powerful existing technology known as electrochemical impedance spectroscopy (EIS). Here, an AC voltage is applied to an electrode and the current response is measured as a change in impedance. (Impedance is defined as opposition to alternating current and extends the idea of electrical resistance to AC circuits.)
<html>
<!-- begin embedded QuickTime file... -->
      <!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="left">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320"
        height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="/static/files/Microscopy/2008.04.21-mse640-l18.mp4">
        <param name='autoplay' value="false">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src="/static/files/Microscopy/2008.04.21-mse640-l18.mp4" width="320" height="255" autoplay="false" 
        controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table>
</html>

Find the slides at: /static/files/Microscopy/2008.04.21-mse640-l18.pdf
Orignally copied material from: http://nanohub.org/resources/4092
!URL
http://www.nanowerk.com/news/newsid=24069.php

!Description
(Nanowerk News) Custom modifications of equipment are an honored tradition of the research lab. In a recent paper ("Transmission EBSD from 10 nm domains in a scanning electron microscope"), two materials scientists at the National Institute of Standards and Technology (NIST) describe how a relatively simple mod of a standard scanning electron microscope (SEM) enables a roughly 10-fold improvement in its ability to measure the crystal structure of nanoparticles and extremely thin films. By altering the sample position, they are able to determine crystal structure of particles as small as 10 nanometers. The technique, they say, should be applicable to a wide range of work, from crime scene forensics to environmental monitoring to process control in nanomanufacturing.
In mathematics, a surface integral is a definite integral taken over a surface (which may be a curve set in space); it can be thought of as the double integral analog of the line integral. Given a surface, one may integrate over its scalar fields (that is, functions which return numbers as values), and vector fields (that is, functions which return vectors as values).

Surface integrals have applications in physics, particularly with the classical theory of electromagnetism. The definition of surface integral relies on splitting the surface into small surface elements:

<<image /static/files/Math/800px-Surface_integral_illustration.png width:400>>

An illustration of a single surface element. These elements are made infinitesimally small, by the limiting process, so as to approximate the surface:
<<image /static/files/Math/429px-Surface_integral.png width:400>>
Energy Filtered TEM

[Img[http://www.microscopy.ethz.ch/images/GIF.jpg]]
!URL
http://www.laboratory-journal.com/science/medicine-diagnostics/multimodal-nonlinear-microscopy-histopathology-brain-tumors

!Description
y combining three nonlinear microscopic imaging techniques to a multimodal microscopy approach, similar information on the morphology and chemical composition of unprocessed tissue can be extracted. Much greater depth penetration can be achieved in comparison to conventional light microscopy. This all-optical approach fuses coherent anti-Stokes Raman scattering (CARS), second-harmonic generation (SHG) and two-photon excited fluorescence (TPEF) imaging into a single microscopic setup.
<<QuickTimeFragment "/static/files/Microscopy/2008.03.07-mse640-review567.mp4">>

Find the slides at:
/static/files/Microscopy/2008.03.07-mse640-review567.pdf
Orignally copied material from: http://nanohub.org/resources/4092
In Scherzer defocus, one aims to choose the right defocus value Δf one flattens χ(u) and creates a wide band where low spatial frequencies u are transferred into image intensity with a similar phase. In 1949, Scherzer found that the optimum defocus depends on microscope properties like the spherical aberration Cs and the accelerating voltage (through λ) in the following way:

[img[http://tiddly.vanwill.com/uploads/workspace/default/ScherzerFormula.JPG][EmbeddedImages]]

where the factor 1.2 defines the extended Scherzer defocus. For example, when Cs=0.6 and an accelerating voltage is 300keV result in ΔfScherzer = -41,25 nm.
The [[point resolution]] of a microscope is defined as the spatial frequency ures where the CTF crosses the X-axis for the first time. At Scherzer defocus this value is maximized. 

[img[http://tiddly.vanwill.com/uploads/workspace/default/Scherzer.JPG][EmbeddedImages]]
!URL
http://www.imaging-git.com/science/scanning-probe-microscopy/afm-ir-enables-nanoscale-chemical-spectroscopy

!Description
Atomic force microscopy (AFM) has been enormously successful addressing problems in basic nanoscale research as well as applied problems in materials science and engineering. The technique as part of a family of scanning probe microscopy (SPM) variants has been widely credited with enabling the multi-billion dollar research investments in nanoscience and nanotechnology. However, a clear gap in AFM capabilities is the ability to chemically characterize regions of the sample. In fact, the ability to identify material under the tip of an AFM has been identified as one of the „Holy Grails" of probe microscopy. While AFM can measure mechanical, electrical, magnetic and thermal properties of materials, it has lacked the robust ability to chemically characterize unknown materials.
Convergent beam: Mode for STEM imaging
!URL
http://www.imaging-git.com/news/sharp-advanced-extreme-ultraviolet-microscopy-developing-microchips

!Description
Scientists at the U.S. Department of Energy's Lawrence Berkeley National Laboratory (Berkeley Lab) have partnered with colleagues at semiconductor manufacturers to create the world's most advanced extreme-ultraviolet (EUV) microscope. Called SHARP (a succinct acronym for a long name, the Semiconductor High-NA Actinic Reticle Review Project), the new microscope will be dedicated to photolithography, the central process in the creation of computer chips.
<<QuickTimeFragment "/static/files/Microscopy/2008.04.02-mse640-l12-part2.mp4">>

/static/files/Microscopy/2008.04.02-mse640-l12-part2.pdf
Orignally copied material from: http://nanohub.org/resources/4092
Click the "new tiddler" button towards the top right of the screen to write something in your space. You'll need to give it a title, some content and, optionally, some tags that will help you identify it later.

!Stuck for ideas?
Not sure what to write about? Not sure what to keep in your space? Other people use ~TiddlySpace for almost anything. How about some of the following:

* [[Save interesting sites|http://bookmarks.tiddlyspace.com]], images or articles from around the web so that you can refer back to them.
* [[Record your family tree|http://familytree.tiddlyspace.com]], store notes on long lost relatives or ancestors and map their relationship to you.
* [[Make up a pocketbook|http://pocketbook.tiddlyspace.com]] to store some useful information in, then print it out, [[fold it up|http://www.pocketmod.com/]], and take it with you.
* [[Plan your holiday|http://the-web-is-your-oyster.tiddlyspace.com/]], record where you're planning to go, note down places of interest and refer back to it later.
* [[Create a mindmap|http://mindmaps.tiddlyspace.com/]] to visualise your inner thoughts and see how they relate to each other.
* [[Set up a questionnaire|http://questionnaire.tiddlyspace.com/]] and get all your friends to answer it.

If you don't like any of those ideas, you can still use this space directly to keep notes and link them together, make a todo list and keep track of everything you're doing, or any one of a hundred million other things.

Still stuck? Check out the @featured space for more suggestions.

You can also [[socialise with others|How to socialise]].
The intensity knob is controlling the C2 lens
The focus knob is controlling the objective lens
/***
|''Name''|TiddlySpaceViewTypes|
|''Version''|0.5.4|
|''Status''|@@beta@@|
|''Description''|Provides TiddlySpace specific view types|
|''Author''|Jon Robson|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceViewTypes.js|
|''Requires''|TiddlySpaceConfig TiddlySpaceTiddlerIconsPlugin|
!Usage
Provides replyLink, spaceLink and SiteIcon view types.
!!SiteIcon view parameters
* labelPrefix / labelSuffix : prefix or suffix the label with additional text. eg. labelPrefix:'modified by '
* spaceLink: if set to "yes" will make any avatars link to the corresponding space. {{{<<originMacro spaceLink:yes>>}}}

!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var originMacro = config.macros.tiddlerOrigin;

config.macros.view.replyLink = {
	locale: {
		label: "Reply to this tiddler"
	}
};

config.macros.view.views.replyLink = function(value, place, params, wikifier,
		paramString, tiddler) {
	var valueField = params[0];
	var imported;
	if(valueField == "title") { // special casing for imported tiddlers
		var localTitle = tiddler.title;
		var serverTitle = tiddler.fields["server.title"];
		if(serverTitle && localTitle != serverTitle) {
			value = serverTitle ? serverTitle : localTitle;
			imported = true;
		}
	} else {
		title = tiddler[valueField] ? tiddler[valueField] : tiddler.fields[valueField];
	}
	var args = paramString.parseParams("anon")[0];
	var label = (args.label) ? args.label : config.macros.view.replyLink.locale.label;
	var space;
	if(tiddler) {
		var bag = tiddler.fields["server.bag"];
		space = tiddlyspace.resolveSpaceName(bag);
	}
	var container = $('<span class="replyLink" />').appendTo(place)[0];
	config.extensions.tiddlyweb.getUserInfo(function(user) {
		if(!user.anon) {
			if((space && user.name != space &&
					user.name != tiddlyspace.currentSpace.name) || imported) {
				createSpaceLink(container, user.name, value, label);
			}
		}
	});
};

config.macros.view.views.spaceLink = function(value, place, params, wikifier,
		paramString, tiddler) {
		var spaceName = tiddlyspace.resolveSpaceName(value);
		var isBag = params[0] == "server.bag" && value === spaceName ? true : false;
		var args = paramString.parseParams("anon")[0];
		var titleField = args.anon[2];
		var labelField = args.labelField ? args.labelField[0] : false;
		var label;
		if(labelField) {
			label = tiddler[labelField] ? tiddler[labelField] : tiddler.fields[labelField];
		} else {
			label = args.label ? args.label[0] : false;
		}
		var title = tiddler[titleField] ? tiddler[titleField] : tiddler.fields[titleField];

		var link = createSpaceLink(place, spaceName, title, label, isBag);
		if(args.external && args.external[0] == "no") {
			$(link).click(function(ev) {
				var el = $(ev.target);
				var title = el.attr("tiddler");
				var bag = el.attr("bag");
				var space = el.attr("tiddlyspace");
				bag = space ? space + "_public" : bag;
				if(title && bag) {
					ev.preventDefault();
					tiddlyspace.displayServerTiddler(el[0], title,
						"bags/" + bag);
				}
				return false;
			});
		}
};

config.macros.view.views.SiteIcon = function(value, place, params, wikifier,
		paramString, tiddler) {
	var options = originMacro.getOptions(paramString);
	if(!tiddler || value == "None") { // some core tiddlers lack modifier
		value = false;
	}
	var field = params[0];
	if(field == "server.bag") {
		options.notSpace = !originMacro._isSpace(value);
	}
	tiddlyspace.renderAvatar(place, value, options);
};

})(jQuery);
//}}}
!URL
http://www.simpleware.com/software/

!Description
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="78 222 60 60" 
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 107.92718 244.14815 L 86.651474 222.89253 L 78.85206 230.69925 L 100.120415 251.9476 L 78.774 273.27396 
		L 86.57342 281.08075 L 107.927216 259.74707 L 129.39981 281.19946 L 137.19922 273.39267 L 115.73397 251.94763 
		L 137.121155 230.58054 L 129.32175 222.77374 Z" fill="black" class="glyph"/>
	</g>
</g>
</svg>
/***
|''Name''|ToggleTiddlerPrivacyPlugin|
|''Version''|0.7.0|
|''Status''|@@beta@@|
|''Description''|Allows you to set the privacy of new tiddlers and external tiddlers within an EditTemplate, and allows you to set a default privacy setting|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/ToggleTiddlerPrivacyPlugin.js|
!Notes
When used in conjunction with TiddlySpaceTiddlerIconsPlugin changing the privacy setting will also interact with any privacy icons.

Currently use of
{{{<<setPrivacy defaultValue:public>>}}} is in conflict with {{{<<newTiddler fields:"server.workspace:x_private">>}}}

There is an option, found in the tweak tab of the backstage, called txtPrivacyMode. Set this to either ''public'' or ''private'' depending on your security preference. If you choose not to set it then it will default to ''public''.
!Params
defaultValue:[private|public]
Allows you to set the default privacy value (Default is private)

!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var macro = config.macros.setPrivacy = {
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		if(readOnly) {
			return;
		}
		var el = $(story.findContainingTiddler(place));
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var container = $("<div />").addClass("privacySettings").appendTo(place)[0];
		var currentSpace = tiddlyspace.currentSpace.name;
		var currentBag = tiddler ? tiddler.fields["server.bag"] : false;
		var isNewTiddler = el.hasClass("missing") || !currentBag; // XXX: is this reliable?
		var status = tiddlyspace.getTiddlerStatusType(tiddler);
		var customFields = el.attr("tiddlyfields");
		customFields = customFields ? customFields.decodeHashMap() : {};
		if(isNewTiddler || !["public", "private", "unsyncedPrivate", "unsyncedPublic"].contains(status)) {
			var defaultValue = "public";
			if(args.defaultValue) {
				defaultValue = args.defaultValue[0].toLowerCase();
			} else {
				defaultValue = config.options.chkPrivateMode ? "private" : "public";
			}
			defaultValue = defaultValue ?
				"%0_%1".format(currentSpace, defaultValue) : customFields["server.bag"];
			var options = config.macros.tiddlerOrigin ?
				config.macros.tiddlerOrigin.getOptions(paramString) : {};
			this.createRoundel(container, tiddler, currentSpace, defaultValue, options);
		}
	},
	updateEditFields: function(tiddlerEl, bag) {
		var saveBagField = $('[edit="server.bag"]', tiddlerEl);
		var saveWorkspaceField = $('[edit="server.workspace"]', tiddlerEl);
		var input = $("<input />").attr("type", "hidden");
		if(saveBagField.length === 0) {
			input.clone().attr("edit", "server.bag").val(bag).appendTo(tiddlerEl);
		} else {
			saveBagField.val(bag);
		}
		$(tiddlerEl).attr("tiddlyFields", ""); // reset to prevent side effects
		var workspace = "bags/" + bag;
		if(saveWorkspaceField.length === 0) {
			input.clone().attr("edit", "server.workspace").val(workspace).appendTo(tiddlerEl);
		} else {
			saveWorkspaceField.val(workspace);
		}
	},
	setBag: function(tiddlerEl, newBag, options) {
		var title = $(tiddlerEl).attr("tiddler");
		var tiddler = store.getTiddler(title);
		var originButton = $(".originButton", tiddlerEl)[0];
		var refreshIcon = function(type) {
			var originMacro = config.macros.tiddlerOrigin;
			if(originButton && originMacro) {
				options.noclick = true;
				originMacro.showPrivacyRoundel(tiddler, type, originButton, options);
			}
		};
		macro.updateEditFields(tiddlerEl, newBag);
		var newWorkspace = "bags/" + newBag;
		if(tiddler) {
			tiddler.fields["server.bag"] = newBag;
			tiddler.fields["server.workspace"] = newWorkspace; // for external tiddlers
		}
		var rPrivate = $("input[type=radio].isPrivate", tiddlerEl);
		var rPublic = $("input[type=radio].isPublic", tiddlerEl);
		if(newBag.indexOf("_public") > -1) {
			rPrivate.attr("checked", false);
			rPublic.attr("checked", true);
			status = "public";
		} else {
			rPublic.attr("checked", false); // explicitly do this for ie
			rPrivate.attr("checked", true);
			status = "private";
		}
		refreshIcon(status);
	},
	createRoundel: function(container, tiddler, currentSpace, defaultValue, options) {
		var privateBag = "%0_private".format(currentSpace);
		var publicBag = "%0_public".format(currentSpace);
		var rbtn = $("<input />").attr("type", "radio").attr("name", tiddler.title);
		var rPrivate = rbtn.clone().val("private").addClass("isPrivate").appendTo(container);
		$("<label />").text("private").appendTo(container); // TODO: i18n
		var rPublic = rbtn.clone().val("public").addClass("isPublic").appendTo(container);
		$("<label />").text("public").appendTo(container); // TODO: i18n
		var el = story.findContainingTiddler(container);
		$("[type=radio]", container).click(function(ev) {
			var btn = $(ev.target);
			tiddler.fields["server.page.revision"] = "false";
			if(btn.hasClass("isPrivate")) { // private button clicked.
				$(el).addClass("isPrivate").removeClass("isPublic");
				macro.setBag(el, privateBag, options);
			} else {
				$(el).addClass("isPublic").removeClass("isPrivate");
				macro.setBag(el, publicBag, options);
			}
		});
		window.setTimeout(function() {
			macro.setBag(el, defaultValue, options);
		}, 100);
		// annoyingly this is needed as customFields are added to end of EditTemplate so are not present yet
		// and don't seem to respect any existing customFields.
	}
};

})(jQuery);
//}}}
{{{
config.macros.FlvFragment = {
  handler: function (place, macroName, params, wikifier, paramString, tiddler)
  {
     var movie;

     if (params[0] != null)
     {
           movie = params[0];
     }

     resultString = '<html>';
     resultString += '<embed ';
     resultString += 'src="/static/mediaplayer/player.swf"'
     resultString += 'width="640"';
     resultString += 'height="390"';
     resultString += 'allowscriptaccess="always"';
     resultString += 'allowfullscreen="true"';
     resultString += 'id="player1"';
     resultString += 'name="player1"';
     resultString += 'flashvars="file=';
     resultString += movie;
     resultString += '"&dock=true&menu=false"';
     resultString += '/>';
     resultString += '</html>';

     wikify(resultString,place);
   }
 }
}}}
!URL
http://m.phys.org/news/2013-04-imaging-technology-reveal-cellular-secrets.html

!Description
Atomic Force Microscopy-Coupled Microcoils for Cellular-Scale Nuclear Magnetic Resonance Spectroscopy
<<QuickTimeFragment "/static/files/Microscopy/2008.04.18-mse640-l17.mp4" >>

Find the slides at: /static/files/Microscopy/2008.04.18-mse640-l17.pdf
Orignally copied material from: http://nanohub.org/resources/4092
!URL
http://www.microscopy-news.com/news/nist-s-new-scanning-probe-microscope-is-supercool.html

!Description
The discoveries of superconductivity, the quantum Hall effect and the fractional quantum Hall effect were all the result of measurements made at increasingly lower temperatures. Now, pushing the regime of the very cold into the very small, a research team from the National Institute of Standards and Technology (NIST), the University of Maryland, Janis Research Company, Inc., and Seoul National University, has designed and built the most advanced ultra-low temperature scanning probe microscope (ULTSPM) in the world.

Detailed in a recent paper,* the ULTSPM operates at lower temperatures and higher magnetic fields than any other similar microscope, capabilities that enable the device to resolve energy levels separated by as small as 1 millionth of an electron volt. This extraordinary resolution has already resulted in the discovery of new physics (see "Puzzling New Physics from Graphene Quartet's Quantum Harmonies").

The ULTSPM lab rests on a separate 110-ton concrete slab (1), supporte
!URL
http://u759.curie.u-psud.fr/softwaresu759.html

!Description
Used
on a Tecnai for selecting an area within the TEM image to do
diffraction analysis. On a Titan. It is not required as the beam can be
made parallel using the C3 lens.
!URL
http://www.rdmag.com/News/Feeds/2011/01/life-sciences-scripps-research-team-creates-new-synthetic-compou/

!Description
LA JOLLA, CA  January 18, 2011  Using chemical compounds found in a Japanese plant as a lead and the clever application of ultraviolet light, a Scripps Research Institute team has created a unique library of dozens of synthetic compounds to test for biomedical potential. Already, one of the compounds has shown great promise in inhibiting replication of HIV particles and fighting inflammation.
Applications:

*
Used to see strain in material
* Material composition

Primairly
used to learn the 'structure' of the chrystal and the 'orientation' of
the chrystal.

http://www.microscopy.ethz.ch/ED-1.htm

Diffraction
is interference patterns of electron waves generated by the interaction
of electrons with the sample.
!URL
http://www.microscopy-news.com/news/fifth-international-conference-progress-and-trends-in-bionanoscopy---15-17-june-2011---moscow-russia.html

!Description
/***
|''Name''|ErrorHandlerPlugin|
|''Version''|0.4.3|
|''Author''|Jon Robson|
|''Description''|Localised tiddler save errors including edit conflict resolution.|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig|
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var currentSpace = tiddlyspace.currentSpace.name;
tiddlyspace.getLocalTitle = function(title, workspace, suffix) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	if(!suffix) {
		var isPublic = endsWith(workspace, "_public");
		suffix = tiddlyspace.resolveSpaceName(workspace);
		if(currentSpace == suffix) {
			suffix = isPublic ? "public" : "private";
		} else {
			suffix = "@%0".format(suffix);
		}
	}
	return "%0 *(%1)*".format(title, suffix);
};

var sssp = config.extensions.ServerSideSavingPlugin;

var msgs = config.messages.editConflict = {
	loading: "Loading..",
	resolve: "[[Edit Conflict]]@glossary: this tiddler may have been changed by someone else.",
	reviewDiff: "review (recommended)",
	reviewDiffTooltip: "review changes made to this tiddler",
	reviewDiffError: "error retrieving revision.",
	save: "overwrite",
	saveTooltip: "make this revision the top revision of this tiddler",
	discard: "cancel",
	discardTooltip: "undo changes to this tiddler and get most recent version",
	diffTitle: "%0",
	diffFieldTitle: "%0 - fields",
	diffTextTitle: "%0 - text",
	updating: "updating your version...",
	diffHeader: ["Review the changes that have been made whilst you were editing this tiddler. ",
		"Fold relevant changes back into your version.\n",
		"{{removed{Red}}} highlight shows content removed. ",
		"{{added{Green}}} highlight shows content added.\n"].join(""),
	diffTextHeader: "View changes in text",
	diffFieldsHeader: "View changes in fields"
};

var plugin = config.extensions.errorHandler = {
	diffTags: ["excludeLists", "excludeMissing", "excludeSearch"],
	displayMessage: function(message, tiddler, context) {
		var desc = context && context.httpStatus ? context.statusText :
			sssp.locale.connectionError;
		var reportArea = plugin.reportError(tiddler.title);
		var msg = $("<div />").appendTo(reportArea);
		if(message == "saveConflict") {
			wikify(msgs.resolve, msg[0]);
			var choiceArea = $("<div />").appendTo(reportArea)[0];
			plugin.editConflictHandler(choiceArea, tiddler);
		} else {
			msg.text(sssp.locale[message].format(tiddler.title, desc));
		}
	},
	editConflictHandler: function(container, tiddler) {
		var title = tiddler.title;
		var myrev = tiddler.fields["server.page.revision"];
		// note user now needs to edit, fix problem and save. 
		// TODO: make sure this gets reset in save callback
		store.getTiddler(title).fields["server.page.revision"] = "false";

		var diffBtn = createTiddlyButton(container, msgs.reviewDiff, msgs.reviewDiffTooltip, function(ev) {
			var title = $(ev.target).data("title");
			plugin.displayDiff(ev.target, store.getTiddler(title), myrev);
		});
		var saveBtn = createTiddlyButton(container, msgs.save, msgs.saveTooltip, function(ev) {
				var title = $(ev.target).data("title");
				var tid = store.saveTiddler(store.getTiddler(title));
				autoSaveChanges(null, [tid]);
			});
		var ignoreBtn = createTiddlyButton(container, msgs.discard, msgs.discardTooltip, function(ev) {
			var title = $(ev.target).text(msgs.updating).data("title");
			plugin.resetToServerVersion(store.getTiddler(title));
		});
		$([diffBtn, ignoreBtn, saveBtn]).data("title", title);
	},
	getDiffTiddlerTexts: function(diffText) {
		var chunks = diffText.split("\n  \n");
		if(chunks.length < 2) {
			return [chunks[0], ""];
		} else {
			var diffFieldsText = "{{diff{\n%0\n}}}".format(chunks[0]);
			diffText = '{{diff{\n%0\n}}}'.format(chunks.splice(1, chunks.length).join("\n"));
			return [diffText, diffFieldsText];
		}
	},
	makeDiffTiddler: function(title, diff) {
		var newTiddler = new Tiddler(title);
		var tags = plugin.diffTags;
		newTiddler.text = msgs.loading;
		newTiddler.fields.doNotSave = true;
		newTiddler.tags = diff ? tags.concat(["diff"]) : tags;
		newTiddler = store.saveTiddler(newTiddler);
		$.extend(store.getTiddler(title).fields,
			config.defaultCustomFields); // allow option to save it
		return newTiddler;
	},
	displayDiff: function(src, tiddler, latestRevision) {
		var adaptor = tiddler.getAdaptor();
		var title = tiddler.title;
		var ts = new Date().formatString("0hh:0mm:0ss");
		var suffix = "edit conflict %0".format(ts);
		var diffTitle = tiddlyspace.getLocalTitle(msgs.diffTitle.format(title), "", suffix);
		var diffTextTitle = tiddlyspace.getLocalTitle(msgs.diffTextTitle.format(title), "", suffix);
		var diffFieldsTitle = tiddlyspace.getLocalTitle(msgs.diffFieldTitle.format(title), "", suffix);
		plugin.makeDiffTiddler(diffTextTitle, true);
		plugin.makeDiffTiddler(diffFieldsTitle, true);
		var newTiddler = plugin.makeDiffTiddler(diffTitle, false);
		newTiddler.text = ['%0\n<<slider chkViewDiffText "%1" "%2">>\n',
			'<<slider chkViewDiffField "%3" "%4">>'].join("").
			format(msgs.diffHeader, diffTextTitle, msgs.diffTextHeader,
				diffFieldsTitle, msgs.diffFieldsHeader);
		store.saveTiddler(newTiddler);

		var callback = function(r) {
			var text = plugin.getDiffTiddlerTexts(r);
			store.getTiddler(diffTextTitle).text = text[0];
			store.getTiddler(diffFieldsTitle).text = text[1];
			story.refreshTiddler(diffTitle, null, true);
		};
		var workspace = "bags/%0".format(tiddler.fields["server.bag"]);
		ajaxReq({
			type: "get",
			dataType: "text",
			url: "/diff?format=unified&rev1=%0/%1/%2&rev2=%0/%1".format(workspace, title, latestRevision),
			success: callback,
			error: function() {
				displayMessage(msgs.reviewDiffError);
			}
		});
		story.displayTiddler(src, diffTitle);
	},
	resetToServerVersion: function(tiddler) {
		var adaptor = tiddler.getAdaptor();
		var ctx = { 
			host: tiddler.fields["server.host"],
			workspace: "bags/" + tiddler.fields["server.bag"]
		};
		adaptor.getTiddler(tiddler.title, ctx, null, function(context) {
			store.saveTiddler(context.tiddler);
			story.refreshTiddler(tiddler.title);
			store.setDirty(false);
		});
	},
	reportError: function(title) {
		var el = story.getTiddler(title);
		if(!el) {
			el = story.displayTiddler(null, title);
		}
		return $("<div />").addClass("error annotation").prependTo(el)[0];
	}
};

sssp.reportFailure = function(message, tiddler, context) {
	config.options.chkViewDiffText = config.options.chkViewDiffText === undefined ?
		true : config.options.chkViewDiffText;
	config.options.chkViewDiffFields = config.options.chkViewDiffFields || false;
	plugin.displayMessage(message, tiddler, context);
};

})(jQuery);
//}}}
config.macros.OpenID={};
merge(config.macros.OpenID,{
	titleOpenID:"",
	buttonOpenIDText:"Login",
	buttonOpenIDToolTip:"Click to use OpenID Login" 
});

config.macros.OpenID.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
	var w = new Wizard();
	var me = config.macros.OpenID;
	w.createWizard(place,me.titleOpenID);
	w.addStep(null,"<!--<img width='150px' src='http://openid.net/wp-content/uploads/2007/10/openid_big_logo_text.png'/><br />--><input name='open_id_login' value='%0' size=40 style='background: rgb(255, 255, 255) url(http://www.openid.net/login-bg.gif) no-repeat scroll 0pt 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); padding-left: 18px;'/>".format([decodeURIComponent(cookieString(document.cookie).txtUserName)]));
	w.setButtons([
		{caption: me.buttonOpenIDText, tooltip: me.buttonOpenIDToolTip, onClick: function(){config.macros.OpenID.login(w);  } }
	]);
};

config.macros.OpenID.login = function (w) {
	var iframe = document.createElement("iframe");
	iframe.style.display = "none";
	iframe.src = url+"plugins/OpenID/files/openid/try_auth.php?action=verify&openid_identifier="+w.formElem.open_id_login.value;
	document.body.appendChild(iframe);
	iframe.onload = function() {
		// this is not working properly.
		if(iframe.src.indexOf("finish_auth.php")){
			window.location = iframe.src;	
		}
	};
	document.body.appendChild(iframe);
}

//}}}
The first assumption is that developer productivity declines with a constant rate $r$:

(1) $\Large \frac{dP(t)}{dt}$ = $\large -r \cdot P(t)$

Divide by $P(t)$:

(2) $\Large \frac{1}{P(t)}$ $\large \cdot$ $\Large \frac{dP(t)}{dt}$ = $\large -r$

(3) $\large \frac{dP(t)}{P(t)}$ = $\large -r dt$

(4) $\large \int \frac{dP(t)}{P(t)}$ = $-r \int t dt$

(5) $\large ln(P(t))= -rt +C $

Exponantiate both sides:

(6) $\large P(t) = e^{-rt}e^C $

(7) $\large P(t) = e^C \cdot e^{-rt} =e^C \cdot 1$

As P(0) = P_0 we get:

(8) $\large P(0) = e^C \cdot e^{-r \cdot 0} = e^C \cdot 1$

So $\large P(0) = e^C$ giving:
(9) $\large P(t) = P_0 \cdot e^{-rt}$

See: http://en.wikipedia.org/wiki/Exponential_decay#Solution_of_the_differential_equation
<html>
<!-- begin embedded QuickTime file... -->
      <!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="left">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320"
        height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="/static/files/Microscopy/2008.04.25-mse640-l20.mp4">
        <param name='autoplay' value="false">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src="/static/files/Microscopy/2008.04.25-mse640-l20.mp4" width="320" height="255" autoplay="false" 
        controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table>
</html>

Find the slides at: /static/files/Microscopy/2008.04.25-mse640-l20.pdf
Orignally copied material from: http://nanohub.org/resources/4092
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.1.4 (2009-09-04)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]|
|''Copyright:''|&copy; 2005-2009 [[abego Software|http://www.abego-software.de]]|
|''~CoreVersion:''|2.1.0|
|''Community:''|[[del.icio.us|http://del.icio.us/post?url=http://tiddlywiki.abego-software.de/index.html%23YourSearchPlugin]]|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; ~InternetExplorer 6.0|
!About YourSearch
YourSearch gives you a bunch of new features to simplify and speed up your daily searches in TiddlyWiki. It seamlessly integrates into the standard TiddlyWiki search: just start typing into the 'search' field and explore!

For more information see [[Help|YourSearch Help]].
!Compatibility
This plugin requires TiddlyWiki 2.1. 
Check the [[archive|http://tiddlywiki.abego-software.de/archive]] for ~YourSearchPlugins supporting older versions of TiddlyWiki.
!Source Code
***/
/***
This plugin's source code is compressed (and hidden). Use this [[link|http://tiddlywiki.abego-software.de/archive/YourSearchPlugin/Plugin-YourSearch-src.2.1.4.js]] to get the readable source code.
***/
///%
if(!version.extensions.YourSearchPlugin){version.extensions.YourSearchPlugin={major:2,minor:1,revision:4,source:"http://tiddlywiki.abego-software.de/#YourSearchPlugin",licence:"[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",copyright:"Copyright (c) abego Software GmbH, 2005-2009 (www.abego-software.de)"};if(!window.abego){window.abego={};}if(!Array.forEach){Array.forEach=function(_1,_2,_3){for(var i=0,_4=_1.length;i<_4;i++){_2.call(_3,_1[i],i,_1);}};Array.prototype.forEach=function(_5,_6){for(var i=0,_7=this.length;i<_7;i++){_5.call(_6,this[i],i,this);}};}abego.toInt=function(s,_8){if(!s){return _8;}var n=parseInt(s);return (n==NaN)?_8:n;};abego.createEllipsis=function(_9){var e=createTiddlyElement(_9,"span");e.innerHTML="&hellip;";};abego.shallowCopy=function(_a){if(!_a){return _a;}var _b={};for(var n in _a){_b[n]=_a[n];}return _b;};abego.copyOptions=function(_c){return !_c?{}:abego.shallowCopy(_c);};abego.countStrings=function(_d,s){if(!s){return 0;}var _e=s.length;var n=0;var _f=0;while(1){var i=_d.indexOf(s,_f);if(i<0){return n;}n++;_f=i+_e;}return n;};abego.getBracedText=function(_10,_11,_12){if(!_11){_11=0;}var re=/\{([^\}]*)\}/gm;re.lastIndex=_11;var m=re.exec(_10);if(m){var s=m[1];var _13=abego.countStrings(s,"{");if(!_13){if(_12){_12.lastIndex=re.lastIndex;}return s;}var len=_10.length;for(var i=re.lastIndex;i<len&&_13;i++){var c=_10.charAt(i);if(c=="{"){_13++;}else{if(c=="}"){_13--;}}}if(!_13){if(_12){_12.lastIndex=i-1;}return _10.substring(m.index+1,i-1);}}};abego.select=function(_14,_15,_16,_17){if(!_17){_17=[];}_14.forEach(function(t){if(_15.call(_16,t)){_17.push(t);}});return _17;};abego.consumeEvent=function(e){if(e.stopPropagation){e.stopPropagation();}if(e.preventDefault){e.preventDefault();}e.cancelBubble=true;e.returnValue=true;};abego.TiddlerFilterTerm=function(_18,_19){if(!_19){_19={};}var _1a=_18;if(!_19.textIsRegExp){_1a=_18.escapeRegExp();if(_19.fullWordMatch){_1a="\\b"+_1a+"\\b";}}var _1b=new RegExp(_1a,"m"+(_19.caseSensitive?"":"i"));this.tester=new abego.MultiFieldRegExpTester(_1b,_19.fields,_19.withExtendedFields);};abego.TiddlerFilterTerm.prototype.test=function(_1c){return this.tester.test(_1c);};abego.parseNewTiddlerCommandLine=function(s){var m=/(.*?)\.(?:\s+|$)([^#]*)(#.*)?/.exec(s);if(!m){m=/([^#]*)()(#.*)?/.exec(s);}if(m){var r;if(m[3]){var s2=m[3].replace(/#/g,"");r=s2.parseParams("tag");}else{r=[[]];}var _1d=m[2]?m[2].trim():"";r.push({name:"text",value:_1d});r[0].text=[_1d];return {title:m[1].trim(),params:r};}else{return {title:s.trim(),params:[[]]};}};abego.parseTiddlerFilterTerm=function(_1e,_1f,_20){var re=/\s*(?:(?:\{([^\}]*)\})|(?:(=)|([#%!])|(?:(\w+)\s*\:(?!\/\/))|(?:(?:("(?:(?:\\")|[^"])+")|(?:\/((?:(?:\\\/)|[^\/])+)\/)|(\w+\:\/\/[^\s]+)|([^\s\)\-\"]+)))))/mg;var _21={"!":"title","%":"text","#":"tags"};var _22={};var _23;re.lastIndex=_1f;while(1){var i=re.lastIndex;var m=re.exec(_1e);if(!m||m.index!=i){throw "Word or String literal expected";}if(m[1]){var _24={};var _25=abego.getBracedText(_1e,0,_24);if(!_25){throw "Invalid {...} syntax";}var f=Function("tiddler","return ("+_25+");");return {func:f,lastIndex:_24.lastIndex,markRE:null};}if(m[2]){_23=true;}else{if(m[3]){_22[_21[m[3]]]=1;}else{if(m[4]){_22[m[4]]=1;}else{var _26=m[6];var _27=m[5]?window.eval(m[5]):m[6]?m[6]:m[7]?m[7]:m[8];var _20=abego.copyOptions(_20);_20.fullWordMatch=_23;_20.textIsRegExp=_26;var _28=[];for(var n in _22){_28.push(n);}if(_28.length==0){_20.fields=_20.defaultFields;}else{_20.fields=_28;_20.withExtendedFields=false;}var _29=new abego.TiddlerFilterTerm(_27,_20);var _2a=_26?_27:_27.escapeRegExp();if(_2a&&_23){_2a="\\b"+_2a+"\\b";}return {func:function(_2b){return _29.test(_2b);},lastIndex:re.lastIndex,markRE:_2a?"(?:"+_2a+")":null};}}}}};abego.BoolExp=function(s,_2c,_2d){this.s=s;var _2e=_2d&&_2d.defaultOperationIs_OR;var _2f=/\s*(?:(\-|not)|(\())/gi;var _30=/\s*\)/g;var _31=/\s*(?:(and|\&\&)|(or|\|\|))/gi;var _32=/\s*[^\)\s]/g;var _33=/\s*(\-|not)?(\s*\()?/gi;var _34;var _35=function(_36){_33.lastIndex=_36;var m=_33.exec(s);var _37;var _38;if(m&&m.index==_36){_36+=m[0].length;_37=m[1];if(m[2]){var e=_34(_36);_30.lastIndex=e.lastIndex;if(!_30.exec(s)){throw "Missing ')'";}_38={func:e.func,lastIndex:_30.lastIndex,markRE:e.markRE};}}if(!_38){_38=_2c(s,_36,_2d);}if(_37){_38.func=(function(f){return function(_39){return !f(_39);};})(_38.func);_38.markRE=null;}return _38;};_34=function(_3a){var _3b=_35(_3a);while(1){var l=_3b.lastIndex;_31.lastIndex=l;var m=_31.exec(s);var _3c;var _3d;if(m&&m.index==l){_3c=!m[1];_3d=_35(_31.lastIndex);}else{try{_3d=_35(l);}catch(e){return _3b;}_3c=_2e;}_3b.func=(function(_3e,_3f,_40){return _40?function(_41){return _3e(_41)||_3f(_41);}:function(_42){return _3e(_42)&&_3f(_42);};})(_3b.func,_3d.func,_3c);_3b.lastIndex=_3d.lastIndex;if(!_3b.markRE){_3b.markRE=_3d.markRE;}else{if(_3d.markRE){_3b.markRE=_3b.markRE+"|"+_3d.markRE;}}}};var _43=_34(0);this.evalFunc=_43.func;if(_43.markRE){this.markRegExp=new RegExp(_43.markRE,_2d.caseSensitive?"mg":"img");}};abego.BoolExp.prototype.exec=function(){return this.evalFunc.apply(this,arguments);};abego.BoolExp.prototype.getMarkRegExp=function(){return this.markRegExp;};abego.BoolExp.prototype.toString=function(){return this.s;};abego.MultiFieldRegExpTester=function(re,_44,_45){this.re=re;this.fields=_44?_44:["title","text","tags"];this.withExtendedFields=_45;};abego.MultiFieldRegExpTester.prototype.test=function(_46){var re=this.re;for(var i=0;i<this.fields.length;i++){var s=store.getValue(_46,this.fields[i]);if(typeof s=="string"&&re.test(s)){return this.fields[i];}}if(this.withExtendedFields){return store.forEachField(_46,function(_47,_48,_49){return typeof _49=="string"&&re.test(_49)?_48:null;},true);}return null;};abego.TiddlerQuery=function(_4a,_4b,_4c,_4d,_4e){if(_4c){this.regExp=new RegExp(_4a,_4b?"mg":"img");this.tester=new abego.MultiFieldRegExpTester(this.regExp,_4d,_4e);}else{this.expr=new abego.BoolExp(_4a,abego.parseTiddlerFilterTerm,{defaultFields:_4d,caseSensitive:_4b,withExtendedFields:_4e});}this.getQueryText=function(){return _4a;};this.getUseRegExp=function(){return _4c;};this.getCaseSensitive=function(){return _4b;};this.getDefaultFields=function(){return _4d;};this.getWithExtendedFields=function(){return _4e;};};abego.TiddlerQuery.prototype.test=function(_4f){if(!_4f){return false;}if(this.regExp){return this.tester.test(_4f);}return this.expr.exec(_4f);};abego.TiddlerQuery.prototype.filter=function(_50){return abego.select(_50,this.test,this);};abego.TiddlerQuery.prototype.getMarkRegExp=function(){if(this.regExp){return "".search(this.regExp)>=0?null:this.regExp;}return this.expr.getMarkRegExp();};abego.TiddlerQuery.prototype.toString=function(){return (this.regExp?this.regExp:this.expr).toString();};abego.PageWiseRenderer=function(){this.firstIndexOnPage=0;};merge(abego.PageWiseRenderer.prototype,{setItems:function(_51){this.items=_51;this.setFirstIndexOnPage(0);},getMaxPagesInNavigation:function(){return 10;},getItemsCount:function(_52){return this.items?this.items.length:0;},getCurrentPageIndex:function(){return Math.floor(this.firstIndexOnPage/this.getItemsPerPage());},getLastPageIndex:function(){return Math.floor((this.getItemsCount()-1)/this.getItemsPerPage());},setFirstIndexOnPage:function(_53){this.firstIndexOnPage=Math.min(Math.max(0,_53),this.getItemsCount()-1);},getFirstIndexOnPage:function(){this.firstIndexOnPage=Math.floor(this.firstIndexOnPage/this.getItemsPerPage())*this.getItemsPerPage();return this.firstIndexOnPage;},getLastIndexOnPage:function(){return Math.min(this.getFirstIndexOnPage()+this.getItemsPerPage()-1,this.getItemsCount()-1);},onPageChanged:function(_54,_55){},renderPage:function(_56){if(_56.beginRendering){_56.beginRendering(this);}try{if(this.getItemsCount()){var _57=this.getLastIndexOnPage();var _58=-1;for(var i=this.getFirstIndexOnPage();i<=_57;i++){_58++;_56.render(this,this.items[i],i,_58);}}}finally{if(_56.endRendering){_56.endRendering(this);}}},addPageNavigation:function(_59){if(!this.getItemsCount()){return;}var _5a=this;var _5b=function(e){if(!e){var e=window.event;}abego.consumeEvent(e);var _5c=abego.toInt(this.getAttribute("page"),0);var _5d=_5a.getCurrentPageIndex();if(_5c==_5d){return;}var _5e=_5c*_5a.getItemsPerPage();_5a.setFirstIndexOnPage(_5e);_5a.onPageChanged(_5c,_5d);};var _5f;var _60=this.getCurrentPageIndex();var _61=this.getLastPageIndex();if(_60>0){_5f=createTiddlyButton(_59,"Previous","Go to previous page (Shortcut: Alt-'<')",_5b,"prev");_5f.setAttribute("page",(_60-1).toString());_5f.setAttribute("accessKey","<");}for(var i=-this.getMaxPagesInNavigation();i<this.getMaxPagesInNavigation();i++){var _62=_60+i;if(_62<0){continue;}if(_62>_61){break;}var _63=(i+_60+1).toString();var _64=_62==_60?"currentPage":"otherPage";_5f=createTiddlyButton(_59,_63,"Go to page %0".format([_63]),_5b,_64);_5f.setAttribute("page",(_62).toString());}if(_60<_61){_5f=createTiddlyButton(_59,"Next","Go to next page (Shortcut: Alt-'>')",_5b,"next");_5f.setAttribute("page",(_60+1).toString());_5f.setAttribute("accessKey",">");}}});abego.LimitedTextRenderer=function(){var _65=40;var _66=4;var _67=function(_68,_69,_6a){var n=_68.length;if(n==0){_68.push({start:_69,end:_6a});return;}var i=0;for(;i<n;i++){var _6b=_68[i];if(_6b.start<=_6a&&_69<=_6b.end){var r;var _6c=i+1;for(;_6c<n;_6c++){r=_68[_6c];if(r.start>_6a||_69>_6b.end){break;}}var _6d=_69;var _6e=_6a;for(var j=i;j<_6c;j++){r=_68[j];_6d=Math.min(_6d,r.start);_6e=Math.max(_6e,r.end);}_68.splice(i,_6c-i,{start:_6d,end:_6e});return;}if(_6b.start>_6a){break;}}_68.splice(i,0,{start:_69,end:_6a});};var _6f=function(_70){var _71=0;for(var i=0;i<_70.length;i++){var _72=_70[i];_71+=_72.end-_72.start;}return _71;};var _73=function(c){return (c>="a"&&c<="z")||(c>="A"&&c<="Z")||c=="_";};var _74=function(s,_75){if(!_73(s[_75])){return null;}for(var i=_75-1;i>=0&&_73(s[i]);i--){}var _76=i+1;var n=s.length;for(i=_75+1;i<n&&_73(s[i]);i++){}return {start:_76,end:i};};var _77=function(s,_78,_79){var _7a;if(_79){_7a=_74(s,_78);}else{if(_78<=0){return _78;}_7a=_74(s,_78-1);}if(!_7a){return _78;}if(_79){if(_7a.start>=_78-_66){return _7a.start;}if(_7a.end<=_78+_66){return _7a.end;}}else{if(_7a.end<=_78+_66){return _7a.end;}if(_7a.start>=_78-_66){return _7a.start;}}return _78;};var _7b=function(s,_7c){var _7d=[];if(_7c){var _7e=0;var n=s.length;var _7f=0;do{_7c.lastIndex=_7e;var _80=_7c.exec(s);if(_80){if(_7e<_80.index){var t=s.substring(_7e,_80.index);_7d.push({text:t});}_7d.push({text:_80[0],isMatch:true});_7e=_80.index+_80[0].length;}else{_7d.push({text:s.substr(_7e)});break;}}while(true);}else{_7d.push({text:s});}return _7d;};var _81=function(_82){var _83=0;for(var i=0;i<_82.length;i++){if(_82[i].isMatch){_83++;}}return _83;};var _84=function(s,_85,_86,_87,_88){var _89=Math.max(Math.floor(_88/(_87+1)),_65);var _8a=Math.max(_89-(_86-_85),0);var _8b=Math.min(Math.floor(_86+_8a/3),s.length);var _8c=Math.max(_8b-_89,0);_8c=_77(s,_8c,true);_8b=_77(s,_8b,false);return {start:_8c,end:_8b};};var _8d=function(_8e,s,_8f){var _90=[];var _91=_81(_8e);var pos=0;for(var i=0;i<_8e.length;i++){var t=_8e[i];var _92=t.text;if(t.isMatch){var _93=_84(s,pos,pos+_92.length,_91,_8f);_67(_90,_93.start,_93.end);}pos+=_92.length;}return _90;};var _94=function(s,_95,_96){var _97=_96-_6f(_95);while(_97>0){if(_95.length==0){_67(_95,0,_77(s,_96,false));return;}else{var _98=_95[0];var _99;var _9a;if(_98.start==0){_99=_98.end;if(_95.length>1){_9a=_95[1].start;}else{_67(_95,_99,_77(s,_99+_97,false));return;}}else{_99=0;_9a=_98.start;}var _9b=Math.min(_9a,_99+_97);_67(_95,_99,_9b);_97-=(_9b-_99);}}};var _9c=function(_9d,s,_9e,_9f,_a0){if(_9f.length==0){return;}var _a1=function(_a2,s,_a3,_a4,_a5){var t;var _a6;var pos=0;var i=0;var _a7=0;for(;i<_a3.length;i++){t=_a3[i];_a6=t.text;if(_a4<pos+_a6.length){_a7=_a4-pos;break;}pos+=_a6.length;}var _a8=_a5-_a4;for(;i<_a3.length&&_a8>0;i++){t=_a3[i];_a6=t.text.substr(_a7);_a7=0;if(_a6.length>_a8){_a6=_a6.substr(0,_a8);}if(t.isMatch){createTiddlyElement(_a2,"span",null,"marked",_a6);}else{createTiddlyText(_a2,_a6);}_a8-=_a6.length;}if(_a5<s.length){abego.createEllipsis(_a2);}};if(_9f[0].start>0){abego.createEllipsis(_9d);}var _a9=_a0;for(var i=0;i<_9f.length&&_a9>0;i++){var _aa=_9f[i];var len=Math.min(_aa.end-_aa.start,_a9);_a1(_9d,s,_9e,_aa.start,_aa.start+len);_a9-=len;}};this.render=function(_ab,s,_ac,_ad){if(s.length<_ac){_ac=s.length;}var _ae=_7b(s,_ad);var _af=_8d(_ae,s,_ac);_94(s,_af,_ac);_9c(_ab,s,_ae,_af,_ac);};};(function(){function _b0(msg){alert(msg);throw msg;};if(version.major<2||(version.major==2&&version.minor<1)){_b0("YourSearchPlugin requires TiddlyWiki 2.1 or newer.\n\nCheck the archive for YourSearch plugins\nsupporting older versions of TiddlyWiki.\n\nArchive: http://tiddlywiki.abego-software.de/archive");}abego.YourSearch={};var _b1;var _b2;var _b3=function(_b4){_b1=_b4;};var _b5=function(){return _b1?_b1:[];};var _b6=function(){return _b1?_b1.length:0;};var _b7=4;var _b8=10;var _b9=2;var _ba=function(s,re){var m=s.match(re);return m?m.length:0;};var _bb=function(_bc,_bd){var _be=_bd.getMarkRegExp();if(!_be){return 1;}var _bf=_bc.title.match(_be);var _c0=_bf?_bf.length:0;var _c1=_ba(_bc.getTags(),_be);var _c2=_bf?_bf.join("").length:0;var _c3=_bc.title.length>0?_c2/_bc.title.length:0;var _c4=_c0*_b7+_c1*_b9+_c3*_b8+1;return _c4;};var _c5=function(_c6,_c7,_c8,_c9,_ca,_cb){_b2=null;var _cc=_c6.reverseLookup("tags",_cb,false);try{var _cd=[];if(config.options.chkSearchInTitle){_cd.push("title");}if(config.options.chkSearchInText){_cd.push("text");}if(config.options.chkSearchInTags){_cd.push("tags");}_b2=new abego.TiddlerQuery(_c7,_c8,_c9,_cd,config.options.chkSearchExtendedFields);}catch(e){return [];}var _ce=_b2.filter(_cc);var _cf=abego.YourSearch.getRankFunction();for(var i=0;i<_ce.length;i++){var _d0=_ce[i];var _d1=_cf(_d0,_b2);_d0.searchRank=_d1;}if(!_ca){_ca="title";}var _d2=function(a,b){var _d3=a.searchRank-b.searchRank;if(_d3==0){if(a[_ca]==b[_ca]){return (0);}else{return (a[_ca]<b[_ca])?-1:+1;}}else{return (_d3>0)?-1:+1;}};_ce.sort(_d2);return _ce;};var _d4=80;var _d5=50;var _d6=250;var _d7=50;var _d8=25;var _d9=10;var _da="yourSearchResult";var _db="yourSearchResultItems";var _dc;var _dd;var _de;var _df;var _e0;var _e1=function(){if(version.extensions.YourSearchPlugin.styleSheetInited){return;}version.extensions.YourSearchPlugin.styleSheetInited=true;setStylesheet(store.getTiddlerText("YourSearchStyleSheet"),"yourSearch");};var _e2=function(){return _dd!=null&&_dd.parentNode==document.body;};var _e3=function(){if(_e2()){document.body.removeChild(_dd);}};var _e4=function(e){_e3();var _e5=this.getAttribute("tiddlyLink");if(_e5){var _e6=this.getAttribute("withHilite");var _e7=highlightHack;if(_e6&&_e6=="true"&&_b2){highlightHack=_b2.getMarkRegExp();}story.displayTiddler(this,_e5);highlightHack=_e7;}return (false);};var _e8=function(){if(!_de){return;}var _e9=_de;var _ea=findPosX(_e9);var _eb=findPosY(_e9);var _ec=_e9.offsetHeight;var _ed=_ea;var _ee=_eb+_ec;var _ef=findWindowWidth();if(_ef<_dd.offsetWidth){_dd.style.width=(_ef-100)+"px";_ef=findWindowWidth();}var _f0=_dd.offsetWidth;if(_ed+_f0>_ef){_ed=_ef-_f0-30;}if(_ed<0){_ed=0;}_dd.style.left=_ed+"px";_dd.style.top=_ee+"px";_dd.style.display="block";};var _f1=function(){if(_dd){window.scrollTo(0,ensureVisible(_dd));}if(_de){window.scrollTo(0,ensureVisible(_de));}};var _f2=function(){_e8();_f1();};var _f3;var _f4;var _f5=new abego.PageWiseRenderer();var _f6=function(_f7){this.itemHtml=store.getTiddlerText("YourSearchItemTemplate");if(!this.itemHtml){_b0("YourSearchItemTemplate not found");}this.place=document.getElementById(_db);if(!this.place){this.place=createTiddlyElement(_f7,"div",_db);}};merge(_f6.prototype,{render:function(_f8,_f9,_fa,_fb){_f3=_fb;_f4=_f9;var _fc=createTiddlyElement(this.place,"div",null,"yourSearchItem");_fc.innerHTML=this.itemHtml;applyHtmlMacros(_fc,null);refreshElements(_fc,null);},endRendering:function(_fd){_f4=null;}});var _fe=function(){if(!_dd||!_de){return;}var _ff=store.getTiddlerText("YourSearchResultTemplate");if(!_ff){_ff="<b>Tiddler YourSearchResultTemplate not found</b>";}_dd.innerHTML=_ff;applyHtmlMacros(_dd,null);refreshElements(_dd,null);var _100=new _f6(_dd);_f5.renderPage(_100);_f2();};_f5.getItemsPerPage=function(){var n=(config.options.chkPreviewText)?abego.toInt(config.options.txtItemsPerPageWithPreview,_d9):abego.toInt(config.options.txtItemsPerPage,_d8);return (n>0)?n:1;};_f5.onPageChanged=function(){_fe();};var _101=function(){if(_de==null||!config.options.chkUseYourSearch){return;}if((_de.value==_dc)&&_dc&&!_e2()){if(_dd&&(_dd.parentNode!=document.body)){document.body.appendChild(_dd);_f2();}else{abego.YourSearch.onShowResult(true);}}};var _102=function(){_e3();_dd=null;_dc=null;};var _103=function(self,e){while(e!=null){if(self==e){return true;}e=e.parentNode;}return false;};var _104=function(e){if(e.target==_de){return;}if(e.target==_df){return;}if(_dd&&_103(_dd,e.target)){return;}_e3();};var _105=function(e){if(e.keyCode==27){_e3();}};addEvent(document,"click",_104);addEvent(document,"keyup",_105);var _106=function(text,_107,_108){_dc=text;_b3(_c5(store,text,_107,_108,"title","excludeSearch"));abego.YourSearch.onShowResult();};var _109=function(_10a,_10b,_10c,_10d,_10e,_10f){_e1();_dc="";var _110=null;var _111=function(txt){if(config.options.chkUseYourSearch){_106(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}else{story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}_dc=txt.value;};var _112=function(e){_111(_de);return false;};var _113=function(e){if(!e){var e=window.event;}_de=this;switch(e.keyCode){case 13:if(e.ctrlKey&&_e0&&_e2()){_e0.onclick.apply(_e0,[e]);}else{_111(this);}break;case 27:if(_e2()){_e3();}else{this.value="";clearMessage();}break;}if(String.fromCharCode(e.keyCode)==this.accessKey||e.altKey){_101();}if(this.value.length<3&&_110){clearTimeout(_110);}if(this.value.length>2){if(this.value!=_dc){if(!config.options.chkUseYourSearch||config.options.chkSearchAsYouType){if(_110){clearTimeout(_110);}var txt=this;_110=setTimeout(function(){_111(txt);},500);}}else{if(_110){clearTimeout(_110);}}}if(this.value.length==0){_e3();}};var _114=function(e){this.select();clearMessage();_101();};var args=_10e.parseParams("list",null,true);var _115=getFlag(args,"buttonAtRight");var _116=getParam(args,"sizeTextbox",this.sizeTextbox);var btn;if(!_115){btn=createTiddlyButton(_10a,this.label,this.prompt,_112);}var txt=createTiddlyElement(null,"input",null,null,null);if(_10c[0]){txt.value=_10c[0];}txt.onkeyup=_113;txt.onfocus=_114;txt.setAttribute("size",_116);txt.setAttribute("accessKey",this.accessKey);txt.setAttribute("autocomplete","off");if(config.browser.isSafari){txt.setAttribute("type","search");txt.setAttribute("results","5");}else{txt.setAttribute("type","text");}if(_10a){_10a.appendChild(txt);}if(_115){btn=createTiddlyButton(_10a,this.label,this.prompt,_112);}_de=txt;_df=btn;};var _117=function(){_e3();var _118=_b5();var n=_118.length;if(n){var _119=[];for(var i=0;i<n;i++){_119.push(_118[i].title);}story.displayTiddlers(null,_119);}};var _11a=function(_11b,_11c,_11d,_11e){invokeMacro(_11b,"option",_11c,_11d,_11e);var elem=_11b.lastChild;var _11f=elem.onclick;elem.onclick=function(e){var _120=_11f.apply(this,arguments);_fe();return _120;};return elem;};var _121=function(s){var _122=["''","{{{","}}}","//","<<<","/***","***/"];var _123="";for(var i=0;i<_122.length;i++){if(i!=0){_123+="|";}_123+="("+_122[i].escapeRegExp()+")";}return s.replace(new RegExp(_123,"mg"),"").trim();};var _124=function(){var i=_f3;return (i>=0&&i<=9)?(i<9?(i+1):0):-1;};var _125=new abego.LimitedTextRenderer();var _126=function(_127,s,_128){_125.render(_127,s,_128,_b2.getMarkRegExp());};var _129=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_12a,_12b,_12c,_12d,_12e,tags,_12f){_129.apply(this,arguments);_102();};var _130=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_131){_130.apply(this,arguments);_102();};config.macros.yourSearch={label:"yourSearch",prompt:"Gives access to the current/last YourSearch result",handler:function(_132,_133,_134,_135,_136,_137){if(_134.length==0){return;}var name=_134[0];var func=config.macros.yourSearch.funcs[name];if(func){func(_132,_133,_134,_135,_136,_137);}},tests:{"true":function(){return true;},"false":function(){return false;},"found":function(){return _b6()>0;},"previewText":function(){return config.options.chkPreviewText;}},funcs:{itemRange:function(_138){if(_b6()){var _139=_f5.getLastIndexOnPage();var s="%0 - %1".format([_f5.getFirstIndexOnPage()+1,_139+1]);createTiddlyText(_138,s);}},count:function(_13a){createTiddlyText(_13a,_b6().toString());},query:function(_13b){if(_b2){createTiddlyText(_13b,_b2.toString());}},version:function(_13c){var t="YourSearch %0.%1.%2".format([version.extensions.YourSearchPlugin.major,version.extensions.YourSearchPlugin.minor,version.extensions.YourSearchPlugin.revision]);var e=createTiddlyElement(_13c,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#YourSearchPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_13d){var e=createTiddlyElement(_13d,"a");e.setAttribute("href","http://www.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">&copy; 2005-2008 <b><font color=\"red\">abego</font></b> Software<font>";},newTiddlerButton:function(_13e){if(_b2){var r=abego.parseNewTiddlerCommandLine(_b2.getQueryText());var btn=config.macros.newTiddler.createNewTiddlerButton(_13e,r.title,r.params,"new tiddler","Create a new tiddler based on search text. (Shortcut: Ctrl-Enter; Separators: '.', '#')",null,"text");var _13f=btn.onclick;btn.onclick=function(){_e3();_13f.apply(this,arguments);};_e0=btn;}},linkButton:function(_140,_141,_142,_143,_144,_145){if(_142<2){return;}var _146=_142[1];var text=_142<3?_146:_142[2];var _147=_142<4?text:_142[3];var _148=_142<5?null:_142[4];var btn=createTiddlyButton(_140,text,_147,_e4,null,null,_148);btn.setAttribute("tiddlyLink",_146);},closeButton:function(_149,_14a,_14b,_14c,_14d,_14e){var _14f=createTiddlyButton(_149,"close","Close the Search Results (Shortcut: ESC)",_e3);},openAllButton:function(_150,_151,_152,_153,_154,_155){var n=_b6();if(n==0){return;}var _156=n==1?"open tiddler":"open all %0 tiddlers".format([n]);var _157=createTiddlyButton(_150,_156,"Open all found tiddlers (Shortcut: Alt-O)",_117);_157.setAttribute("accessKey","O");},naviBar:function(_158,_159,_15a,_15b,_15c,_15d){_f5.addPageNavigation(_158);},"if":function(_15e,_15f,_160,_161,_162,_163){if(_160.length<2){return;}var _164=_160[1];var _165=(_164=="not");if(_165){if(_160.length<3){return;}_164=_160[2];}var test=config.macros.yourSearch.tests[_164];var _166=false;try{if(test){_166=test(_15e,_15f,_160,_161,_162,_163)!=_165;}else{_166=(!eval(_164))==_165;}}catch(ex){}if(!_166){_15e.style.display="none";}},chkPreviewText:function(_167,_168,_169,_16a,_16b,_16c){var _16d=_169.slice(1).join(" ");var elem=_11a(_167,"chkPreviewText",_16a,_16c);elem.setAttribute("accessKey","P");elem.title="Show text preview of found tiddlers (Shortcut: Alt-P)";return elem;}}};config.macros.foundTiddler={label:"foundTiddler",prompt:"Provides information on the tiddler currently processed on the YourSearch result page",handler:function(_16e,_16f,_170,_171,_172,_173){var name=_170[0];var func=config.macros.foundTiddler.funcs[name];if(func){func(_16e,_16f,_170,_171,_172,_173);}},funcs:{title:function(_174,_175,_176,_177,_178,_179){if(!_f4){return;}var _17a=_124();var _17b=_17a>=0?"Open tiddler (Shortcut: Alt-%0)".format([_17a.toString()]):"Open tiddler";var btn=createTiddlyButton(_174,null,_17b,_e4,null);btn.setAttribute("tiddlyLink",_f4.title);btn.setAttribute("withHilite","true");_126(btn,_f4.title,_d4);if(_17a>=0){btn.setAttribute("accessKey",_17a.toString());}},tags:function(_17c,_17d,_17e,_17f,_180,_181){if(!_f4){return;}_126(_17c,_f4.getTags(),_d5);},text:function(_182,_183,_184,_185,_186,_187){if(!_f4){return;}_126(_182,_121(_f4.text),_d6);},field:function(_188,_189,_18a,_18b,_18c,_18d){if(!_f4){return;}var name=_18a[1];var len=_18a.length>2?abego.toInt(_18a[2],_d7):_d7;var v=store.getValue(_f4,name);if(v){_126(_188,_121(v),len);}},number:function(_18e,_18f,_190,_191,_192,_193){var _194=_124();if(_194>=0){var text="%0)".format([_194.toString()]);createTiddlyElement(_18e,"span",null,"shortcutNumber",text);}}}};var opts={chkUseYourSearch:true,chkPreviewText:true,chkSearchAsYouType:true,chkSearchInTitle:true,chkSearchInText:true,chkSearchInTags:true,chkSearchExtendedFields:true,txtItemsPerPage:_d8,txtItemsPerPageWithPreview:_d9};for(var n in opts){if(config.options[n]==undefined){config.options[n]=opts[n];}}config.shadowTiddlers.AdvancedOptions+="\n<<option chkUseYourSearch>> Use 'Your Search' //([[more options|YourSearch Options]]) ([[help|YourSearch Help]])// ";config.shadowTiddlers["YourSearch Help"]="!Field Search\nWith the Field Search you can restrict your search to certain fields of a tiddler, e.g"+" only search the tags or only the titles. The general form is //fieldname//'':''//textToSearch// (e."+"g. {{{title:intro}}}). In addition one-character shortcuts are also supported for the standard field"+"s {{{title}}}, {{{text}}} and {{{tags}}}:\n|!What you want|!What you type|!Example|\n|Search ''titles "+"only''|start word with ''!''|{{{!jonny}}} (shortcut for {{{title:jonny}}})|\n|Search ''contents/text "+"only''|start word with ''%''|{{{%football}}} (shortcut for {{{text:football}}})|\n|Search ''tags only"+"''|start word with ''#''|{{{#Plugin}}} (shortcut for {{{tags:Plugin}}})|\n\nUsing this feature you may"+" also search the extended fields (\"Metadata\") introduced with TiddlyWiki 2.1, e.g. use {{{priority:1"+"}}} to find all tiddlers with the priority field set to \"1\".\n\nYou may search a word in more than one"+" field. E.g. {{{!#Plugin}}} (or {{{title:tags:Plugin}}} in the \"long form\") finds tiddlers containin"+"g \"Plugin\" either in the title or in the tags (but does not look for \"Plugin\" in the text). \n\n!Boole"+"an Search\nThe Boolean Search is useful when searching for multiple words.\n|!What you want|!What you "+"type|!Example|\n|''All words'' must exist|List of words|{{{jonny jeremy}}} (or {{{jonny and jeremy}}}"+")|\n|''At least one word'' must exist|Separate words by ''or''|{{{jonny or jeremy}}}|\n|A word ''must "+"not exist''|Start word with ''-''|{{{-jonny}}} (or {{{not jonny}}})|\n\n''Note:'' When you specify two"+" words, separated with a space, YourSearch finds all tiddlers that contain both words, but not neces"+"sarily next to each other. If you want to find a sequence of word, e.g. '{{{John Brown}}}', you need"+" to put the words into quotes. I.e. you type: {{{\"john brown\"}}}.\n\nUsing parenthesis you may change "+"the default \"left to right\" evaluation of the boolean search. E.g. {{{not (jonny or jeremy)}}} finds"+" all tiddlers that contain neither \"jonny\" nor \"jeremy. In contrast to this {{{not jonny or jeremy}}"+"} (i.e. without parenthesis) finds all tiddlers that either don't contain \"jonny\" or that contain \"j"+"eremy\".\n\n!'Exact Word' Search\nBy default a search result all matches that 'contain' the searched tex"+"t. E.g. if you search for {{{Task}}} you will get all tiddlers containing 'Task', but also '~Complet"+"edTask', '~TaskForce' etc.\n\nIf you only want to get the tiddlers that contain 'exactly the word' you"+" need to prefix it with a '='. E.g. typing '=Task' will find the tiddlers that contain the word 'Tas"+"k', ignoring words that just contain 'Task' as a substring.\n\n!~CaseSensitiveSearch and ~RegExpSearch"+"\nThe standard search options ~CaseSensitiveSearch and ~RegExpSearch are fully supported by YourSearc"+"h. However when ''~RegExpSearch'' is on Filtered and Boolean Search are disabled.\n\nIn addition you m"+"ay do a \"regular expression\" search even with the ''~RegExpSearch'' set to false by directly enterin"+"g the regular expression into the search field, framed with {{{/.../}}}. \n\nExample: {{{/m[ae][iy]er/"+"}}} will find all tiddlers that contain either \"maier\", \"mayer\", \"meier\" or \"meyer\".\n\n!~JavaScript E"+"xpression Filtering\nIf you are familiar with JavaScript programming and know some TiddlyWiki interna"+"ls you may also use JavaScript expression for the search. Just enter a JavaScript boolean expression"+" into the search field, framed with {{{ { ... } }}}. In the code refer to the variable tiddler and e"+"valuate to {{{true}}} when the given tiddler should be included in the result. \n\nExample: {{{ { tidd"+"ler.modified > new Date(\"Jul 4, 2005\")} }}} returns all tiddler modified after July 4th, 2005.\n\n!Com"+"bined Search\nYou are free to combine the various search options. \n\n''Examples''\n|!What you type|!Res"+"ult|\n|{{{!jonny !jeremy -%football}}}|all tiddlers with both {{{jonny}}} and {{{jeremy}}} in its tit"+"les, but no {{{football}}} in content.|\n|{{{#=Task}}}|All tiddlers tagged with 'Task' (the exact wor"+"d). Tags named '~CompletedTask', '~TaskForce' etc. are not considered.|\n\n!Access Keys\nYou are encour"+"aged to use the access keys (also called \"shortcut\" keys) for the most frequently used operations. F"+"or quick reference these shortcuts are also mentioned in the tooltip for the various buttons etc.\n\n|"+"!Key|!Operation|\n|{{{Alt-F}}}|''The most important keystroke'': It moves the cursor to the search in"+"put field so you can directly start typing your query. Pressing {{{Alt-F}}} will also display the pr"+"evious search result. This way you can quickly display multiple tiddlers using \"Press {{{Alt-F}}}. S"+"elect tiddler.\" sequences.|\n|{{{ESC}}}|Closes the [[YourSearch Result]]. When the [[YourSearch Resul"+"t]] is already closed and the cursor is in the search input field the field's content is cleared so "+"you start a new query.|\n|{{{Alt-1}}}, {{{Alt-2}}},... |Pressing these keys opens the first, second e"+"tc. tiddler from the result list.|\n|{{{Alt-O}}}|Opens all found tiddlers.|\n|{{{Alt-P}}}|Toggles the "+"'Preview Text' mode.|\n|{{{Alt-'<'}}}, {{{Alt-'>'}}}|Displays the previous or next page in the [[Your"+"Search Result]].|\n|{{{Return}}}|When you have turned off the 'as you type' search mode pressing the "+"{{{Return}}} key actually starts the search (as does pressing the 'search' button).|\n\n//If some of t"+"hese shortcuts don't work for you check your browser if you have other extensions installed that alr"+"eady \"use\" these shortcuts.//";config.shadowTiddlers["YourSearch Options"]="|>|!YourSearch Options|\n|>|<<option chkUseYourSearch>> Use 'Your Search'|\n|!|<<option chkPreviewText"+">> Show Text Preview|\n|!|<<option chkSearchAsYouType>> 'Search As You Type' Mode (No RETURN required"+" to start search)|\n|!|Default Search Filter:<<option chkSearchInTitle>>Title ('!')     <<option chk"+"SearchInText>>Text ('%')     <<option chkSearchInTags>>Tags ('#')    <<option chkSearchExtendedFiel"+"ds>>Extended Fields<html><br><font size=\"-2\">The fields of a tiddlers that are searched when you don"+"'t explicitly specify a filter in the search text <br>(Explictly specify fields using one or more '!"+"', '%', '#' or 'fieldname:' prefix before the word/text to find).</font></html>|\n|!|Number of items "+"on search result page: <<option txtItemsPerPage>>|\n|!|Number of items on search result page with pre"+"view text: <<option txtItemsPerPageWithPreview>>|\n";config.shadowTiddlers["YourSearchStyleSheet"]="/***\n!~YourSearchResult Stylesheet\n***/\n/*{{{*/\n.yourSearchResult {\n\tposition: absolute;\n\twidth: 800"+"px;\n\n\tpadding: 0.2em;\n\tlist-style: none;\n\tmargin: 0;\n\n\tbackground: #ffd;\n\tborder: 1px solid DarkGra"+"y;\n}\n\n/*}}}*/\n/***\n!!Summary Section\n***/\n/*{{{*/\n.yourSearchResult .summary {\n\tborder-bottom-width:"+" thin;\n\tborder-bottom-style: solid;\n\tborder-bottom-color: #999999;\n\tpadding-bottom: 4px;\n}\n\n.yourSea"+"rchRange, .yourSearchCount, .yourSearchQuery   {\n\tfont-weight: bold;\n}\n\n.yourSearchResult .summary ."+"button {\n\tfont-size: 10px;\n\n\tpadding-left: 0.3em;\n\tpadding-right: 0.3em;\n}\n\n.yourSearchResult .summa"+"ry .chkBoxLabel {\n\tfont-size: 10px;\n\n\tpadding-right: 0.3em;\n}\n\n/*}}}*/\n/***\n!!Items Area\n***/\n/*{{{*"+"/\n.yourSearchResult .marked {\n\tbackground: none;\n\tfont-weight: bold;\n}\n\n.yourSearchItem {\n\tmargin-to"+"p: 2px;\n}\n\n.yourSearchNumber {\n\tcolor: #808080;\n}\n\n\n.yourSearchTags {\n\tcolor: #008000;\n}\n\n.yourSearc"+"hText {\n\tcolor: #808080;\n\tmargin-bottom: 6px;\n}\n\n/*}}}*/\n/***\n!!Footer\n***/\n/*{{{*/\n.yourSearchFoote"+"r {\n\tmargin-top: 8px;\n\tborder-top-width: thin;\n\tborder-top-style: solid;\n\tborder-top-color: #999999;"+"\n}\n\n.yourSearchFooter a:hover{\n\tbackground: none;\n\tcolor: none;\n}\n/*}}}*/\n/***\n!!Navigation Bar\n***/"+"\n/*{{{*/\n.yourSearchNaviBar a {\n\tfont-size: 16px;\n\tmargin-left: 4px;\n\tmargin-right: 4px;\n\tcolor: bla"+"ck;\n\ttext-decoration: underline;\n}\n\n.yourSearchNaviBar a:hover {\n\tbackground-color: none;\n}\n\n.yourSe"+"archNaviBar .prev {\n\tfont-weight: bold;\n\tcolor: blue;\n}\n\n.yourSearchNaviBar .currentPage {\n\tcolor: #"+"FF0000;\n\tfont-weight: bold;\n\ttext-decoration: none;\n}\n\n.yourSearchNaviBar .next {\n\tfont-weight: bold"+";\n\tcolor: blue;\n}\n/*}}}*/\n";config.shadowTiddlers["YourSearchResultTemplate"]="<!--\n{{{\n-->\n<span macro=\"yourSearch if found\">\n<!-- The Summary Header ============================"+"================ -->\n<table class=\"summary\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"+"<tbody>\n  <tr>\n\t<td align=\"left\">\n\t\tYourSearch Result <span class=\"yourSearchRange\" macro=\"yourSearc"+"h itemRange\"></span>\n\t\t&nbsp;of&nbsp;<span class=\"yourSearchCount\" macro=\"yourSearch count\"></span>\n"+"\t\tfor&nbsp;<span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>\n\t</td>\n\t<td class=\"yourSea"+"rchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch chkPreviewText\"></span><span class=\"chkBoxLabel"+"\">preview text</span>\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch openAllButton\"></span>\n\t\t<span macro=\"yourSearch lin"+"kButton 'YourSearch Options' options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkB"+"utton 'YourSearch Help' help 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch clo"+"seButton\"></span>\n\t</td>\n  </tr>\n</tbody></table>\n\n<!-- The List of Found Tiddlers ================="+"=========================== -->\n<div id=\"yourSearchResultItems\" itemsPerPage=\"25\" itemsPerPageWithPr"+"eview=\"10\"></div>\n\n<!-- The Footer (with the Navigation) ==========================================="+"= -->\n<table class=\"yourSearchFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody"+">\n  <tr>\n\t<td align=\"left\">\n\t\tResult page: <span class=\"yourSearchNaviBar\" macro=\"yourSearch naviBar"+"\"></span>\n\t</td>\n\t<td align=\"right\"><span macro=\"yourSearch version\"></span>, <span macro=\"yourSearc"+"h copyright\"></span>\n\t</td>\n  </tr>\n</tbody></table>\n<!-- end of the 'tiddlers found' case ========="+"================================== -->\n</span>\n\n\n<!-- The \"No tiddlers found\" case ================="+"========================== -->\n<span macro=\"yourSearch if not found\">\n<table class=\"summary\" border="+"\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n  <tr>\n\t<td align=\"left\">\n\t\tYourSearch Resu"+"lt: No tiddlers found for <span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>.\n\t</td>\n\t<t"+"d class=\"yourSearchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Options'"+" options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Help' help"+" 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch closeButton\"></span>\n\t</td>\n  <"+"/tr>\n</tbody></table>\n</span>\n\n\n<!--\n}}}\n-->\n";config.shadowTiddlers["YourSearchItemTemplate"]="<!--\n{{{\n-->\n<span class='yourSearchNumber' macro='foundTiddler number'></span>\n<span class='yourSea"+"rchTitle' macro='foundTiddler title'/></span>&nbsp;-&nbsp;\n<span class='yourSearchTags' macro='found"+"Tiddler field tags 50'/></span>\n<span macro=\"yourSearch if previewText\"><div class='yourSearchText' macro='fo"+"undTiddler field text 250'/></div></span>\n<!--\n}}}\n-->";config.shadowTiddlers["YourSearch"]="<<tiddler [[YourSearch Help]]>>";config.shadowTiddlers["YourSearch Result"]="The popup-like window displaying the result of a YourSearch query.";config.macros.search.handler=_109;var _195=function(){if(config.macros.search.handler!=_109){alert("Message from YourSearchPlugin:\n\n\nAnother plugin has disabled the 'Your Search' features.\n\n\nYou may "+"disable the other plugin or change the load order of \nthe plugins (by changing the names of the tidd"+"lers)\nto enable the 'Your Search' features.");}};setTimeout(_195,5000);abego.YourSearch.getStandardRankFunction=function(){return _bb;};abego.YourSearch.getRankFunction=function(){return abego.YourSearch.getStandardRankFunction();};abego.YourSearch.getCurrentTiddler=function(){return _f4;};abego.YourSearch.closeResult=function(){_e3();};abego.YourSearch.getFoundTiddlers=function(){return _b1;};abego.YourSearch.getQuery=function(){return _b2;};abego.YourSearch.onShowResult=function(_196){highlightHack=_b2?_b2.getMarkRegExp():null;if(!_196){_f5.setItems(_b5());}if(!_dd){_dd=createTiddlyElement(document.body,"div",_da,"yourSearchResult");}else{if(_dd.parentNode!=document.body){document.body.appendChild(_dd);}}_fe();highlightHack=null;};})();}
//%/
!URL
http://www.nanowerk.com/news2/newsid=31298.php?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+nanowerk%2FagWB+%28Nanowerk+Nanotechnology+News%29

!Description
The dot product of two vectors a = [a1, a2, ... , an] and b = [b1, b2, ... , bn] is defined as:

$\Large    \mathbf{a}\cdot \mathbf{b} = \sum_{i=1}^n a_ib_i = a_1b_1 + a_2b_2 + \cdots + a_nb_n$

where Σ denotes summation notation and n is the dimension of the vector space.

In dimension 2, the dot product of vectors [a,b] and [c,d] is ac + bd. Similarly, in a dimension 3, the dot product of vectors [a,b,c] and [d,e,f] is ad + be + cf. For example, the dot product of two three-dimensional vectors [1, 3, −5] and [4, −2, −1] is

$\Large    [1, 3, -5] \cdot [4, -2, -1] = (1 \times 4) + (3 \times -2) + (-5 \times -1) = 4 - 6 + 5 = 3$.

The dot product can also be obtained via transposition and matrix multiplication as follows:

$\Large \mathbf{b}^\mathrm{T}\mathbf{a} = \mathbf{a}^\mathrm{T}\mathbf{b}$,

where both vectors are interpreted as column vectors, and aT denotes the transpose of a, in other words the corresponding row vector.
A primary electron isa high energy electron which starts in the beam of an electron microscope. It may be [[elastically scattered|Elastic scattering]] or may excite various processes in the crystal by being [[inelastically scattered|Inelastic scattering]].

[[Secondary electrons|Secondary electron]] of various types can be emitted from a solid following its bombardment with primary electrons.
!URL
http://www.electroiq.com/index/display/semiconductors-article-display/6453904759/articles/solid-state-technology/semiconductors/inspection/2011/1/failure-analysis-challenges-at-22nm-turnkey-fa-tools.html

!Description
Paul Kirby, Senior Product Manager, FEI, Hillsboro, OR USA

Paul Kirby, FEIJanuary 11, 2011 -- Detailed analysis of structures on 22nm semiconductor devices is pushing the boundaries of conventional scanning electron microscope (SEM) technology.  Even though equipment manufacturers continue to enhance the resolution of SEM-based tools, more and more failure analysis (FA) work is being conducted on transmission or scanning transmission (S/TEM)-based systems. TEM-based techniques offer the imaging resolution and analytical capability to take the industry well beyond 22 or even 15nm. To accomplish this, however, requires very thin sections to isolate the structure of interest. These sub-20nm-thick sections must contain the region of interest and require the ability to stop the thinning process at exactly the right time to capture what is frequently a one-of-a-kind defect.

At the 22nm technology node, we are seeing a shift to complex 3D device structures, such as FinFETS, that give more
/***
|''Name''|TiddlySpaceTiddlerIconsPlugin|
|''Version''|0.8.10|
|''Status''|@@beta@@|
|''Author''|Jon Robson|
|''Description''|Provides ability to render SiteIcons and icons that correspond to the home location of given tiddlers|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceTiddlerIconsPlugin.js|
|''Requires''|TiddlySpaceConfig BinaryTiddlersPlugin ImageMacroPlugin TiddlySpacePublishingCommands|
!Notes
{{{<<tiddlerOrigin>>}}} shows the origin of the tiddler it is being run on.
In TiddlySpace terms this means it will determine whether the tiddler is external, public or private.
Where private it will analyse whether a public version exists and distinguish between the different scenarios.
If a tiddler is external, the SiteIcon of that external space will be shown

!Parameters
width / height : define a width or height of the outputted icon
label: if label parameter is set to yes, a label will accompany the icon.
!Code
***/
//{{{
(function($) {

if(!config.macros.image) {
	throw "Missing dependency: ImageMacroPlugin";
}

var imageMacro = config.macros.image;
var tiddlyspace = config.extensions.tiddlyspace;
var tweb = config.extensions.tiddlyweb;
var cmds = config.commands;
var cmd = cmds.publishTiddler;
tiddlyspace.resolveSpaceName = function(value) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	if(value) {
		value = value.indexOf("bags/") === 0 ? value.substr(5) : value;
		value = value.indexOf("recipes/") === 0 ? value.substr(8) : value;
		if(value.indexOf("@") === 0) {
			value = value.substr(1);
		}
		if(endsWith(value, "_public")) {
			value = value.substr(0, value.length - 7);
		} else if(endsWith(value, "_private")) {
			value = value.substr(0, value.length - 8);
		}
		value = value.toLowerCase();
	}
	return value;
};

tiddlyspace.renderAvatar = function(place, value, options) {
	options = options ? options : {};
	options.labelOptions = options.labelOptions ? options.labelOptions : { include: false, height: 48, width: 48 };
	options.imageOptions = options.imageOptions ? options.imageOptions : {};
	options.imageOptions.altImage = "/bags/common/tiddlers/defaultUserIcon";
	var container = $('<div class="siteIcon" />').appendTo(place);
	value = tiddlyspace.resolveSpaceName(value);

	tweb.getStatus(function(status) {
		var link, noLabel;
		if(!value || value == config.views.wikified.defaultModifier ||
			value == config.views.wikified.shadowModifier) {
			var icon = config.views.wikified.shadowModifier == value ? "shadowIcon" : "missingIcon";
			if(store.tiddlerExists(icon)) {
				imageMacro.renderImage(container, icon, options.imageOptions);
			} else {
				noLabel = true;
			}
		} else {
			var spaceURI;
			if(value != tiddlyspace.currentSpace.name) {
				spaceURI = options.notSpace ? tiddlyspace.getHost(status.server_host) :
					tiddlyspace.getHost(status.server_host, value);
			}
			link = spaceURI ? $("<a />").attr("href", spaceURI) : $("<span />");
			link.text(value);

			var imageOptions = options.imageOptions;
			if(options.spaceLink && !imageOptions.link) {
				imageOptions.link = spaceURI;
			}
			var avatar = options.notSpace ? false : value;
			var uri = tiddlyspace.getAvatar(status.server_host, avatar);
			imageMacro.renderImage(container, uri, options.imageOptions);
			if(!value) {
				value = "tiddlyspace";
			}
		}
		if(!noLabel && options.labelOptions.include) {
			var prefix = $("<span />").text(options.labelOptions.prefix || "")[0];
			var suffix = $("<span />").text(options.labelOptions.suffix || "")[0];
			$('<div class="label" />').append(prefix).append(link).
				append(suffix).appendTo(container);
		}
	});
	if(value) {
		var prefix = options.labelOptions.prefix || "";
		var suffix = options.labelOptions.suffix || "";
		var label = "%0%1%2".format(prefix, value, suffix);
		$(container).attr("title", label);
	}
};

var originMacro = config.macros.tiddlerOrigin = {
	locale: {
		"shadow": "shadow tiddler",
		"missing": "missing tiddler",
		"private": "private",
		"unknown": "unknown state",
		"public": "public",
		"unsyncedPrivate": "unsynced and private",
		"unsyncedPublic": "unsynced and public",
		externalPrefix: "from ",
		externalBagSuffix: " bag",
		externalSuffix: " space",
		publishPrivateDeletePrivate: "Are you sure you want to make this tiddler public?",
		moveToPrivate: "Are you sure you want to make this tiddler private? Only members will be able to see it.",
		pleaseWait: "please wait..",
		keepPublic: "keep public",
		cannotPublishDirtyTiddler: "The current tiddler is unsaved so cannot be published. Please save the tiddler first.",
		keepPrivate: "keep private",
		makePublic: "make public",
		makePrivate: "make private"
	},
	handler: function(place, macroName, params,wikifier, paramString, tiddler){
		var adaptor = tiddler.getAdaptor();
		var btn = $("<div />").addClass("originButton").attr("params", paramString).
			attr("refresh", "macro").attr("macroName", macroName).appendTo(place)[0];
		$(btn).data("tiddler", tiddler);
		originMacro.refresh(btn);
	},
	refresh: function(btn) {
		$(btn).empty();
		var paramString = $(btn).attr("params");
		var tiddler = $(btn).data("tiddler");
		var options = originMacro.getOptions(paramString);
		var type = tiddlyspace.getTiddlerStatusType(tiddler);
		originMacro.renderIcon(tiddler, type, btn, options);
	},
	getOptions: function(paramString) {
		paramString = "%0 label:no width:48 height:48 spaceLink:yes preserveAspectRatio:yes".format(paramString);
		var parsedParams = paramString.parseParams("name");
		var params = parsedParams[0].name;
		var options = {
			labelOptions: originMacro._getLabelOptions(parsedParams),
			imageOptions: imageMacro.getArguments(paramString, []),
			noclick: parsedParams[0].interactive &&
				parsedParams[0].interactive[0] == "no" ? true : false
		};
		if(!options.noclick) {
			var spaceLink = parsedParams[0].spaceLink;
			options.spaceLink = spaceLink && spaceLink[0] == "no" ? false : true;
		} else {
			options.spaceLink = false;
		}
		return options;
	},
	_getLabelOptions: function(parsedParams) {
		parsedParams = parsedParams[0];
		var includeLabel = !parsedParams.label || ( parsedParams.label && parsedParams.label[0] == "yes" );
		var prefix = parsedParams.labelPrefix ? parsedParams.labelPrefix[0] : false;
		var suffix = parsedParams.labelSuffix ? parsedParams.labelSuffix[0] : false;
		return { include: includeLabel, suffix: suffix, prefix: prefix };
	},
	_isSpace: function(value) {
		value = value ? value : "";
		var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
		if(endsWith(value, "_private") || endsWith(value, "_public")) {
			return true;
		} else {
			return false;
		}
	},
	renderIcon: function(tiddler, type, button, options) {
		var locale = originMacro.locale;
		originMacro.annotateTiddler(button, type);
		if(type != "external") {
			originMacro.showPrivacyRoundel(tiddler, type, button,
				options);
		} else {
			var prefix = options.labelOptions.prefix, suffix = options.labelOptions.suffix;
			var space = tiddler.fields["server.bag"];
			options.notSpace = !originMacro._isSpace(space);
			options.labelOptions.prefix = prefix ? prefix : locale.externalPrefix;
			options.labelOptions.suffix = suffix ? suffix : (options.notSpace ? locale.externalBagSuffix : locale.externalSuffix);

			tiddlyspace.renderAvatar(button, space, options);
		}
	},
	showPrivacyRoundel: function(thisTiddler, privacyType, button, options) {
		// there is a public tiddler as well as the current tiddler!
		// TODO: not this is not enough.. we also need to check if the public tiddler is the same as..
		// .. the private tiddler to determine whether this is a draft
		// use of hashes would be useful here.
		$(button).empty();
		var icon = "%0Icon".format(privacyType);
		if(privacyType.indexOf("unsynced") === 0 && !store.tiddlerExists(icon)) {
			icon = "unsyncedIcon";
		}
		if(privacyType == "shadow") {
			if(!store.tiddlerExists(icon)) {
				icon = "bags/tiddlyspace/tiddlers/SiteIcon";
			}
		}
		if(privacyType == "missing" && !store.tiddlerExists(icon)) {
			return; // the user is not making use of the missingIcon
		} else {
			imageMacro.renderImage(button, icon, options.imageOptions);
			originMacro.showLabel(button, privacyType, options.labelOptions);
			var cmd = originMacro.iconCommands[privacyType];
			if(cmd && thisTiddler && !options.noclick) {
				$(button).click(function(ev) {
					cmd(ev, thisTiddler);
				});
			}
		}
	},
	annotateTiddler: function(place, type) {
		var tidEl = $(story.findContainingTiddler(place));
		tidEl.
			removeClass("private public external privateAndPublic privateNotPublic shadow").
			addClass(type);
	},
	showLabel: function(button, type, options) {
		var locale = originMacro.locale;
		var label = options.label ? options.label : locale[type];
		label = label ? label : locale.unknown;
		if(options && options.include) {
			$('<div class="roundelLabel" />').html(label).appendTo(button);
		}
		$(button).attr("title", label);
	},
	confirm: function(ev, msg, onYes, options) {
		options = options ? options : {};
		onYes = onYes ? onYes : function(ev) {};
		var btn = $(".originButton", $(ev.target).parents())[0];
		var popup = Popup.create(btn);
		$(popup).addClass("confirmationPopup");
		$("<div />").addClass("message").text(msg).appendTo(popup);
		$("<button />").addClass("button").text(options.yesLabel || "yes").appendTo(popup).click(onYes);
		$("<button />").addClass("button").text(options.noLabel || "no").click(function(ev) {
			Popup.remove();
		}).appendTo(popup);
		Popup.show();
		ev.stopPropagation();
		return false;
	},
	alert: function(ev, msg) {
		var popup = Popup.create(ev.target);
		$(popup).addClass("confirmationPopup alert");
		$("<div />").addClass("message").text(msg).appendTo(popup);
		Popup.show();
		ev.stopPropagation();
	},
	reportDirty: function(el) {
		originMacro.alert(el, originMacro.locale.cannotPublishDirtyTiddler);
	},
	iconCommands: {
		"public": function(ev, tiddler) {
			if(!readOnly) {
				var locale = originMacro.locale;
				var msg = locale.moveToPrivate;
				if(story.isDirty(tiddler.title)) {
					originMacro.reportDirty(ev);
				} else {
					originMacro.confirm(ev, msg, function(ev) {
						var target = $(ev.target);
						var onComplete = function(info) {};
						var privateBag = cmd.toggleBag(tiddler, "private");
						cmd.moveTiddler(tiddler, {
							title: tiddler.title,
							fields: { "server.bag": privateBag }
						}, onComplete);
					}, { yesLabel: locale.makePrivate, noLabel: locale.keepPublic });
				}
			}
		},
		"private": function(ev, tiddler) {
			if(!readOnly) {
				var locale = originMacro.locale;
				var adaptor = tiddler.getAdaptor();
				var publishTo = tiddler.fields["publish.name"] || tiddler.title;
				var workspace = "bags/%0".format(tiddler.fields["server.bag"]);
				tiddler.fields["server.workspace"] = workspace;
				var publicBag = cmd.toggleBag(tiddler, "public");
				var msg;
				msg = locale.publishPrivateDeletePrivate;
				var title = tiddler.title;
				var newTitle = publishTo || tiddler.title;
				tiddler.fields["server.page.revision"] = "false";
				store.addTiddler(tiddler);
				if(story.isDirty(tiddler.title)) {
					originMacro.reportDirty(ev);
				} else {
					originMacro.confirm(ev, msg, function(ev) {
						var onComplete = function(info) {};
						cmd.moveTiddler(tiddler, {
							title: newTitle,
							fields: { "server.bag": publicBag }
						}, onComplete);
					}, { yesLabel: locale.makePublic, noLabel: locale.keepPrivate });
				}
			}
		}
	}
};

})(jQuery);
//}}}
/***
|''Name''|ServerSideSavingPlugin|
|''Description''|server-side saving|
|''Author''|FND|
|''Version''|0.6.5|
|''Status''|stable|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/ServerSideSavingPlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5.3|
|''Keywords''|serverSide|
!Notes
This plugin relies on a dedicated adaptor to be present.
The specific nature of this plugin depends on the respective server.
!Revision History
!!v0.1 (2008-11-24)
* initial release
!!v0.2 (2008-12-01)
* added support for local saving
!!v0.3 (2008-12-03)
* added Save to Web macro for manual synchronization
!!v0.4 (2009-01-15)
* removed ServerConfig dependency by detecting server type from the respective tiddlers
!!v0.5 (2009-08-25)
* raised CoreVersion to 2.5.3 to take advantage of core fixes
!!v0.6 (2010-04-21)
* added notification about cross-domain restrictions to ImportTiddlers
!To Do
* conflict detection/resolution
* rename to ServerLinkPlugin?
* document deletion/renaming convention
!Code
***/
//{{{
(function($) {

readOnly = false; //# enable editing over HTTP

var plugin = config.extensions.ServerSideSavingPlugin = {};

plugin.locale = {
	saved: "%0 saved successfully",
	saveError: "Error saving %0: %1",
	saveConflict: "Error saving %0: edit conflict",
	deleted: "Removed %0",
	deleteError: "Error removing %0: %1",
	deleteLocalError: "Error removing %0 locally",
	removedNotice: "This tiddler has been deleted.",
	connectionError: "connection could not be established",
	hostError: "Unable to import from this location due to cross-domain restrictions."
};

plugin.sync = function(tiddlers) {
	tiddlers = tiddlers && tiddlers[0] ? tiddlers : store.getTiddlers();
	$.each(tiddlers, function(i, tiddler) {
		var changecount = parseInt(tiddler.fields.changecount, 10);
		if(tiddler.fields.deleted === "true" && changecount === 1) {
			plugin.removeTiddler(tiddler);
		} else if(tiddler.isTouched() && !tiddler.doNotSave() &&
				tiddler.getServerType() && tiddler.fields["server.host"]) { // XXX: server.host could be empty string
			delete tiddler.fields.deleted;
			plugin.saveTiddler(tiddler);
		}
	});
};

plugin.saveTiddler = function(tiddler) {
	try {
		var adaptor = this.getTiddlerServerAdaptor(tiddler);
	} catch(ex) {
		return false;
	}
	var context = {
		tiddler: tiddler,
		changecount: tiddler.fields.changecount,
		workspace: tiddler.fields["server.workspace"]
	};
	var serverTitle = tiddler.fields["server.title"]; // indicates renames
	if(!serverTitle) {
		tiddler.fields["server.title"] = tiddler.title;
	} else if(tiddler.title != serverTitle) {
		return adaptor.moveTiddler({ title: serverTitle },
			{ title: tiddler.title }, context, null, this.saveTiddlerCallback);
	}
	var req = adaptor.putTiddler(tiddler, context, {}, this.saveTiddlerCallback);
	return req ? tiddler : false;
};

plugin.saveTiddlerCallback = function(context, userParams) {
	var tiddler = context.tiddler;
	if(context.status) {
		if(tiddler.fields.changecount == context.changecount) { //# check for changes since save was triggered
			tiddler.clearChangeCount();
		} else if(tiddler.fields.changecount > 0) {
			tiddler.fields.changecount -= context.changecount;
		}
		plugin.reportSuccess("saved", tiddler);
		store.setDirty(false);
	} else {
		if(context.httpStatus == 412) {
			plugin.reportFailure("saveConflict", tiddler);
		} else {
			plugin.reportFailure("saveError", tiddler, context);
		}
	}
};

plugin.removeTiddler = function(tiddler) {
	try {
		var adaptor = this.getTiddlerServerAdaptor(tiddler);
	} catch(ex) {
		return false;
	}
	var context = {
		host: tiddler.fields["server.host"],
		workspace: tiddler.fields["server.workspace"],
		tiddler: tiddler
	};
	var req = adaptor.deleteTiddler(tiddler, context, {}, this.removeTiddlerCallback);
	return req ? tiddler : false;
};

plugin.removeTiddlerCallback = function(context, userParams) {
	var tiddler = context.tiddler;
	if(context.status) {
		if(tiddler.fields.deleted === "true") {
			store.deleteTiddler(tiddler.title);
		} else {
			plugin.reportFailure("deleteLocalError", tiddler);
		}
		plugin.reportSuccess("deleted", tiddler);
		store.setDirty(false);
	} else {
		plugin.reportFailure("deleteError", tiddler, context);
	}
};

plugin.getTiddlerServerAdaptor = function(tiddler) { // XXX: rename?
	var type = tiddler.fields["server.type"] || config.defaultCustomFields["server.type"];
	return new config.adaptors[type]();
};

plugin.reportSuccess = function(msg, tiddler) {
	displayMessage(plugin.locale[msg].format([tiddler.title]));
};

plugin.reportFailure = function(msg, tiddler, context) {
	var desc = (context && context.httpStatus) ? context.statusText :
		plugin.locale.connectionError;
	displayMessage(plugin.locale[msg].format([tiddler.title, desc]));
};

config.macros.saveToWeb = { // XXX: hijack existing sync macro?
	locale: { // TODO: merge with plugin.locale?
		btnLabel: "save to web",
		btnTooltip: "synchronize changes",
		btnAccessKey: null
	},

	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		createTiddlyButton(place, this.locale.btnLabel, this.locale.btnTooltip,
			plugin.sync, null, null, this.locale.btnAccessKey);
	}
};

// hijack saveChanges to trigger remote saving
var _saveChanges = saveChanges;
saveChanges = function(onlyIfDirty, tiddlers) {
	if(window.location.protocol == "file:") {
		_saveChanges.apply(this, arguments);
	} else {
		plugin.sync(tiddlers);
	}
};

// override removeTiddler to flag tiddler as deleted -- XXX: use hijack to preserve compatibility?
TiddlyWiki.prototype.removeTiddler = function(title) { // XXX: should override deleteTiddler instance method?
	var tiddler = this.fetchTiddler(title);
	if(tiddler) {
		tiddler.tags = ["excludeLists", "excludeSearch", "excludeMissing"];
		tiddler.text = plugin.locale.removedNotice;
		tiddler.fields.deleted = "true"; // XXX: rename to removed/tiddlerRemoved?
		tiddler.fields.changecount = "1";
		this.notify(title, true);
		this.setDirty(true);
	}
};

// hijack ImportTiddlers wizard to handle cross-domain restrictions
var _onOpen = config.macros.importTiddlers.onOpen;
config.macros.importTiddlers.onOpen = function(ev) {
	var btn = $(resolveTarget(ev));
	var url = btn.closest(".wizard").find("input[name=txtPath]").val();
	if(window.location.protocol != "file:" && url.indexOf("://") != -1) {
		var host = url.split("/")[2];
		var macro = config.macros.importTiddlers;
		if(host != window.location.host) {
			btn.text(macro.cancelLabel).attr("title", macro.cancelPrompt);
			btn[0].onclick = macro.onCancel;
			$('<span class="status" />').text(plugin.locale.hostError).insertAfter(btn);
			return false;
		}
	}
	return _onOpen.apply(this, arguments);
};

})(jQuery);
//}}}
/***
|''Name''|GroupByPlugin|
|''Description''|Mimics allTags macro to provide ways of creating lists grouping tiddlers by any field|
|''Version''|0.6.1|
|''Author''|Jon Robson|
|''Status''|beta|
!Usage
{{{<<groupBy tags>>}}}
mimics allTags macro

{{{<<groupBy server.bag>>}}}
groups by the server.bag field (this version contains TiddlySpace specific code for turning a bag into a space name)

{{{groupBy modified dateFormat:"YYYY"}}}
group tiddlers by year.

{{{<<groupBy tags exclude:excludeLists exclude:systemConfig>>}}}
group tiddlers by tag but exclude the tags with values excludeLists and systemConfig

Within that group you can also exclude things by filter
{{{groupBy modifier filter:[tag[film]]}}}
will group tiddlers tagged with film by modifier.
***/
//{{{
(function($) {
var taglocale = config.views.wikified.tag;
var macro = config.macros.groupBy = {
	locale: {
		tooltip: "all tiddlers in group %0",
		noTiddlers: "no tiddlers",
		openAllText: taglocale.openAllText,
		openAllTooltip: taglocale.openAllTooltip,
		openTiddler: "open tiddler with title %0"
	},
	morpher: {
		// TODO: note currently the following 2 morphers are TiddlySpace specific and probably should be in separate plugin
		"server.workspace": function(value, options) {
			return macro.morpher["server.bag"](value.replace("bags/", "").replace("recipes/", ""));
		},
		"server.bag": function(value, options) {
			if(typeof(value) !== "string") {
				return false;
			} else if(value.indexOf("_public") === -1 && value.indexOf("_private") === -1) {
				value = "*%0".format(value); // add star for non-space bags.
			}
			return value.replace("_public", "").replace("_private", "");
		},
		created: function(value, options) {
			return value.formatString(options.dateFormat || "DD MMM YYYY");
		},
		modified: function(value, options) {
			return macro.morpher.created(value, options);
		}
	},

	handler: function(place, macroName, params, wikifier, paramString) {
		var field = params[0] || "server.workspace";
		var dateFormat = params[1] || "DD MMM YYYY";
		var container = $("<div />").attr("macroName", macroName).addClass("groupBy").
			attr("refresh", "macro").attr("fieldName", field).
			attr("paramString", paramString).
			attr("dateFormat", dateFormat).appendTo(place)[0];
		macro.refresh(container);
	},
	isTypeArray: function(value) {
		var valueType = typeof value;
		if(valueType === "object" && typeof value.length === "number" &&
			!(value.propertyIsEnumerable("length")) &&
			typeof value.splice === "function") { //is Array
			return true;
		} else {
			return false;
		}
	},
	_onClickGroup: function(ev, options) {
		var i, target = ev.target, locale = macro.locale;
		var tiddlers = $(target).closest(".templateContainer").data("tiddlers");
		var popup = $(Popup.create(target)).addClass("taggedTiddlerList")[0];
		var value = $(target).attr("value");
		var openAll = createTiddlyButton($("<li />").appendTo(popup)[0],
			locale.openAllText.format(value), locale.openAllTooltip);
		$(openAll).click(function(ev) {
			story.displayTiddlers(ev.target, tiddlers);
			return false;
		});
		var listBreak = $("<li />").addClass("listBreak").html("<div />").appendTo(popup);
		for(i = 0; i < tiddlers.length; i++) {
			var item = $("<li />").appendTo(popup)[0];
			var template = store.getTiddlerText(options.template) || macro.template;
			wikify(template, item, null, tiddlers[i]);
		}
		listBreak.clone().appendTo(popup);
		$(createTiddlyLink($("<li />").appendTo(popup)[0], value, false)).
			text(locale.openTiddler.format(value));
		Popup.show();
		ev.stopPropagation();
		return false;
	},
	_refresh: function(container, tiddlers, options) {
		var totalGroups = 0, locale = macro.locale, i, j;
		var excludeValues = options.exclude;
		var values = {}, value_ids = [];
		var field = options.field;
		var morpher = macro.morpher[field] || function(value) {
			return value;
		};
		for(i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			var value = tiddler[field] || tiddler.fields[field];
			value = macro.isTypeArray(value) ? value : [ value ];
			for(j = 0; j < value.length; j++) {
				var v = morpher(value[j], options);
				if(v && excludeValues.indexOf(v) === -1) {
					totalGroups += 1;
					if(!values[v]) {
						values[v] = [];
					}
					values[v].push(tiddler);
					value_ids.pushUnique(v);
				}
			}
		}
		var ul = $("<ul />").appendTo(container)[0];
		if(totalGroups === 0) {
			$("<li />").addClass("listTitle").text(locale.noTiddlers);
		}
		value_ids = value_ids.sort();
		var groupTemplate = store.getTiddlerText(options.groupTemplate);
		var onClick = function(ev) {
			macro._onClickGroup(ev, options);
		};
		for(i = 0; i < value_ids.length; i++) {
			var title = value_ids[i];
			var info = getTiddlyLinkInfo(title);
			tiddlers = values[title];
			var btn = createTiddlyButton($("<li />").appendTo(ul)[0],
				"%0 (%1)".format(title, tiddlers.length), locale.tooltip.format(title), null, info.classes);
			if(groupTemplate) {
				$(btn).empty();
				wikify(groupTemplate, btn, null, tiddlers[0]);
			}
			$(btn).click(onClick).attr("value", title).attr("refresh", "link").attr("tiddlyLink", title);
			$(btn).addClass("templateContainer").data("tiddlers", tiddlers);
		}
	},
	refresh: function(container) {
		container = $(container).empty();
		var paramString = container.attr("paramString");
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var options = { field: container.attr("fieldName"), dateFormat: container.attr("dateFormat"), exclude: args.exclude || [],
			template: args.template ? args.template[0] : false, groupTemplate: args.groupTemplate ? args.groupTemplate[0] : "" };
		var tiddlers = args.filter ? store.filterTiddlers(args.filter[0]) : store.getTiddlers("title");
		macro._refresh(container, tiddlers, options);
	},
	template: "<<view title link>>"
};

}(jQuery));
//}}}
{{{
config.macros.BBClonePlugin = {
  handler: function (place, macroName, params, wikifier, paramString, tiddler)
  {
     var uri = "/bbclone/count.php?tiddler=Tiddler:[%0]".
         format([tiddler.title]);
     jQuery.get(uri); 
   }
 }
}}}
/***
|''Name''|TiddlySpaceFilters|
|''Description''|provide TiddlySpace-specific filter extensions|
|''Author''|Jon Robson|
|''Version''|0.6.1|
|''Status''|@@beta@@|
|''CoreVersion''|2.6.2|
|''Requires''|TiddlySpaceConfig|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Usage
{{{
<<tsList Private>>
<<tsList Public>>
<<tsList Draft>>
}}}
!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var privateBag = tiddlyspace.getCurrentBag("private");
var publicBag = tiddlyspace.getCurrentBag("public");

config.filterHelpers = {
	is: {
		"private": function(tiddler) {
			var bag = tiddler.fields["server.bag"];
			return bag == privateBag;
		},
		"public": function(tiddler) {
			var bag = tiddler.fields["server.bag"];
			return bag == publicBag;
		},
		draft: function(tiddler) {
			var fields = tiddler.fields;
			var bag = fields["server.bag"];
			return (privateBag == bag && fields["publish.name"]) ? true : false;
		},
		local: function(tiddler) {
			return config.filterHelpers.is["public"](tiddler) ||
				config.filterHelpers.is["private"](tiddler);
		},
		unsynced: function(tiddler) {
			return tiddler ? tiddler.isTouched() : false;
		}
	}
};

config.filters.is = function(results, match) {
	var candidates = store.getTiddlers("title");
	var type = match[3];
	for (var i = 0; i < candidates.length; i++) {
		var tiddler = candidates[i];
		var helper = config.filterHelpers.is[type];
		if(helper && helper(tiddler)) {
			results.pushUnique(tiddler);
		}
	}
	return results;
};

})(jQuery);
//}}}
/***
|''Name''|DiffFormatter|
|''Description''|highlighting of text comparisons|
|''Author''|FND|
|''Version''|0.9.0|
|''Status''|beta|
|''Source''|http://svn.tiddlywiki.org/Trunk/contributors/FND/formatters/DiffFormatter.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Keywords''|formatting|
!Description
Highlights changes in a unified [[diff|http://en.wikipedia.org/wiki/Diff#Unified_format]].
!Notes
Based on Martin Budden's [[DiffFormatterPlugin|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/formatters/DiffFormatterPlugin.js]].
!Usage
The formatter is applied to blocks wrapped in <html><code>{{{diff{..}}}</code></html> within tiddlers tagged with "diff".
!Revision History
!!v0.9 (2010-04-07)
* initial release; fork of DiffFormatterPlugin
!StyleSheet
.diff { white-space: pre; font-family: monospace; }
.diff ins, .diff del { display: block; text-decoration: none; }
.diff ins { background-color: #dfd; }
.diff del { background-color: #fdd; }
.diff .highlight { background-color: [[ColorPalette::SecondaryPale]]; }
!Code
***/
//{{{
(function() {

config.shadowTiddlers.StyleSheetDiffFormatter = store.getTiddlerText(tiddler.title + "##StyleSheet");
store.addNotification("StyleSheetDiffFormatter", refreshStyles);

var formatters = [{
		name: "diffWrapper",
		match: "^\\{\\{diff\\{\n", // XXX: suboptimal
		termRegExp: /(.*\}\}\})$/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "div", null, "diff");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}, {
		name: "diffRange",
		match: "^(?:@@|[+\\-]{3}) ",
		lookaheadRegExp: /^(?:@@|[+\-]{3}) .*\n/mg,
		handler: function(w) {
			createTiddlyElement(w.output, "div", null, "highlight").
				innerHTML = "&#8230;";
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	}, {
		name: "diffAdded",
		match: "^\\+",
		termRegExp: /(\n)/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "ins", null, "added");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}, {
		name: "diffRemoved",
		match: "^-",
		termRegExp: /(\n)/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "del", null, "removed");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}
];

config.parsers.diffFormatter = new Formatter(formatters);
config.parsers.diffFormatter.format = "diff";
config.parsers.diffFormatter.formatTag = "diff";

})();
//}}}
//{{{
/* Version 0.92 */
/*
    Copyright 2008-2011
        Matthias Ehmann,
        Michael Gerhaeuser,
        Carsten Miller,
        Bianca Valentin,
        Alfred Wassermann,
        Peter Wilfahrt

    This file is part of JSXGraph.

    JSXGraph 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 3 of the License, or
    (at your option) any later version.

    JSXGraph 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 for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with JSXGraph.  If not, see <http://www.gnu.org/licenses/>.
*/
    var JXG={};(function(){var d,e;JXG.countDrawings=0;JXG.countTime=0;JXG.require=function(f){};JXG.rendererFiles=[];JXG.rendererFiles.svg="SVGRenderer";JXG.rendererFiles.vml="VMLRenderer";JXG.rendererFiles.canvas="CanvasRenderer";JXG.baseFiles=null;JXG.requirePath="";for(d=0;d<document.getElementsByTagName("script").length;d++){e=document.getElementsByTagName("script")[d];if(e.src&&e.src.match(/loadjsxgraphInOneFile\.js(\?.*)?$/)){JXG.requirePath=e.src.replace(/loadjsxgraphInOneFile\.js(\?.*)?$/,"")}}JXG.serverBase=JXG.requirePath+"server/"})();JXG.extend=function(d,j,f,i){var h,g;f=f||false;i=i||false;for(h in j){if(!f||(f&&j.hasOwnProperty(h))){if(i){g=h.toLowerCase()}else{g=h}d[g]=j[h]}}};JXG.shortcut=function(e,d){return function(){return e[d].apply(this,arguments)}};JXG.extend(JXG,{supportsVML:function(){return !!document.namespaces},supportsSVG:function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")},supportsCanvas:function(){return !!document.createElement("canvas").getContext},isAndroid:function(){return navigator.userAgent.toLowerCase().search("android")>-1},isWebkitAndroid:function(){return this.isAndroid()&&navigator.userAgent.search(" AppleWebKit/")>-1},getReference:function(e,d){if(typeof(d)=="string"){if(JXG.exists(e.objects[d])){d=e.objects[d]}else{if(JXG.exists(e.elementsByName[d])){d=e.elementsByName[d]}else{if(JXG.exists(e.groups[d])){d=e.groups[d]}}}}return d},getRef:JXG.shortcut(JXG,"getReference"),isString:function(d){return typeof d==="string"},isNumber:function(d){return typeof d==="number"},isFunction:function(d){return typeof d==="function"},isArray:function(d){return d!==null&&typeof d==="object"&&"splice" in d&&"join" in d},isPoint:function(d){if(typeof d=="object"){return(d.elementClass==JXG.OBJECT_CLASS_POINT)}return false},exists:(function(d){return function(e){return !(e===d||e===null)}})(),str2Bool:function(d){if(!JXG.exists(d)){return true}if(typeof d=="boolean"){return d}return(d.toLowerCase()=="true")},_board:function(e,d){return JXG.JSXGraph.initBoard(e,d)},createEvalFunction:function(e,j,k){var g=[],d,h;for(d=0;d<k;d++){if(typeof j[d]=="string"){h=JXG.GeonextParser.geonext2JS(j[d],e);h=h.replace(/this\.board\./g,"board.");g[d]=new Function("","return "+(h)+";")}}return function(i){var f=j[i];if(typeof f=="string"){return g[i]()}else{if(typeof f=="function"){return f()}else{if(typeof f=="number"){return f}}}return 0}},createFunction:function(e,f,g,h){var d;if((h==null||h)&&JXG.isString(e)){d=JXG.GeonextParser.geonext2JS(e,f);return new Function(g,"return "+d+";")}else{if(JXG.isFunction(e)){return e}else{if(JXG.isNumber(e)){return function(){return e}}else{if(JXG.isString(e)){return function(){return e}}}}}return null},checkParents:function(f,o,n){var g,e,d,l,p=[],m=o.slice(0),h=function(j,i){var k=(typeof j).toLowerCase();if(k==="number"){return i&&((i.type&&i.type===j)||(i.elementClass&&i.elementClass===j))}else{switch(j.toLowerCase()){case"string":case"object":case"function":case"number":return(typeof i).toLowerCase()===j.toLowerCase();break;case"array":return JXG.isArray(i);break}}return false};for(g=0;g<n.length;g++){for(e=0;e<n[g].length&&o.length>=n[g].length;e++){d=0;while(d<m.length&&!h(n[g][e],m[d])){d++}if(d<m.length){p.push(m.splice(l-d-1,1)[0])}}if(m.length){m=o.slice(0);p=[]}else{return p}}},readOption:function(d,f,e){var g=d.elements[e];if(JXG.exists(d[f][e])){g=d[f][e]}return g},checkAttributes:function(d,f){var e;if(!JXG.exists(d)){d={}}for(e in f){if(!JXG.exists(d[e])){d[e]=f[e]}}return d},copyAttributes:function(f,g){var e,h,d,k,j;e=this.deepCopy(g.elements,null,true);d=arguments.length;if(d<4&&this.exists(arguments[2])&&this.exists(g.layer[arguments[2]])){e.layer=g.layer[arguments[2]]}k=g;j=true;for(h=2;h<d;h++){if(JXG.exists(k[arguments[h]])){k=k[arguments[h]]}else{j=false;break}}if(j){e=this.deepCopy(e,k,true)}k=f;j=true;for(h=3;h<d;h++){if(JXG.exists(k[arguments[h]])){k=k[arguments[h]]}else{j=false;break}}if(j){this.extend(e,k,null,true)}return e},getDimensions:function(i){var h,k,f,l,j,e,d,g;h=document.getElementById(i);if(!JXG.exists(h)){throw new Error("\nJSXGraph: HTML container element '"+(i)+"' not found.")}k=h.style.display;if(k!="none"&&k!=null){return{width:h.offsetWidth,height:h.offsetHeight}}f=h.style;l=f.visibility;j=f.position;e=f.display;f.visibility="hidden";f.position="absolute";f.display="block";d=h.clientWidth;g=h.clientHeight;f.display=e;f.position=j;f.visibility=l;return{width:d,height:g}},addEvent:function(g,f,e,d){d["x_internal"+f]=function(){return e.apply(d,arguments)};if(JXG.exists(g.addEventListener)){g.addEventListener(f,d["x_internal"+f],false)}else{g.attachEvent("on"+f,d["x_internal"+f])}},removeEvent:function(i,g,f,d){try{if(JXG.exists(i.addEventListener)){i.removeEventListener(g,d["x_internal"+g],false)}else{i.detachEvent("on"+g,d["x_internal"+g])}}catch(h){JXG.debug("JSXGraph: Can't remove event listener on"+g+": "+d["x_internal"+g])}},bind:function(e,d){return function(){return e.apply(d,arguments)}},getPosition:function(g,f){var d=0,h=0;if(!g){g=window.event}if(JXG.exists(f)){g=g.targetTouches[f]}if(g.pageX||g.pageY){d=g.pageX;h=g.pageY}else{if(g.clientX||g.clientY){d=g.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;h=g.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return[d,h]},getOffset:function(g){var h=g,f=g,d=h.offsetLeft-h.scrollLeft,e=h.offsetTop-h.scrollTop;while(h=h.offsetParent){d+=h.offsetLeft;e+=h.offsetTop;if(h.offsetParent){d+=h.clientLeft-h.scrollLeft;e+=h.clientTop-h.scrollTop}f=f.parentNode;while(f!=h){d+=f.clientLeft-f.scrollLeft;e+=f.clientTop-f.scrollTop;f=f.parentNode}}return[d,e]},getStyle:function(e,d){return e.style[d]},keys:function(d,e){var f=[],g;for(g in d){if(e){if(d.hasOwnProperty(g)){f.push(g)}}else{f.push(g)}}return f},escapeHTML:function(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},unescapeHTML:function(d){return d.replace(/<\/?[^>]+>/gi,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},clone:function(e){var d={};d.prototype=e;return d},cloneAndCopy:function(g,f){var d=function(){},e;d.prototype=g;for(e in f){d[e]=f[e]}return d},deepCopy:function(k,h,g){var m,e,l,d,f;g=g||false;if(typeof k!=="object"||k==null){return k}if(this.isArray(k)){m=[];for(e=0;e<k.length;e++){l=k[e];if(typeof l=="object"){m[e]=this.deepCopy(l)}else{m[e]=l}}}else{m={};for(e in k){f=g?e.toLowerCase():e;l=k[e];if(typeof l=="object"){m[f]=this.deepCopy(l)}else{m[f]=l}}for(e in h){f=g?e.toLowerCase():e;l=h[e];if(typeof l=="object"){if(JXG.isArray(l)||!JXG.exists(m[f])){m[f]=this.deepCopy(l)}else{m[f]=this.deepCopy(m[f],l,g)}}else{m[f]=l}}}return m},toJSON:function(j){var f;if(window.JSON&&window.JSON.stringify){try{f=JSON.stringify(j);return f}catch(h){}}switch(typeof j){case"object":if(j){var g=[];if(j instanceof Array){for(var d=0;d<j.length;d++){g.push(JXG.toJSON(j[d]))}return"["+g.join(",")+"]"}else{for(var k in j){g.push('"'+k+'":'+JXG.toJSON(j[k]))}return"{"+g.join(",")+"}"}}else{return"null"}case"string":return'"'+j.replace(/(["'])/g,"\\$1")+'"';case"number":case"boolean":return new String(j)}},capitalize:function(d){return d.charAt(0).toUpperCase()+d.substring(1).toLowerCase()},timedChunk:function(e,g,f,h){var d=e.concat();setTimeout(function(){var i=+new Date();do{g.call(f,d.shift())}while(d.length>0&&(+new Date()-i<300));if(d.length>0){setTimeout(arguments.callee,1)}else{h(e)}},1)},trimNumber:function(d){d=d.replace(/^0+/,"");d=d.replace(/0+$/,"");if(d[d.length-1]=="."||d[d.length-1]==","){d=d.slice(0,-1)}if(d[0]=="."||d[0]==","){d="0"+d}return d},trim:function(d){d=d.replace(/^w+/,"");d=d.replace(/w+$/,"");return d},evaluate:function(d){if(JXG.isFunction(d)){return d()}else{return d}},debug:function(e){var d;for(d=0;d<arguments.length;d++){e=arguments[d];if(window.console&&console.log){if(typeof e==="string"){e=e.replace(/<\S[^><]*>/g,"")}console.log(e)}else{if(document.getElementById("debug")){document.getElementById("debug").innerHTML+=e+"<br/>"}}}}});JXG.addEvent(window,"load",function(){var h=document.getElementsByTagName("script"),n,l,k,e,m,f,p,o,g,d;for(l=0;l<h.length;l++){n=h[l].getAttribute("type",false);if(!JXG.exists(n)){continue}if(n.toLowerCase()==="text/jessiescript"||n.toLowerCase==="jessiescript"){f=h[l].getAttribute("width",false)||"500px";p=h[l].getAttribute("height",false)||"500px";o=h[l].getAttribute("boundingbox",false)||"-5, 5, 5, -5";o=o.split(",");if(o.length!==4){o=[-5,5,5,-5]}else{for(k=0;k<o.length;k++){o[k]=parseFloat(o[k])}}g=JXG.str2Bool(h[l].getAttribute("axis",false)||"false");d=JXG.str2Bool(h[l].getAttribute("grid",false)||"false");e=document.createElement("div");e.setAttribute("id","jessiescript_autgen_jxg_"+l);e.setAttribute("style","width:"+f+"; height:"+p+"; float:left");e.setAttribute("class","jxgbox");document.body.insertBefore(e,h[l]);m=JXG.JSXGraph.initBoard("jessiescript_autgen_jxg_"+l,{boundingbox:o,keepaspectratio:true,grid:d,axis:g});m.construct(h[l].innerHTML)}}},window);JXG.Math=(function(e,d,f){var g=function(i){var h,j;if(i.memo){return i.memo}h={};j=Array.prototype.join;return(i.memo=function(){var k=j.call(arguments);return(h[k]!==f)?h[k]:h[k]=i.apply(this,arguments)})};return{eps:0.000001,vector:function(l,k){var j,h;k=k||0;j=new Array(d.ceil(l));for(h=0;h<l;h++){j[h]=k}return j},matrix:function(q,h,p){var o,l,k;p=p||0;h=h||q;o=new Array(d.ceil(q));for(l=0;l<q;l++){o[l]=new Array(d.ceil(h));for(k=0;k<h;k++){o[l][k]=p}}return o},identity:function(l,h){var k,j;if((h===f)&&(typeof h!=="number")){h=l}k=this.matrix(l,h);for(j=0;j<d.min(l,h);j++){k[j][j]=1}return k},frustum:function(i,m,h,k,p,o){var j=e.Math.matrix(4,4);j[0][0]=(p*2)/(m-i);j[0][1]=0;j[0][2]=(m+i)/(m-i);j[0][3]=0;j[1][0]=0;j[1][1]=(p*2)/(k-h);j[1][2]=(k+h)/(k-h);j[1][3]=0;j[2][0]=0;j[2][1]=0;j[2][2]=-(o+p)/(o-p);j[2][3]=-(o*p*2)/(o-p);j[3][0]=0;j[3][1]=0;j[3][2]=-1;j[3][3]=0;return j},projection:function(h,j,m,l){var i=m*d.tan(h/2),k=i*j;return this.frustum(-k,k,-i,i,m,l)},matVecMult:function(q,p){var h=q.length,t=p.length,o=[],l,r,j;if(t===3){for(l=0;l<h;l++){o[l]=q[l][0]*p[0]+q[l][1]*p[1]+q[l][2]*p[2]}}else{for(l=0;l<h;l++){r=0;for(j=0;j<t;j++){r+=q[l][j]*p[j]}o[l]=r}}return o},matMatMult:function(l,h){var p=l.length,o=p>0?h[0].length:0,v=h.length,u=this.matrix(p,o),t,r,w,q;for(t=0;t<p;t++){for(r=0;r<o;r++){w=0;for(q=0;q<v;q++){w+=l[t][q]*h[q][r]}u[t][r]=w}}return u},transpose:function(q){var l,o,k,h,p;h=q.length;p=q.length>0?q[0].length:0;l=this.matrix(p,h);for(o=0;o<p;o++){for(k=0;k<h;k++){l[o][k]=q[k][o]}}return l},inverse:function(x){var u,t,q,z,y,h,w,o=x.length,m=[],l=[],v=[];for(u=0;u<o;u++){m[u]=[];for(t=0;t<o;t++){m[u][t]=x[u][t]}l[u]=u}for(t=0;t<o;t++){y=d.abs(m[t][t]);h=t;for(u=t+1;u<o;u++){if(d.abs(m[u][t])>y){y=d.abs(m[u][t]);h=u}}if(y<=e.Math.eps){return false}if(h>t){for(q=0;q<o;q++){w=m[t][q];m[t][q]=m[h][q];m[h][q]=w}w=l[t];l[t]=l[h];l[h]=w}z=1/m[t][t];for(u=0;u<o;u++){m[u][t]*=z}m[t][t]=z;for(q=0;q<o;q++){if(q!=t){for(u=0;u<o;u++){if(u!=t){m[u][q]-=m[u][t]*m[t][q]}}m[t][q]=-z*m[t][q]}}}for(u=0;u<o;u++){for(q=0;q<o;q++){v[l[q]]=m[u][q]}for(q=0;q<o;q++){m[u][q]=v[q]}}return m},innerProduct:function(j,h,m){var k,l=0;if((m===f)||(typeof m!=="number")){m=j.length}for(k=0;k<m;k++){l+=j[k]*h[k]}return l},crossProduct:function(i,h){return[i[1]*h[2]-i[2]*h[1],i[2]*h[0]-i[0]*h[2],i[0]*h[1]-i[1]*h[0]]},factorial:g(function(h){if(h<0){return NaN}h=d.floor(h);if(h===0||h===1){return 1}return h*arguments.callee(h-1)}),binomial:g(function(m,j){var h,l;if(j>m||j<0){return NaN}j=d.floor(j);m=d.floor(m);if(j===0||j===m){return 1}h=1;for(l=0;l<j;l++){h*=(m-l);h/=(l+1)}return h}),cosh:function(h){return(d.exp(h)+d.exp(-h))*0.5},sinh:function(h){return(d.exp(h)-d.exp(-h))*0.5},pow:function(i,h){if(i===0){if(h===0){return 1}else{return 0}}if(d.floor(h)===h){return d.pow(i,h)}else{if(i>0){return d.exp(h*d.log(d.abs(i)))}else{return NaN}}},squampow:function(j,i){var h;if(d.floor(i)===i){h=1;if(i<0){j=1/j;i*=-1}while(i!=0){if(i&1){h*=j}i>>=1;j*=j}return h}else{return this.pow(j,i)}},normalize:function(j){var h=2*j[3],k=j[4]/(h),l,i;j[5]=k;j[6]=-j[1]/h;j[7]=-j[2]/h;if(k===Infinity||isNaN(k)){l=d.sqrt(j[1]*j[1]+j[2]*j[2]);j[0]/=l;j[1]/=l;j[2]/=l;j[3]=0;j[4]=1}else{if(d.abs(k)>=1){j[0]=(j[6]*j[6]+j[7]*j[7]-k*k)/(2*k);j[1]=-j[6]/k;j[2]=-j[7]/k;j[3]=1/(2*k);j[4]=1}else{i=(k<=0)?(-1):(1);j[0]=i*(j[6]*j[6]+j[7]*j[7]-k*k)*0.5;j[1]=-i*j[6];j[2]=-i*j[7];j[3]=i/2;j[4]=i*k}}return j},toGL:function(h){var k,n,l;if(typeof Float32Array!=="undefined"){k=new Float32Array(16)}else{k=new Array(16)}if(h.length!==4&&h[0].length!==4){return k}for(n=0;n<4;n++){for(l=0;l<4;l++){k[n+4*l]=h[n][l]}}return k}}})(JXG,Math);JXG.Math.Numerics=(function(e,d){var f={rk4:{s:4,A:[[0,0,0,0],[0.5,0,0,0],[0,0.5,0,0],[0,0,1,0]],b:[1/6,1/3,1/3,1/6],c:[0,0.5,0.5,1]},heun:{s:2,A:[[0,0],[1,0]],b:[0.5,0.5],c:[0,1]},euler:{s:1,A:[[0]],b:[1],c:[0]}};return{Gauss:function(g,r){var t=e.Math.eps,h=g.length>0?g[0].length:0,p,s,q,o,m,l=function(u,n){var k=this[u];this[u]=this[n];this[n]=k};if((h!==r.length)||(h!==g.length)){throw new Error("JXG.Math.Numerics.Gauss: Dimensions don't match. A must be a square matrix and b must be of the same length as A.")}p=new Array(h);s=r.slice(0,h);for(q=0;q<h;q++){p[q]=g[q].slice(0,h)}for(o=0;o<h;o++){for(q=h-1;q>o;q--){if(d.abs(p[q][o])>t){if(d.abs(p[o][o])<t){l.apply(p,[q,o]);l.apply(s,[q,o])}else{p[q][o]/=p[o][o];s[q]-=p[q][o]*s[o];for(m=o+1;m<h;m++){p[q][m]-=p[q][o]*p[o][m]}}}}if(d.abs(p[o][o])<t){throw new Error("JXG.Math.Numerics.Gauss(): The given matrix seems to be singular.")}}this.backwardSolve(p,s,true);return s},backwardSolve:function(q,k,p){var h,g,r,o,l;if(p){h=k}else{h=k.slice(0,k.length)}g=q.length;r=q.length>0?q[0].length:0;for(o=g-1;o>=0;o--){for(l=r-1;l>o;l--){h[o]-=q[o][l]*h[l]}h[o]/=q[o][o]}return h},gaussBareiss:function(u){var l,r,x,o,m,g,h,q,v,w=e.Math.eps;h=u.length;if(h<=0){return 0}if(u[0].length<h){h=u[0].length}q=new Array(h);for(o=0;o<h;o++){q[o]=u[o].slice(0,h)}r=1;x=1;for(l=0;l<h-1;l++){g=q[l][l];if(d.abs(g)<w){for(o=0;o<h;o++){if(d.abs(q[o][l])>=w){break}}if(o==h){return 0}for(m=l;m<h;m++){v=q[o][m];q[o][m]=q[l][m];q[l][m]=v}x=-x;g=q[l][l]}for(o=l+1;o<h;o++){for(m=l+1;m<h;m++){v=g*q[o][m]-q[o][l]*q[l][m];q[o][m]=v/r}}r=g}return x*q[h-1][h-1]},det:function(g){return this.gaussBareiss(g)},Jacobi:function(y){var r,p,o,g,s,x,w,z=e.Math.eps,v=0,u,q,l=y.length,m=[[0,0,0],[0,0,0],[0,0,0]],h=[[0,0,0],[0,0,0],[0,0,0]],t=0;for(r=0;r<l;r++){for(p=0;p<l;p++){m[r][p]=0;h[r][p]=y[r][p];v+=d.abs(h[r][p])}m[r][r]=1}if(l==1){return[h,m]}if(v<=0){return[h,m]}v/=(l*l);do{u=0;q=0;for(p=1;p<l;p++){for(r=0;r<p;r++){g=d.abs(h[r][p]);if(g>q){q=g}u+=g;if(g>=z){g=d.atan2(2*h[r][p],h[r][r]-h[p][p])*0.5;s=d.sin(g);x=d.cos(g);for(o=0;o<l;o++){w=h[o][r];h[o][r]=x*w+s*h[o][p];h[o][p]=-s*w+x*h[o][p];w=m[o][r];m[o][r]=x*w+s*m[o][p];m[o][p]=-s*w+x*m[o][p]}h[r][r]=x*h[r][r]+s*h[p][r];h[p][p]=-s*h[r][p]+x*h[p][p];h[r][p]=0;for(o=0;o<l;o++){h[r][o]=h[o][r];h[p][o]=h[o][p]}}}}t++}while(d.abs(u)/v>z&&t<2000);return[h,m]},NewtonCotes:function(g,k,h){var l=0,p=h&&typeof h.number_of_nodes==="number"?h.number_of_nodes:28,n={trapez:true,simpson:true,milne:true},q=h&&h.integration_type&&n.hasOwnProperty(h.integration_type)&&n[h.integration_type]?h.integration_type:"milne",o=(g[1]-g[0])/p,m,j,r;switch(q){case"trapez":l=(k(g[0])+k(g[1]))*0.5;m=g[0];for(j=0;j<p-1;j++){m+=o;l+=k(m)}l*=o;break;case"simpson":if(p%2>0){throw new Error("JSXGraph:  INT_SIMPSON requires config.number_of_nodes dividable by 2.")}r=p/2;l=k(g[0])+k(g[1]);m=g[0];for(j=0;j<r-1;j++){m+=2*o;l+=2*k(m)}m=g[0]-o;for(j=0;j<r;j++){m+=2*o;l+=4*k(m)}l*=o/3;break;default:if(p%4>0){throw new Error("JSXGraph: Error in INT_MILNE: config.number_of_nodes must be a multiple of 4")}r=p*0.25;l=7*(k(g[0])+k(g[1]));m=g[0];for(j=0;j<r-1;j++){m+=4*o;l+=14*k(m)}m=g[0]-3*o;for(j=0;j<r;j++){m+=4*o;l+=32*(k(m)+k(m+2*o))}m=g[0]-2*o;for(j=0;j<r;j++){m+=4*o;l+=12*k(m)}l*=2*o/45}return l},I:function(g,h){return this.NewtonCotes(g,h,{number_of_nodes:16,integration_type:"milne"})},Newton:function(o,g,j){var k=0,m=e.Math.eps,n=o.apply(j,[g]),l=1,p;if(e.isArray(g)){g=g[0]}while(k<50&&d.abs(n)>m){p=this.D(o,j)(g);l+=2;if(d.abs(p)>m){g-=n/p}else{g+=(d.random()*0.2-1)}n=o.apply(j,[g]);l++;k++}return g},root:function(i,g,h){return this.fzero(i,g,h)},Neville:function(k){var h=[],g=function(l){return function(v,m){var o,u,w,x=e.Math.binomial,r=k.length,n=r-1,p=0,q=0;if(!m){w=1;for(o=0;o<r;o++){h[o]=x(n,o)*w;w*=(-1)}}u=v;for(o=0;o<r;o++){if(u===0){return k[o][l]()}else{w=h[o]/u;u--;p+=k[o][l]()*w;q+=w}}return p/q}},j=g("X"),i=g("Y");return[j,i,0,function(){return k.length-1}]},splineDef:function(r,q){var g=d.min(r.length,q.length),j,m,h,o=[],p=[],k=[],u=[],s=[],t=[];if(g===2){return[0,0]}for(m=0;m<g;m++){j={X:r[m],Y:q[m]};k.push(j)}k.sort(function(l,i){return l.X-i.X});for(m=0;m<g;m++){r[m]=k[m].X;q[m]=k[m].Y}for(m=0;m<g-1;m++){u.push(r[m+1]-r[m])}for(m=0;m<g-2;m++){s.push(6*(q[m+2]-q[m+1])/(u[m+1])-6*(q[m+1]-q[m])/(u[m]))}o.push(2*(u[0]+u[1]));p.push(s[0]);for(m=0;m<g-3;m++){h=u[m+1]/o[m];o.push(2*(u[m+1]+u[m+2])-h*u[m+1]);p.push(s[m+1]-h*p[m])}t[g-3]=p[g-3]/o[g-3];for(m=g-4;m>=0;m--){t[m]=(p[m]-(u[m+1]*t[m+1]))/o[m]}for(m=g-3;m>=0;m--){t[m+1]=t[m]}t[0]=0;t[g-1]=0;return t},splineEval:function(h,w,u,A){var k=d.min(w.length,u.length),o=1,m=false,z=[],q,p,v,t,s,r,g;if(e.isArray(h)){o=h.length;m=true}else{h=[h]}for(q=0;q<o;q++){if((h[q]<w[0])||(w[q]>w[k-1])){return NaN}for(p=1;p<k;p++){if(h[q]<=w[p]){break}}p--;v=u[p];t=(u[p+1]-u[p])/(w[p+1]-w[p])-(w[p+1]-w[p])/6*(A[p+1]+2*A[p]);s=A[p]/2;r=(A[p+1]-A[p])/(6*(w[p+1]-w[p]));g=h[q]-w[p];z.push(v+(t+(s+r*g)*g)*g)}if(m){return z}else{return z[0]}},generatePolynomialTerm:function(g,m,h,j){var l=[],k;for(k=m;k>=0;k--){l=l.concat(["(",g[k].toPrecision(j),")"]);if(k>1){l=l.concat(["*",h,"<sup>",k,"<","/sup> + "])}else{if(k===1){l=l.concat(["*",h," + "])}}}return l.join("")},lagrangePolynomial:function(i){var g=[],h=function(v,l){var o,m,r,u,w,p=0,q=0,t,n;r=i.length;if(!l){for(o=0;o<r;o++){g[o]=1;u=i[o].X();for(m=0;m<r;m++){if(m!=o){g[o]*=(u-i[m].X())}}g[o]=1/g[o]}t=[];for(n=0;n<r;n++){t.push([1])}}for(o=0;o<r;o++){u=i[o].X();if(v===u){return i[o].Y()}else{w=g[o]/(v-u);q+=w;p+=w*i[o].Y()}}return p/q};h.getTerm=function(){return""};return h},regressionPolynomial:function(k,o,n){var g,h,m,l,i,p,j="";if(e.isPoint(k)&&typeof k.Value=="function"){h=function(){return k.Value()}}else{if(e.isFunction(k)){h=k}else{if(e.isNumber(k)){h=function(){return k}}else{throw new Error("JSXGraph: Can't create regressionPolynomial from degree of type'"+(typeof k)+"'.")}}}if(arguments.length==3&&e.isArray(o)&&e.isArray(n)){i=0}else{if(arguments.length==2&&e.isArray(o)&&o.length>0&&e.isPoint(o[0])){i=1}else{throw new Error("JSXGraph: Can't create regressionPolynomial. Wrong parameters.")}}p=function(E,q){var u,t,A,w,D,r,C,F,z,v=o.length;z=d.floor(h());if(!q){if(i===1){m=[];l=[];for(u=0;u<v;u++){m[u]=o[u].X();l[u]=o[u].Y()}}if(i===0){m=[];l=[];for(u=0;u<v;u++){if(e.isFunction(o[u])){m.push(o[u]())}else{m.push(o[u])}if(e.isFunction(n[u])){l.push(n[u]())}else{l.push(n[u])}}}A=[];for(t=0;t<v;t++){A.push([1])}for(u=1;u<=z;u++){for(t=0;t<v;t++){A[t][u]=A[t][u-1]*m[t]}}D=l;w=e.Math.transpose(A);r=e.Math.matMatMult(w,A);C=e.Math.matVecMult(w,D);g=e.Math.Numerics.Gauss(r,C);j=e.Math.Numerics.generatePolynomialTerm(g,z,"x",3)}F=g[z];for(u=z-1;u>=0;u--){F=(F*E+g[u])}return F};p.getTerm=function(){return j};return p},bezier:function(i){var g,h=function(j){return function(l,k){var o=d.floor(l)*3,n=l%1,m=1-n;if(!k){g=d.floor(i.length/3)}if(l<0){return i[0][j]()}if(l>=g){return i[i.length-1][j]()}if(isNaN(l)){return NaN}return m*m*(m*i[o][j]()+3*n*i[o+1][j]())+(3*m*i[o+2][j]()+n*i[o+3][j]())*n*n}};return[h("X"),h("Y"),0,function(){return d.floor(i.length/3)}]},bspline:function(j,g){var k,m=[],l=function(r,o){var p,q=[];for(p=0;p<r+o+1;p++){if(p<o){q[p]=0}else{if(p<=r){q[p]=p-o+1}else{q[p]=r-o+2}}}return q},i=function(y,A,o,p,z){var r,q,w,v,x,u=[];if(A[z]<=y&&y<A[z+1]){u[z]=1}else{u[z]=0}for(r=2;r<=p;r++){for(q=z-r+1;q<=z;q++){if(q<=z-r+1||q<0){w=0}else{w=u[q]}if(q>=z){v=0}else{v=u[q+1]}x=A[q+r-1]-A[q];if(x==0){u[q]=0}else{u[q]=(y-A[q])/x*w}x=A[q+r]-A[q+1];if(x!=0){u[q]+=(A[q+r]-y)/x*v}}}return u},h=function(n){return function(u,p){var o=j.length,x,r,v,w=o-1,q=g;if(w<=0){return NaN}if(w+2<=q){q=w+1}if(u<=0){return j[0][n]()}if(u>=w-q+2){return j[w][n]()}k=l(w,q);v=d.floor(u)+q-1;m=i(u,k,w,q,v);x=0;for(r=v-q+1;r<=v;r++){if(r<o&&r>=0){x+=j[r][n]()*m[r]}}return x}};return[h("X"),h("Y"),0,function(){return j.length-1}]},D:function(j,k){var i=0.00001,g=1/(i*2);if(arguments.length==1||(arguments.length>1&&!e.exists(arguments[1]))){return function(h,l){return(j(h+i,l)-j(h-i,l))*g}}else{return function(h,l){return(j.apply(k,[h+i,l])-j.apply(k,[h-i,l]))*g}}},riemann:function(r,m,s,k,o){var l=[],z=[],q,p=0,w,v=k,t,h,u,g;m=d.floor(m);l[p]=v;z[p]=0;if(m>0){w=(o-k)/m;g=w*0.01;for(q=0;q<m;q++){if(s==="right"){t=r(v+w)}else{if(s==="middle"){t=r(v+w*0.5)}else{if((s==="left")||(s==="trapezodial")){t=r(v)}else{if(s==="lower"){t=r(v);for(h=v+g;h<=v+w;h+=g){u=r(h);if(u<t){t=u}}}else{t=r(v);for(h=v+g;h<=v+w;h+=g){u=r(h);if(u>t){t=u}}}}}}p++;l[p]=v;z[p]=t;p++;v+=w;if(s==="trapezodial"){t=r(v)}l[p]=v;z[p]=t;p++;l[p]=v;z[p]=0}}return[l,z]},riemannsum:function(o,k,q,j,l){var p=0,m,u,t=j,r,h,s,g;k=d.floor(k);if(k>0){u=(l-j)/k;g=u*0.01;for(m=0;m<k;m++){if(q==="right"){r=o(t+u)}else{if(q==="middle"){r=o(t+u*0.5)}else{if(q==="trapezodial"){r=0.5*(o(t+u)+o(t))}else{if(q==="left"){r=o(t)}else{if(q==="lower"){r=o(t);for(h=t+g;h<=t+u;h+=g){s=o(h);if(s<r){r=s}}}else{r=o(t);for(h=t+g;h<=t+u;h+=g){s=o(h);if(s>r){r=s}}}}}}}p+=u*r;t+=u}}return p},rungeKutta:function(g,G,o,m,F){var p=[],n=[],E=(o[1]-o[0])/m,u=o[0],H,D,C,A,z,B=G.length,v,q=[],w=0;if(e.isString(g)){g=f[g]||f.euler}v=g.s;for(H=0;H<B;H++){p[H]=G[H]}for(D=0;D<m;D++){q[w]=[];for(H=0;H<B;H++){q[w][H]=p[H]}w++;A=[];for(C=0;C<v;C++){for(H=0;H<B;H++){n[H]=0}for(z=0;z<C;z++){for(H=0;H<B;H++){n[H]+=(g.A[C][z])*E*A[z][H]}}for(H=0;H<B;H++){n[H]+=p[H]}A.push(F(u+g.c[C]*E,n))}for(H=0;H<B;H++){n[H]=0}for(z=0;z<v;z++){for(H=0;H<B;H++){n[H]+=g.b[z]*A[z][H]}}for(H=0;H<B;H++){p[H]=p[H]+E*n[H]}u+=E}return q},maxIterationsRoot:80,maxIterationsMinimize:500,fzero:function(F,G,L){var y=e.Math.eps,g=this.maxIterationsRoot,x=0,A=0,o=y,J,I,H,z,w,v,K,j,C,D,n,h,B,E,t,r,m,l,s,k;if(e.isArray(G)){if(G.length<2){throw new Error("JXG.Math.Numerics.fzero: length of array x0 has to be at least two.")}J=G[0];z=F.apply(L,[J]);A++;I=G[1];w=F.apply(L,[I]);A++}else{J=G;z=F.apply(L,[J]);A++;if(J==0){K=1}else{K=J}j=[0.9*K,1.1*K,K-1,K+1,0.5*K,1.5*K,-K,2*K,-10*K,10*K];D=j.length;for(C=0;C<D;C++){I=j[C];w=F.apply(L,[I]);A++;if(z*w<=0){break}}if(I<J){n=J;J=I;I=n;h=z;z=w;w=h}}if(z*w>0){if(e.isArray(G)){return this.fminbr(F,[J,I],L)}else{return this.Newton(F,J,L)}}H=J;v=z;while(x<g){B=I-J;if(d.abs(v)<d.abs(w)){J=I;I=H;H=J;z=w;w=v;v=z}E=2*o*d.abs(I)+y*0.5;m=(H-I)*0.5;if(d.abs(m)<=E&&d.abs(w)<=o){return I}if(d.abs(B)>=E&&d.abs(z)>d.abs(w)){s=H-I;if(J==H){l=w/z;t=s*l;r=1-l}else{r=z/v;l=w/v;k=w/z;t=k*(s*r*(r-l)-(I-J)*(l-1));r=(r-1)*(l-1)*(k-1)}if(t>0){r=-r}else{t=-t}if(t<(0.75*s*r-d.abs(E*r)*0.5)&&t<d.abs(B*r*0.5)){m=t/r}}if(d.abs(m)<E){if(m>0){m=E}else{m=-E}}J=I;z=w;I+=m;w=F.apply(L,[I]);A++;if((w>0&&v>0)||(w<0&&v<0)){H=J;v=z}x++}return I},fminbr:function(G,H,L){var K,I,l,o,n,h,j,i,y=(3-d.sqrt(5))*0.5,D=e.Math.eps,A=d.sqrt(e.Math.eps),g=this.maxIterationsMinimize,C=0,u,J,F,m,B,z,s,k,E=0;if(!e.isArray(H)||H.length<2){throw new Error("JXG.Math.Numerics.fminbr: length of array x0 has to be at least two.")}K=H[0];I=H[1];o=K+y*(I-K);j=G.apply(L,[o]);E++;l=o;n=o;h=j;i=j;while(C<g){u=I-K;J=(K+I)*0.5;F=A*d.abs(l)+D/3;if(d.abs(l-J)+u*0.5<=2*F){return l}m=y*(l<J?I-l:K-l);if(d.abs(l-n)>=F){s=(l-n)*(h-j);z=(l-o)*(h-i);B=(l-o)*z-(l-n)*s;z=2*(z-s);if(z>0){B=-B}else{z=-z}if(d.abs(B)<d.abs(m*z)&&B>z*(K-l+2*F)&&B<z*(I-l-2*F)){m=B/z}}if(d.abs(m)<F){if(m>0){m=F}else{m=-F}}s=l+m;k=G.apply(L,[s]);E++;if(k<=h){if(s<l){I=l}else{K=l}o=n;n=l;l=s;j=i;i=h;h=k}else{if(s<l){K=s}else{I=s}if(k<=i||n==l){o=n;n=s;j=i;i=k}else{if(k<=j||o==l||o==n){o=s;j=k}}}C++}return l},reuleauxPolygon:function(i,j){var m=d.PI*2,h=m/j,l=(j-1)/2,k,n=0,g=function(p,o){return function(r,u){if(!u){n=i[0].Dist(i[l]);k=e.Math.Geometry.rad([i[0].X()+1,i[0].Y()],i[0],i[(l)%j])}var s=(r%m+m)%m;var q=d.floor(s/h)%j;if(isNaN(q)){return q}s=s*0.5+q*h*0.5+k;return i[q][p]()+n*d[o](s)}};return[g("X","cos"),g("Y","sin"),0,d.PI*2]},RamerDouglasPeuker:function(p,h){var m=[],o,l,g,j=function(u,t,s,q,r){var k=n(u,t,s);if(k[0]>q){j(u,t,k[1],q,r);j(u,k[1],s,q,r)}else{r.push(u[s])}},n=function(E,v,u){var y=0,w=v,x,t,F,D,C,s,B,r,z,A,q;if(u-v<2){return[-1,0]}F=E[v].scrCoords;D=E[u].scrCoords;if(isNaN(F[1]+F[2]+D[1]+D[2])){return[NaN,u]}for(t=v+1;t<u;t++){C=E[t].scrCoords;s=C[1]-F[1];B=C[2]-F[2];r=D[1]-F[1];z=D[2]-F[2];A=r*r+z*z;if(A>=e.Math.eps){q=(s*r+B*z)/A;if(q<0){q=0}else{if(q>1){q=1}}s=s-q*r;B=B-q*z;x=s*s+B*B}else{q=0;x=s*s+B*B}if(x>y){y=x;w=t}}return[d.sqrt(y),w]};g=p.length;o=0;while(o<g&&isNaN(p[o].scrCoords[1]+p[o].scrCoords[2])){o++}l=g-1;while(l>o&&isNaN(p[l].scrCoords[1]+p[l].scrCoords[2])){l--}if(!(o>l||o==g)){m[0]=p[o];j(p,o,l,h,m)}return m}}})(JXG,Math);JXG.Math.Statistics={sum:function(e){var g,d=e.length,f=0;for(g=0;g<d;g++){f+=e[g]}return f},prod:function(e){var g,d=e.length,f=1;for(g=0;g<d;g++){f*=e[g]}return f},mean:function(d){if(d.length>0){return this.sum(d)/d.length}else{return 0}},median:function(e){var f,d;if(e.length>0){f=e.slice(0);f.sort(function(h,g){return h-g});d=f.length;if(d%2==1){return f[parseInt(d*0.5)]}else{return(f[d*0.5-1]+f[d*0.5])*0.5}}else{return 0}},variance:function(f){var e,h,g,d=f.length;if(d>1){e=this.mean(f);h=0;for(g=0;g<d;g++){h+=(f[g]-e)*(f[g]-e)}return h/(f.length-1)}else{return 0}},sd:function(d){return Math.sqrt(this.variance(d))},weightedMean:function(d,e){if(d.length!=e.length){throw new Error("JSXGraph error (Math.Statistics.weightedMean): Array dimension mismatch.")}if(d.length>0){return this.mean(this.multiply(d,e))}else{return 0}},max:function(d){return Math.max.apply(this,d)},min:function(d){return Math.min.apply(this,d)},range:function(d){return[this.min(d),this.max(d)]},abs:function(e){var g,d,f;if(JXG.isArray(e)){d=e.length;f=[];for(g=0;g<d;g++){f[g]=Math.abs(e[g])}}else{if(JXG.isNumber(e)){f=Math.abs(e)}else{throw new Error("JSXGraph Error (Math.Statistics.abs): Invalid input.")}}return f},add:function(f,e){var h,d,g=[];if(JXG.isArray(f)&&JXG.isNumber(e)){d=f.length;for(h=0;h<d;h++){g[h]=f[h]+e}}else{if(JXG.isNumber(f)&&JXG.isArray(e)){d=e.length;for(h=0;h<d;h++){g[h]=f+e[h]}}else{if(JXG.isArray(f)&&JXG.isArray(e)){d=Math.min(f.length,e.length);for(h=0;h<d;h++){g[h]=f[h]+e[h]}}else{if(JXG.isNumber(f)&&JXG.isNumber(e)){g=f+e}else{throw new Error("JSXGraph Error (Math.Statistics.add): Invalid input.")}}}}return g},div:function(f,e){var h,d,g=[];if(JXG.isArray(f)&&JXG.isNumber(e)){d=f.length;for(h=0;h<d;h++){g[h]=f[h]/e}}else{if(JXG.isNumber(f)&&JXG.isArray(e)){d=e.length;for(h=0;h<d;h++){g[h]=f/e[h]}}else{if(JXG.isArray(f)&&JXG.isArray(e)){d=Math.min(f.length,e.length);for(h=0;h<d;h++){g[h]=f[h]/e[h]}}else{if(JXG.isNumber(f)&&JXG.isNumber(e)){g=f/e}else{throw new Error("JSXGraph Error (Math.Statistics.div): Invalid input.")}}}}return g},divide:JXG.shortcut(JXG.Math.Statistics,"div"),mod:function(f,e){var h,d,g=[];if(JXG.isArray(f)&&JXG.isNumber(e)){d=f.length;for(h=0;h<d;h++){g[h]=f[h]%e}}else{if(JXG.isNumber(f)&&JXG.isArray(e)){d=e.length;for(h=0;h<d;h++){g[h]=f%e[h]}}else{if(JXG.isArray(f)&&JXG.isArray(e)){d=Math.min(f.length,e.length);for(h=0;h<d;h++){g[h]=f[h]%e[h]}}else{if(JXG.isNumber(f)&&JXG.isNumber(e)){g=f%e}else{throw new Error("JSXGraph Error (Math.Statistics.mod): Invalid input.")}}}}return g},multiply:function(f,e){var h,d,g=[];if(JXG.isArray(f)&&JXG.isNumber(e)){d=f.length;for(h=0;h<d;h++){g[h]=f[h]*e}}else{if(JXG.isNumber(f)&&JXG.isArray(e)){d=e.length;for(h=0;h<d;h++){g[h]=f*e[h]}}else{if(JXG.isArray(f)&&JXG.isArray(e)){d=Math.min(f.length,e.length);for(h=0;h<d;h++){g[h]=f[h]*e[h]}}else{if(JXG.isNumber(f)&&JXG.isNumber(e)){g=f*e}else{throw new Error("JSXGraph Error (Math.Statistics.mod): Invalid input.")}}}}return g},subtract:function(f,e){var h,d,g=[];if(JXG.isArray(f)&&JXG.isNumber(e)){d=f.length;for(h=0;h<d;h++){g[h]=f[h]-e}}else{if(JXG.isNumber(f)&&JXG.isArray(e)){d=e.length;for(h=0;h<d;h++){g[h]=f-e[h]}}else{if(JXG.isArray(f)&&JXG.isArray(e)){d=Math.min(f.length,e.length);for(h=0;h<d;h++){g[h]=f[h]-e[h]}}else{if(JXG.isNumber(f)&&JXG.isNumber(e)){g=f-e}else{throw new Error("JSXGraph Error (Math.Statistics.mod): Invalid input.")}}}}return g}};JXG.Math.Symbolic=function(d,e){return{generateSymbolicCoordinatesPartial:function(o,j,i,g){var f=function(k){var q;if(g==="underscore"){q=""+i+"_{"+k+"}"}else{if(g=="brace"){q=""+i+"["+k+"]"}else{q=""+i+""+k}}return q},m=j.ancestors,l=0,n,p,h;o.listOfFreePoints=[];o.listOfDependantPoints=[];for(p in m){n=0;if(d.isPoint(m[p])){for(h in m[p].ancestors){n++}if(n===0){m[p].symbolic.x=m[p].coords.usrCoords[1];m[p].symbolic.y=m[p].coords.usrCoords[2];o.listOfFreePoints.push(m[p])}else{l++;m[p].symbolic.x=f(l);l++;m[p].symbolic.y=f(l);o.listOfDependantPoints.push(m[p])}}}if(d.isPoint(j)){j.symbolic.x="x";j.symbolic.y="y"}return l},clearSymbolicCoordinates:function(g){var f=function(j){var i,h=(j&&j.length)||0;for(i=0;i<h;i++){if(d.isPoint(j[i])){j[i].symbolic.x="";j[i].symbolic.y=""}}};f(g.listOfFreePoints);f(g.listOfDependantPoints);delete (g.listOfFreePoints);delete (g.listOfDependantPoints)},generatePolynomials:function(n,h,j){var m=h.ancestors,o,l=[],q=[],p,f,g;if(j){this.generateSymbolicCoordinatesPartial(n,h,"u","brace")}m[h.id]=h;for(p in m){o=0;l=[];if(d.isPoint(m[p])){for(f in m[p].ancestors){o++}if(o>0){l=m[p].generatePolynomial();for(g=0;g<l.length;g++){q.push(l[g])}}}}if(j){this.clearSymbolicCoordinates(n)}return q},geometricLocusByGroebnerBase:function(n,z){var l=this.generateSymbolicCoordinatesPartial(n,z,"u","brace"),m,h,q,f={},v=new d.Coords(d.COORDS_BY_USR,[0,0],n),t=new d.Coords(d.COORDS_BY_USR,[n.canvasWidth,n.canvasHeight],n),k,j,C,F=1,u=0,r=0,o=0,D,w,E,p,y,A,g,B=function(G,H){var s;for(s=0;s<H.length;s++){if(H[s].id===G){return true}}return false},x=n.options.locus;if(d.Server.modules.geoloci===e){d.Server.loadModule("geoloci")}if(d.Server.modules.geoloci===e){throw new Error("JSXGraph: Unable to load JXG.Server module 'geoloci.py'.")}p=v.usrCoords[1];y=t.usrCoords[1];A=t.usrCoords[2];g=v.usrCoords[2];if(x.translateToOrigin&&(n.listOfFreePoints.length>0)){if((x.toOrigin!==e)&&(x.toOrigin!=null)&&B(x.toOrigin.id,n.listOfFreePoints)){k=x.toOrigin}else{k=n.listOfFreePoints[0]}u=k.symbolic.x;r=k.symbolic.y;for(C=0;C<n.listOfFreePoints.length;C++){n.listOfFreePoints[C].symbolic.x-=u;n.listOfFreePoints[C].symbolic.y-=r}p-=u;y-=u;A-=r;g-=r;if(x.translateTo10&&(n.listOfFreePoints.length>1)){if((x.to10!==e)&&(x.to10!=null)&&(x.to10.id!=x.toOrigin.id)&&B(x.to10.id,n.listOfFreePoints)){j=x.to10}else{if(n.listOfFreePoints[0].id==k.id){j=n.listOfFreePoints[1]}else{j=n.listOfFreePoints[0]}}o=d.Math.Geometry.rad([1,0],[0,0],[j.symbolic.x,j.symbolic.y]);D=Math.cos(-o);w=Math.sin(-o);for(C=0;C<n.listOfFreePoints.length;C++){E=n.listOfFreePoints[C].symbolic.x;n.listOfFreePoints[C].symbolic.x=D*n.listOfFreePoints[C].symbolic.x-w*n.listOfFreePoints[C].symbolic.y;n.listOfFreePoints[C].symbolic.y=w*E+D*n.listOfFreePoints[C].symbolic.y}j.symbolic.y=0;E=p;p=D*p-w*A;A=w*E+D*A;E=y;y=D*y-w*g;g=w*E+D*g;if(x.stretch&&(Math.abs(j.symbolic.x)>d.Math.eps)){F=j.symbolic.x;for(C=0;C<n.listOfFreePoints.length;C++){n.listOfFreePoints[C].symbolic.x/=F;n.listOfFreePoints[C].symbolic.y/=F}for(C in n.objects){if((n.objects[C].elementClass==d.OBJECT_CLASS_CIRCLE)&&(n.objects[C].method=="pointRadius")){f[C]=n.objects[C].radius;n.objects[C].radius/=F}}p/=F;y/=F;A/=F;g/=F;j.symbolic.x=1}}for(C=0;C<n.listOfFreePoints.length;C++){E=n.listOfFreePoints[C].symbolic.x;if(Math.abs(E)<d.Math.eps){n.listOfFreePoints[C].symbolic.x=0}if(Math.abs(E-Math.round(E))<d.Math.eps){n.listOfFreePoints[C].symbolic.x=Math.round(E)}E=n.listOfFreePoints[C].symbolic.y;if(Math.abs(E)<d.Math.eps){n.listOfFreePoints[C].symbolic.y=0}if(Math.abs(E-Math.round(E))<d.Math.eps){n.listOfFreePoints[C].symbolic.y=Math.round(E)}}}m=this.generatePolynomials(n,z);h=m.join(",");this.cbp=function(i){q=i};this.cb=d.bind(this.cbp,this);d.Server.modules.geoloci.lociCoCoA(p,y,A,g,l,h,F,o,u,r,this.cb,true);this.clearSymbolicCoordinates(n);for(C in f){n.objects[C].radius=f[C]}return q}}}(JXG);JXG.Math.Geometry={angle:function(f,e,d){var i=[],h=[],g=[],k,j,m,l;if(f.coords==null){i[0]=f[0];i[1]=f[1]}else{i[0]=f.coords.usrCoords[1];i[1]=f.coords.usrCoords[2]}if(e.coords==null){h[0]=e[0];h[1]=e[1]}else{h[0]=e.coords.usrCoords[1];h[1]=e.coords.usrCoords[2]}if(d.coords==null){g[0]=d[0];g[1]=d[1]}else{g[0]=d.coords.usrCoords[1];g[1]=d.coords.usrCoords[2]}k=i[0]-h[0];j=i[1]-h[1];m=g[0]-h[0];l=g[1]-h[1];return Math.atan2(k*l-j*m,k*m+j*l)},trueAngle:function(d,f,e){return this.rad(d,f,e)*57.29577951308232},rad:function(g,f,e){var d,m,l,k,i,h,j;if(g.coords==null){d=g[0];m=g[1]}else{d=g.coords.usrCoords[1];m=g.coords.usrCoords[2]}if(f.coords==null){l=f[0];k=f[1]}else{l=f.coords.usrCoords[1];k=f.coords.usrCoords[2]}if(e.coords==null){i=e[0];h=e[1]}else{i=e.coords.usrCoords[1];h=e.coords.usrCoords[2]}j=Math.atan2(h-k,i-l)-Math.atan2(m-k,d-l);if(j<0){j+=6.283185307179586}return j},angleBisector:function(i,h,f,l){var g=i.coords.usrCoords,o=h.coords.usrCoords,j=f.coords.usrCoords,p=g[1]-o[1],n=g[2]-o[2],m=Math.sqrt(p*p+n*n),e,q,k;if(!JXG.exists(l)){l=i.board}p/=m;n/=m;e=Math.acos(p);if(n<0){e*=-1}if(e<0){e+=2*Math.PI}p=j[1]-o[1];n=j[2]-o[2];m=Math.sqrt(p*p+n*n);p/=m;n/=m;q=Math.acos(p);if(n<0){q*=-1}if(q<0){q+=2*Math.PI}k=(e+q)*0.5;if(e>q){k+=Math.PI}p=Math.cos(k)+o[1];n=Math.sin(k)+o[2];return new JXG.Coords(JXG.COORDS_BY_USER,[p,n],l)},reflection:function(o,l,f){var h=l.coords.usrCoords,p=o.point1.coords.usrCoords,g=o.point2.coords.usrCoords,e,k,d,i,m,j,n;if(!JXG.exists(f)){f=l.board}m=g[1]-p[1];j=g[2]-p[2];e=h[1]-p[1];k=h[2]-p[2];n=(m*k-j*e)/(m*m+j*j);d=h[1]+2*n*j;i=h[2]-2*n*m;return new JXG.Coords(JXG.COORDS_BY_USER,[d,i],f)},rotation:function(d,n,h,i){var k=n.coords.usrCoords,e=d.coords.usrCoords,g,m,j,o,f,l;if(!JXG.exists(i)){i=n.board}g=k[1]-e[1];m=k[2]-e[2];j=Math.cos(h);o=Math.sin(h);f=g*j-m*o+e[1];l=g*o+m*j+e[2];return new JXG.Coords(JXG.COORDS_BY_USER,[f,l],i)},perpendicular:function(q,o,i){var h=q.point1.coords.usrCoords,g=q.point2.coords.usrCoords,e=o.coords.usrCoords,m,l,k,p,j,f,d,n;if(!JXG.exists(i)){i=o.board}if(o==q.point1){m=h[1]+g[2]-h[2];l=h[2]-g[1]+h[1];k=true}else{if(o==q.point2){m=g[1]+h[2]-g[2];l=g[2]-h[1]+g[1];k=false}else{if(((Math.abs(h[1]-g[1])>JXG.Math.eps)&&(Math.abs(e[2]-(h[2]-g[2])*(e[1]-h[1])/(h[1]-g[1])-h[2])<JXG.Math.eps))||((Math.abs(h[1]-g[1])<=JXG.Math.eps)&&(Math.abs(h[1]-e[1])<JXG.Math.eps))){m=e[1]+g[2]-e[2];l=e[2]-g[1]+e[1];k=true;if(Math.abs(m-e[1])<JXG.Math.eps&&Math.abs(l-e[2])<JXG.Math.eps){m=e[1]+h[2]-e[2];l=e[2]-h[1]+e[1];k=false}}else{p=h[2]-g[2];j=h[1]-g[1];f=g[1]*p-g[2]*j;d=e[1]*j+e[2]*p;n=p*p+j*j;if(Math.abs(n)<JXG.Math.eps){n=JXG.Math.eps}m=(f*p+d*j)/n;l=(d*p-f*j)/n;k=true}}}return[new JXG.Coords(JXG.COORDS_BY_USER,[m,l],i),k]},circumcenterMidpoint:function(k,i,h,g){var f=k.coords.usrCoords,e=i.coords.usrCoords,d=h.coords.usrCoords,o,n,m,l,j;if(!JXG.exists(g)){g=k.board}o=((f[1]-e[1])*(f[1]+e[1])+(f[2]-e[2])*(f[2]+e[2]))*0.5;n=((e[1]-d[1])*(e[1]+d[1])+(e[2]-d[2])*(e[2]+d[2]))*0.5;m=(f[1]-e[1])*(e[2]-d[2])-(e[1]-d[1])*(f[2]-e[2]);if(Math.abs(m)<JXG.Math.eps){m=JXG.Math.eps}l=(o*(e[2]-d[2])-n*(f[2]-e[2]))/m;j=(n*(f[1]-e[1])-o*(e[1]-d[1]))/m;return new JXG.Coords(JXG.COORDS_BY_USER,[l,j],g)},distance:function(h,g){var f=0,e,d;if(h.length!=g.length){return NaN}d=h.length;for(e=0;e<d;e++){f+=(h[e]-g[e])*(h[e]-g[e])}return Math.sqrt(f)},affineDistance:function(f,e){var g;if(f.length!=e.length){return NaN}g=this.distance(f,e);if(g>JXG.Math.eps&&(Math.abs(f[0])<JXG.Math.eps||Math.abs(e[0])<JXG.Math.eps)){return Infinity}else{return g}},calcStraight:function(g,p,o){var e,d,m,k,q,f,n,u,l,h,t,r;q=g.visProp.straightfirst;f=g.visProp.straightlast;if(Math.abs(p.scrCoords[0])<JXG.Math.eps){q=true}if(Math.abs(o.scrCoords[0])<JXG.Math.eps){f=true}if(!q&&!f){return}n=[];n[0]=g.stdform[0]-g.stdform[1]*g.board.origin.scrCoords[1]/g.board.unitX+g.stdform[2]*g.board.origin.scrCoords[2]/g.board.unitY;n[1]=g.stdform[1]/g.board.unitX;n[2]=g.stdform[2]/(-g.board.unitY);if(isNaN(n[0]+n[1]+n[2])){return}u=[];u[0]=JXG.Math.crossProduct(n,[0,0,1]);u[1]=JXG.Math.crossProduct(n,[0,1,0]);u[2]=JXG.Math.crossProduct(n,[-g.board.canvasHeight,0,1]);u[3]=JXG.Math.crossProduct(n,[-g.board.canvasWidth,1,0]);for(l=0;l<4;l++){if(Math.abs(u[l][0])>JXG.Math.eps){for(h=2;h>0;h--){u[l][h]/=u[l][0]}u[l][0]=1}}e=false;d=false;if(!q&&p.scrCoords[1]>=0&&p.scrCoords[1]<=g.board.canvasWidth&&p.scrCoords[2]>=0&&p.scrCoords[2]<=g.board.canvasHeight){e=true}if(!f&&o.scrCoords[1]>=0&&o.scrCoords[1]<=g.board.canvasWidth&&o.scrCoords[2]>=0&&o.scrCoords[2]<=g.board.canvasHeight){d=true}if(Math.abs(u[1][0])<JXG.Math.eps){m=u[0];k=u[2]}else{if(Math.abs(u[0][0])<JXG.Math.eps){m=u[1];k=u[3]}else{if(u[1][2]<0){m=u[0];if(u[3][2]>g.board.canvasHeight){k=u[2]}else{k=u[3]}}else{if(u[1][2]>g.board.canvasHeight){m=u[2];if(u[3][2]<0){k=u[0]}else{k=u[3]}}else{m=u[1];if(u[3][2]<0){k=u[0]}else{if(u[3][2]>g.board.canvasHeight){k=u[2]}else{k=u[3]}}}}}}m=new JXG.Coords(JXG.COORDS_BY_SCREEN,m.slice(1),g.board);k=new JXG.Coords(JXG.COORDS_BY_SCREEN,k.slice(1),g.board);if(!e&&!d){if(!q&&f&&!this.isSameDirection(p,o,m)&&!this.isSameDirection(p,o,k)){return}else{if(q&&!f&&!this.isSameDirection(o,p,m)&&!this.isSameDirection(o,p,k)){return}}}if(!e){if(!d){if(this.isSameDir(p,o,m,k)){t=m;r=k}else{r=m;t=k}}else{if(this.isSameDir(p,o,m,k)){t=m}else{t=k}}}else{if(!d){if(this.isSameDir(p,o,m,k)){r=k}else{r=m}}}if(t){p.setCoordinates(JXG.COORDS_BY_USER,t.usrCoords.slice(1))}if(r){o.setCoordinates(JXG.COORDS_BY_USER,r.usrCoords.slice(1))}},isSameDir:function(j,i,f,e){var d=i.usrCoords[1]-j.usrCoords[1],k=i.usrCoords[2]-j.usrCoords[2],h=e.usrCoords[1]-f.usrCoords[1],g=e.usrCoords[2]-f.usrCoords[2];if(d*h+k*g>=0){return true}else{return false}},isSameDirection:function(k,h,f){var e,d,j,i,g=false;e=h.usrCoords[1]-k.usrCoords[1];d=h.usrCoords[2]-k.usrCoords[2];j=f.usrCoords[1]-k.usrCoords[1];i=f.usrCoords[2]-k.usrCoords[2];if(Math.abs(e)<JXG.Math.eps){e=0}if(Math.abs(d)<JXG.Math.eps){d=0}if(Math.abs(j)<JXG.Math.eps){j=0}if(Math.abs(i)<JXG.Math.eps){i=0}if(e>=0&&j>=0){if((d>=0&&i>=0)||(d<=0&&i<=0)){g=true}}else{if(e<=0&&j<=0){if((d>=0&&i>=0)||(d<=0&&i<=0)){g=true}}}return g},intersectLineLine:function(o,n,j){var i=o.point1.coords.usrCoords,g=o.point2.coords.usrCoords,f=n.point1.coords.usrCoords,d=n.point2.coords.usrCoords,h,e,m,l,k;if(!JXG.exists(j)){j=o.board}h=i[1]*g[2]-i[2]*g[1];e=f[1]*d[2]-f[2]*d[1];m=(g[2]-i[2])*(f[1]-d[1])-(i[1]-g[1])*(d[2]-f[2]);if(Math.abs(m)<JXG.Math.eps){m=JXG.Math.eps}l=(h*(f[1]-d[1])-e*(i[1]-g[1]))/m;k=(e*(g[2]-i[2])-h*(d[2]-f[2]))/m;return new JXG.Coords(JXG.COORDS_BY_USER,[l,k],j)},intersectCircleLine:function(k,u,m){var J=u.point1.coords.usrCoords,H=u.point2.coords.usrCoords,g=k.midpoint.coords.usrCoords,B,e,I,G,z,E,C,n,A,v,j,i,D,q,o,f,t,p,F;if(!JXG.exists(m)){m=u.board}B=u.point1.Dist(u.point2);if(B>0){e=k.midpoint.Dist(u.point1);I=k.midpoint.Dist(u.point2);G=((e*e)+(B*B)-(I*I))/(2*B);z=(e*e)-(G*G);z=(z<0)?0:z;E=Math.sqrt(z);C=k.Radius();n=Math.sqrt((C*C)-E*E);A=H[1]-J[1];v=H[2]-J[2];j=g[1]+(E/B)*v;i=g[2]-(E/B)*A;e=(H[1]*v)-(H[2]*A);I=(j*A)+(i*v);D=(v*v)+(A*A);if(Math.abs(D)<JXG.Math.eps){D=JXG.Math.eps}q=((e*v)+(I*A))/D;o=((I*v)-(e*A))/D;f=n/B;t=new JXG.Coords(JXG.COORDS_BY_USER,[q+f*A,o+f*v],m);p=new JXG.Coords(JXG.COORDS_BY_USER,[q-f*A,o-f*v],m);F=k.midpoint.coords.distance(JXG.COORDS_BY_USER,t);if((C<(F-1))||isNaN(F)){return[0]}else{return[2,t,p]}}return[0]},intersectCircleCircle:function(l,k,n){var e={},i=l.Radius(),g=k.Radius(),f=l.midpoint.coords.usrCoords,d=k.midpoint.coords.usrCoords,p,j,t,r,q,o,m;if(!JXG.exists(n)){n=l.board}p=i+g;j=Math.abs(i-g);t=l.midpoint.coords.distance(JXG.COORDS_BY_USER,k.midpoint.coords);if(t>p){return[0]}else{if(t<j){return[0]}else{if(t!=0){e[0]=1;r=d[1]-f[1];q=d[2]-f[2];o=(t*t-g*g+i*i)/(2*t);m=Math.sqrt(i*i-o*o);e[1]=new JXG.Coords(JXG.COORDS_BY_USER,[f[1]+(o/t)*r+(m/t)*q,f[2]+(o/t)*q-(m/t)*r],n);e[2]=new JXG.Coords(JXG.COORDS_BY_USER,[f[1]+(o/t)*r-(m/t)*q,f[2]+(o/t)*q+(m/t)*r],n)}else{return[0]}return e}}},meet:function(g,e,f,h){var d=JXG.Math.eps;if(Math.abs(g[3])<d&&Math.abs(e[3])<d){return this.meetLineLine(g,e,f,h)}else{if(Math.abs(g[3])>=d&&Math.abs(e[3])<d){return this.meetLineCircle(e,g,f,h)}else{if(Math.abs(g[3])<d&&Math.abs(e[3])>=d){return this.meetLineCircle(g,e,f,h)}else{return this.meetCircleCircle(g,e,f,h)}}}},meetLineLine:function(e,d,f,h){var g=JXG.Math.crossProduct(e,d);if(Math.abs(g[0])>JXG.Math.eps){g[1]/=g[0];g[2]/=g[0];g[0]=1}return new JXG.Coords(JXG.COORDS_BY_USER,g,h)},meetLineCircle:function(j,e,o,p){var u,s,r,q,l,h,g,f,m,v;if(e[4]<JXG.Math.eps){return new JXG.Coords(JXG.COORDS_BY_USER,e.slice(6,8),p)}r=e[0];s=e.slice(1,3);u=e[3];q=j[0];l=j.slice(1,3);h=u;g=(s[0]*l[1]-s[1]*l[0]);f=u*q*q-(s[0]*l[0]+s[1]*l[1])*q+r;m=g*g-4*h*f;if(m>=0){m=Math.sqrt(m);v=[(-g+m)/(2*h),(-g-m)/(2*h)];return((o==0)?new JXG.Coords(JXG.COORDS_BY_USER,[-v[0]*(-l[1])-q*l[0],-v[0]*l[0]-q*l[1]],p):new JXG.Coords(JXG.COORDS_BY_USER,[-v[1]*(-l[1])-q*l[0],-v[1]*l[0]-q*l[1]],p))}else{return new JXG.Coords(JXG.COORDS_BY_USER,[0,0,0],p)}},meetCircleCircle:function(f,d,e,g){var h;if(f[4]<JXG.Math.eps){if(Math.abs(this.distance(f.slice(6,2),d.slice(6,8))-d[4])<JXG.Math.eps){return new JXG.Coords(JXG.COORDS_BY_USER,f.slice(6,8),g)}else{return new JXG.Coords(JXG.COORDS_BY_USER,[0,0,0],g)}}if(d[4]<JXG.Math.eps){if(Math.abs(this.distance(d.slice(6,2),f.slice(6,8))-f[4])<JXG.Math.eps){return new JXG.Coords(JXG.COORDS_BY_USER,d.slice(6,8),g)}else{return new JXG.Coords(JXG.COORDS_BY_USER,[0,0,0],g)}}h=[d[3]*f[0]-f[3]*d[0],d[3]*f[1]-f[3]*d[1],d[3]*f[2]-f[3]*d[2],0,1,Infinity,Infinity,Infinity];h=JXG.Math.normalize(h);return this.meetLineCircle(h,f,e,g)},meetCurveCurve:function(r,q,h,k,m){var l=0,o,n,z,x,v,u,g,t,s,p,y,w,j,i;if(!JXG.exists(m)){m=r.board}if(arguments.callee.t1memo){o=arguments.callee.t1memo;n=arguments.callee.t2memo}else{o=h;n=k}t=r.X(o)-q.X(n);s=r.Y(o)-q.Y(n);p=t*t+s*s;y=r.board.D(r.X,r);w=q.board.D(q.X,q);j=r.board.D(r.Y,r);i=q.board.D(q.Y,q);while(p>JXG.Math.eps&&l<10){z=y(o);x=-w(n);v=j(o);u=-i(n);g=z*u-x*v;o-=(u*t-x*s)/g;n-=(z*s-v*t)/g;t=r.X(o)-q.X(n);s=r.Y(o)-q.Y(n);p=t*t+s*s;l++}arguments.callee.t1memo=o;arguments.callee.t2memo=n;if(Math.abs(o)<Math.abs(n)){return(new JXG.Coords(JXG.COORDS_BY_USER,[r.X(o),r.Y(o)],m))}else{return(new JXG.Coords(JXG.COORDS_BY_USER,[q.X(n),q.Y(n)],m))}},meetCurveLine:function(r,q,e,j){var o,l,s,g,p,h,k,w,u,v,n,m,f,d;if(!JXG.exists(j)){j=r.board}for(s=0;s<=1;s++){if(arguments[s].elementClass==JXG.OBJECT_CLASS_CURVE){g=arguments[s]}else{if(arguments[s].elementClass==JXG.OBJECT_CLASS_LINE){p=arguments[s]}else{throw new Error("JSXGraph: Can't call meetCurveLine with parent class "+(arguments[s].elementClass)+".")}}}h=function(i){return p.stdform[0]+p.stdform[1]*g.X(i)+p.stdform[2]*g.Y(i)};if(arguments.callee.t1memo){n=arguments.callee.t1memo;o=JXG.Math.Numerics.root(h,n)}else{n=g.minX();m=g.maxX();o=JXG.Math.Numerics.root(h,[n,m])}arguments.callee.t1memo=o;f=g.X(o);d=g.Y(o);if(e==1){if(arguments.callee.t2memo){n=arguments.callee.t2memo;l=JXG.Math.Numerics.root(h,n)}if(!(Math.abs(l-o)>0.1&&Math.abs(f-g.X(l))>0.1&&Math.abs(d-g.Y(l))>0.1)){u=20;v=(g.maxX()-g.minX())/u;w=g.minX();for(s=0;s<u;s++){l=JXG.Math.Numerics.root(h,[w,w+v]);if(Math.abs(l-o)>0.1&&Math.abs(f-g.X(l))>0.1&&Math.abs(d-g.Y(l))>0.1){break}w+=v}}o=l;arguments.callee.t2memo=o}if(Math.abs(h(o))>JXG.Math.eps){k=0}else{k=1}return(new JXG.Coords(JXG.COORDS_BY_USER,[k,g.X(o),g.Y(o)],j))},projectPointToCircle:function(l,d,f){var i=l.coords.distance(JXG.COORDS_BY_USER,d.midpoint.coords),e=l.coords.usrCoords,g=d.midpoint.coords.usrCoords,k,j,h;if(!JXG.exists(f)){f=l.board}if(Math.abs(i)<JXG.Math.eps){i=JXG.Math.eps}h=d.Radius()/i;k=g[1]+h*(e[1]-g[1]);j=g[2]+h*(e[2]-g[2]);return new JXG.Coords(JXG.COORDS_BY_USER,[k,j],f)},projectPointToLine:function(d,e,g){var f=[0,e.stdform[1],e.stdform[2]];if(!JXG.exists(g)){g=d.board}f=JXG.Math.crossProduct(f,d.coords.usrCoords);return this.meetLineLine(f,e.stdform,0,g)},projectPointToCurve:function(f,i,h){if(!JXG.exists(h)){h=f.board}var e=f.X(),j=f.Y(),g=f.position||0,d=this.projectCoordsToCurve(e,j,g,i,h);f.position=d[1];return d[0]},projectCoordsToCurve:function(n,l,p,q,h){var B,z,e,w,d,k,u,A,r,g,s,o=1000000,m,E,C,f,D,v;if(!JXG.exists(h)){h=q.board}if(q.visProp.curvetype=="parameter"||q.visProp.curvetype=="polar"){m=function(x){var j=n-q.X(x),i=l-q.Y(x);return j*j+i*i};f=m(p);v=20;D=(q.maxX()-q.minX())/v;E=q.minX();for(s=0;s<v;s++){C=m(E);if(C<f){p=E;f=C}E+=D}p=JXG.Math.Numerics.root(JXG.Math.Numerics.D(m),p);if(p<q.minX()){p=q.maxX()+p-q.minX()}if(p>q.maxX()){p=q.minX()+p-q.maxX()}B=new JXG.Coords(JXG.COORDS_BY_USER,[q.X(p),q.Y(p)],h)}else{if(q.visProp.curvetype=="plot"){A=o;for(u=0;u<q.numberPoints;u++){z=n-q.X(u);e=l-q.Y(u);r=Math.sqrt(z*z+e*e);if(r<A){A=r;p=u}if(u==q.numberPoints-1){continue}w=q.X(u+1)-q.X(u);d=q.Y(u+1)-q.Y(u);k=w*w+d*d;if(k>=JXG.Math.eps){g=(z*w+e*d)/k;r=Math.sqrt(z*z+e*e-g*(z*w+e*d))}else{g=0;r=Math.sqrt(z*z+e*e)}if(g>=0&&g<=1&&r<A){p=u+g;A=r}}u=Math.floor(p);g=p-u;if(u<q.numberPoints-1){n=g*q.X(u+1)+(1-g)*q.X(u);l=g*q.Y(u+1)+(1-g)*q.Y(u)}else{n=q.X(u);l=q.Y(u)}B=new JXG.Coords(JXG.COORDS_BY_USER,[n,l],h)}else{p=n;n=p;l=q.Y(p);B=new JXG.Coords(JXG.COORDS_BY_USER,[n,l],h)}}return[q.updateTransform(B),p]},projectPointToTurtle:function(o,r,k){var q,s,n,m,f,p=0,j=0,g=1000000,l,d,e,h=r.objects.length;if(!JXG.exists(k)){k=o.board}for(f=0;f<h;f++){d=r.objects[f];if(d.elementClass==JXG.OBJECT_CLASS_CURVE){q=this.projectPointToCurve(o,d);l=this.distance(q.usrCoords,o.coords.usrCoords);if(l<g){n=q.usrCoords[1];m=q.usrCoords[2];s=o.position;g=l;e=d;j=p}p+=d.numberPoints}}q=new JXG.Coords(JXG.COORDS_BY_USER,[n,m],k);o.position=s+j;return e.updateTransform(q)}};JXG.Complex=function(d,e){this.isComplex=true;if(typeof d=="undefined"){d=0}if(typeof e=="undefined"){e=0}if(d.isComplex){e=d.imaginary;d=d.real}this.real=d;this.imaginary=e;this.absval=0;this.angle=0};JXG.extend(JXG.Complex.prototype,{toString:function(){return""+this.real+" + "+this.imaginary+"i"},add:function(d){if(typeof d=="number"){this.real+=d}else{this.real+=d.real;this.imaginary+=d.imaginary}},sub:function(d){if(typeof d=="number"){this.real-=d}else{this.real-=d.real;this.imaginary-=d.imaginary}},mult:function(f){var e,d;if(typeof f=="number"){this.real*=f;this.imaginary*=f}else{e=this.real;d=this.imaginary;this.real=e*f.real-d*f.imaginary;this.imaginary=e*f.imaginary+d*f.real}},div:function(g){var e,d,f;if(typeof g=="number"){if(Math.abs(g)<Math.eps){this.real=Infinity;this.imaginary=Infinity;return}this.real/=g;this.imaginary/=g}else{if((Math.abs(g.real)<Math.eps)&&(Math.abs(g.imaginary)<Math.eps)){this.real=Infinity;this.imaginary=Infinity;return}e=g.real*g.real+g.imaginary*g.imaginary;f=this.real;d=this.imaginary;this.real=(f*g.real+d*g.imaginary)/e;this.imaginary=(d*g.real-f*g.imaginary)/e}},conj:function(){this.imaginary*=-1}});JXG.C={};JXG.C.add=function(e,d){var f=new JXG.Complex(e);f.add(d);return f};JXG.C.sub=function(e,d){var f=new JXG.Complex(e);f.sub(d);return f};JXG.C.mult=function(e,d){var f=new JXG.Complex(e);f.mult(d);return f};JXG.C.div=function(e,d){var f=new JXG.Complex(e);f.div(d);return f};JXG.C.conj=function(d){var e=new JXG.Complex(d);e.conj();return e};JXG.C.abs=function(d){var e=new JXG.Complex(d);e.conj();e.mult(d);return Math.sqrt(e.real)};JXG.AbstractRenderer=function(){this.vOffsetText=3;this.enhancedRendering=true;this.container=null;this.type=""};JXG.extend(JXG.AbstractRenderer.prototype,{_updateVisual:function(e,g,f){var d;if(f||this.enhancedRendering){g=g||{};if(!e.visProp.draft){if(!g.stroke){this.setObjectStrokeWidth(e,e.visProp.strokewidth);this.setObjectStrokeColor(e,e.visProp.strokecolor,e.visProp.strokeopacity)}if(!g.fill){this.setObjectFillColor(e,e.visProp.fillcolor,e.visProp.fillopacity)}if(!g.dash){this.setDashStyle(e,e.visProp)}if(!g.shadow){this.setShadow(e)}if(!g.gradient){this.setShadow(e)}}else{this.setDraft(e)}}},drawPoint:function(e){var d,f=JXG.Point.prototype.normalizeFace.call(this,e.visProp.face);if(f==="o"){d="ellipse"}else{if(f==="[]"){d="rect"}else{d="path"}}this.appendChildPrim(this.createPrim(d,e.id),e.visProp.layer);this.appendNodesToElement(e,d);this._updateVisual(e,{dash:true,shadow:true},true);this.updatePoint(e)},updatePoint:function(e){var d=e.visProp.size,f=JXG.Point.prototype.normalizeFace.call(this,e.visProp.face);if(!isNaN(e.coords.scrCoords[2]+e.coords.scrCoords[1])){this._updateVisual(e,{dash:false,shadow:false});d*=((!e.board||!e.board.options.point.zoom)?1:Math.sqrt(e.board.zoomX*e.board.zoomY));if(f==="o"){this.updateEllipsePrim(e.rendNode,e.coords.scrCoords[1],e.coords.scrCoords[2],d+1,d+1)}else{if(f==="[]"){this.updateRectPrim(e.rendNode,e.coords.scrCoords[1]-d,e.coords.scrCoords[2]-d,d*2,d*2)}else{this.updatePathPrim(e.rendNode,this.updatePathStringPoint(e,d,f),e.board)}}this.setShadow(e)}},changePointStyle:function(d){var e=this.getElementById(d.id);if(JXG.exists(e)){this.remove(e)}this.drawPoint(d);JXG.clearVisPropOld(d);if(!d.visProp.visible){this.hide(d)}if(d.visProp.draft){this.setDraft(d)}},drawLine:function(d){this.appendChildPrim(this.createPrim("line",d.id),d.visProp.layer);this.appendNodesToElement(d,"lines");this.updateLine(d)},updateLine:function(f){var e=new JXG.Coords(JXG.COORDS_BY_USER,f.point1.coords.usrCoords,f.board),d=new JXG.Coords(JXG.COORDS_BY_USER,f.point2.coords.usrCoords,f.board);JXG.Math.Geometry.calcStraight(f,e,d);this.updateLinePrim(f.rendNode,e.scrCoords[1],e.scrCoords[2],d.scrCoords[1],d.scrCoords[2],f.board);this.makeArrows(f);this._updateVisual(f,{fill:true})},drawTicks:function(d){var e=this.createPrim("path",d.id);this.appendChildPrim(e,d.visProp.layer);this.appendNodesToElement(d,"path")},updateTicks:function(d,g,e,h,f){},drawCurve:function(d){this.appendChildPrim(this.createPrim("path",d.id),d.visProp.layer);this.appendNodesToElement(d,"path");this._updateVisual(d,{shadow:true},true);this.updateCurve(d)},updateCurve:function(d){this._updateVisual(d);this.updatePathPrim(d.rendNode,this.updatePathStringPrim(d),d.board);this.makeArrows(d)},drawEllipse:function(d){this.appendChildPrim(this.createPrim("ellipse",d.id),d.visProp.layer);this.appendNodesToElement(d,"ellipse");this.updateEllipse(d)},updateEllipse:function(e){this._updateVisual(e);var d=e.Radius();if(d>0&&!isNaN(d+e.midpoint.coords.scrCoords[1]+e.midpoint.coords.scrCoords[2])&&d*e.board.unitX<20000){this.updateEllipsePrim(e.rendNode,e.midpoint.coords.scrCoords[1],e.midpoint.coords.scrCoords[2],(d*e.board.unitX),(d*e.board.unitY))}},drawPolygon:function(d){this.appendChildPrim(this.createPrim("polygon",d.id),d.visProp.layer);this.appendNodesToElement(d,"polygon");this.updatePolygon(d)},updatePolygon:function(d){this._updateVisual(d,{stroke:true,dash:true});this.updatePolygonPrim(d.rendNode,d)},displayCopyright:function(d,e){},drawInternalText:function(d){},updateInternalText:function(d){},drawText:function(d){var e;if(d.visProp.display==="html"){e=this.container.ownerDocument.createElement("div");e.style.position="absolute";e.className="JXGtext";e.style.zIndex="10";this.container.appendChild(e);e.setAttribute("id",this.container.id+"_"+d.id)}else{e=this.drawInternalText(d)}d.rendNode=e;d.htmlStr="";this.updateText(d)},updateText:function(d){var e=d.plaintext;if(d.visProp.visible){this.updateTextStyle(d);if(d.visProp.display==="html"){if(!isNaN(d.coords.scrCoords[1]+d.coords.scrCoords[2])){d.rendNode.style.left=parseInt(d.coords.scrCoords[1])+"px";d.rendNode.style.top=parseInt(d.coords.scrCoords[2]-parseInt(d.visProp.fontsize)+this.vOffsetText)+"px"}if(d.htmlStr!==e){d.rendNode.innerHTML=e;d.htmlStr=e;if(d.visProp.useasciimathml){AMprocessNode(d.rendNode,false)}if(d.visProp.usemathjax){MathJax.Hub.Typeset(d.rendNode)}}this.transformImage(d,d.transformations)}else{this.updateInternalText(d)}}},updateTextStyle:function(f){var d=JXG.evaluate(f.visProp.fontsize);if(f.visProp.display==="html"||this.type!="canvas"){try{f.rendNode.style.fontSize=d+"px"}catch(g){f.rendNode.style.fontSize=d}}this.setObjectStrokeColor(f,f.visProp.strokecolor,f.visProp.strokeopacity)},drawImage:function(d){},updateImage:function(d){this.updateRectPrim(d.rendNode,d.coords.scrCoords[1],d.coords.scrCoords[2]-d.size[1],d.size[0],d.size[1]);this.updateImageURL(d);this.transformImage(d,d.transformations);this._updateVisual(d,{stroke:true,dash:true},true)},joinTransforms:function(n,o){var k=[[1,0,0],[0,1,0],[0,0,1]],g=n.board.origin.scrCoords[1],f=n.board.origin.scrCoords[2],e=n.board.unitX,d=n.board.unitY,r=[[1,0,0],[-g,1,0],[-f,0,1]],q=[[1,0,0],[0,1/e,0],[0,0,-1/d]],h=[[1,0,0],[0,e,0],[0,0,-d]],j=[[1,0,0],[g,1,0],[f,0,1]],l,p=o.length;for(l=0;l<p;l++){k=JXG.Math.matMatMult(r,k);k=JXG.Math.matMatMult(q,k);k=JXG.Math.matMatMult(o[l].matrix,k);k=JXG.Math.matMatMult(h,k);k=JXG.Math.matMatMult(j,k)}return k},transformImage:function(e,d){},updateImageURL:function(d){},appendChildPrim:function(d,e){},appendNodesToElement:function(d,e){},createPrim:function(d,e){return null},remove:function(d){},makeArrows:function(d){},updateEllipsePrim:function(e,d,h,g,f){},updateLinePrim:function(i,e,d,g,f,h){},updatePathPrim:function(f,d,e){},updatePathStringPoint:function(e,d,f){},updatePathStringPrim:function(d){},updatePolygonPrim:function(e,d){},updateRectPrim:function(g,d,i,e,f){},setPropertyPrim:function(e,d,f){},show:function(d){},hide:function(d){},setBuffering:function(e,d){},setDashStyle:function(d){},setDraft:function(d){if(!d.visProp.draft){return}var e=d.board.options.elements.draft.color,f=d.board.options.elements.draft.opacity;if(d.type===JXG.OBJECT_TYPE_POLYGON){this.setObjectFillColor(d,e,f)}else{if(d.elementClass===JXG.OBJECT_CLASS_POINT){this.setObjectFillColor(d,e,f)}else{this.setObjectFillColor(d,"none",0)}this.setObjectStrokeColor(d,e,f);this.setObjectStrokeWidth(d,d.board.options.elements.draft.strokeWidth)}},removeDraft:function(d){if(d.type===JXG.OBJECT_TYPE_POLYGON){this.setObjectFillColor(d,d.visProp.fillcolor,d.visProp.fillopacity)}else{if(d.type===JXG.OBJECT_CLASS_POINT){this.setObjectFillColor(d,d.visProp.fillcolor,d.visProp.fillopacity)}this.setObjectStrokeColor(d,d.visProp.strokecolor,d.visProp.strokeopacity);this.setObjectStrokeWidth(d,d.visProp.strokewidth)}},setGradient:function(d){},updateGradient:function(d){},setObjectFillColor:function(f,d,e){},setObjectStrokeColor:function(f,d,e){},setObjectStrokeWidth:function(d,e){},setShadow:function(d){},highlight:function(e){var d,f=e.visProp;if(!f.draft){if(e.type===JXG.OBJECT_CLASS_POINT){this.setObjectStrokeColor(e,f.highlightstrokecolor,f.highlightstrokeopacity);this.setObjectFillColor(e,f.highlightstrokecolor,f.highlightstrokeopacity)}else{if(e.type===JXG.OBJECT_TYPE_POLYGON){this.setObjectFillColor(e,f.highlightfillcolor,f.highlightfillopacity);for(d=0;d<e.borders.length;d++){this.setObjectStrokeColor(e.borders[d],e.borders[d].visProp.highlightstrokecolor,e.borders[d].visProp.highlightstrokeopacity)}}else{this.setObjectStrokeColor(e,f.highlightstrokecolor,f.highlightstrokeopacity);this.setObjectFillColor(e,f.highlightfillcolor,f.highlightfillopacity)}}if(f.highlightstrokewidth){this.setObjectStrokeWidth(e,f.highlightstrokewidth)}}return this},noHighlight:function(e){var d,f=e.visProp;if(!e.visProp.draft){if(e.type===JXG.OBJECT_CLASS_POINT){this.setObjectStrokeColor(e,f.strokecolor,f.strokeopacity);this.setObjectFillColor(e,f.strokecolor,f.strokeopacity)}else{if(e.type===JXG.OBJECT_TYPE_POLYGON){this.setObjectFillColor(e,f.fillcolor,f.fillopacity);for(d=0;d<e.borders.length;d++){this.setObjectStrokeColor(e.borders[d],e.borders[d].visProp.strokecolor,e.borders[d].visProp.strokeopacity)}}else{this.setObjectStrokeColor(e,f.strokecolor,f.strokeopacity);this.setObjectFillColor(e,f.fillcolor,f.fillopacity)}}this.setObjectStrokeWidth(e,f.strokewidth)}return this},suspendRedraw:function(){},unsuspendRedraw:function(){},drawZoomBar:function(e){var g,f,d=function(h,j){var i;i=g.createElement("span");f.appendChild(i);i.appendChild(document.createTextNode(h));JXG.addEvent(i,"click",j,e)};g=e.containerObj.ownerDocument;f=g.createElement("div");f.setAttribute("id",e.containerObj.id+"_navigationbar");f.style.color=e.options.navbar.strokeColor;f.style.backgroundColor=e.options.navbar.fillColor;f.style.padding=e.options.navbar.padding;f.style.position=e.options.navbar.position;f.style.fontSize=e.options.navbar.fontSize;f.style.cursor=e.options.navbar.cursor;f.style.zIndex=e.options.navbar.zIndex;e.containerObj.appendChild(f);f.style.right=e.options.navbar.right;f.style.bottom=e.options.navbar.bottom;d("\u00A0\u2013\u00A0",e.zoomOut);d("\u00A0o\u00A0",e.zoom100);d("\u00A0+\u00A0",e.zoomIn);d("\u00A0\u2190\u00A0",e.clickLeftArrow);d("\u00A0\u2193\u00A0",e.clickUpArrow);d("\u00A0\u2191\u00A0",e.clickDownArrow);d("\u00A0\u2192\u00A0",e.clickRightArrow)},getElementById:function(d){return document.getElementById(this.container.id+"_"+d)},resize:function(d,e){}});JXG.FileReader=new function(){this.parseFileContent=function(d,g,i,f){if(!JXG.exists(f)){f=true}this.request=false;var h;try{this.request=new XMLHttpRequest();if(i.toLowerCase()=="raw"){this.request.overrideMimeType("text/plain; charset=iso-8859-1")}else{this.request.overrideMimeType("text/xml; charset=iso-8859-1")}}catch(h){try{this.request=new ActiveXObject("Msxml2.XMLHTTP")}catch(h){try{this.request=new ActiveXObject("Microsoft.XMLHTTP")}catch(h){this.request=false}}}if(!this.request){alert("AJAX not activated!");return}this.request.open("GET",d,f);if(i.toLowerCase()=="raw"){this.cbp=function(){var e=this.request;if(e.readyState==4){g(e.responseText)}}}else{this.cbp=function(){var e=this.request;if(e.readyState==4){var j="";if(typeof e.responseStream!="undefined"&&(e.responseText.slice(0,2)=="PK"||JXG.Util.asciiCharCodeAt(e.responseText.slice(0,1),0)==31)){j=JXG.Util.Base64.decode(BinFileReader(e))}else{j=e.responseText}this.parseString(j,g,i,false)}}}this.cb=JXG.bind(this.cbp,this);this.request.onreadystatechange=this.cb;try{this.request.send(null)}catch(h){throw new Error("JSXGraph: problems opening "+d+" !")}};this.cleanWhitespace=function(d){var e=d.firstChild;while(e!=null){if(e.nodeType==3&&!/\S/.test(e.nodeValue)){d.removeChild(e)}else{if(e.nodeType==1){this.cleanWhitespace(e)}}e=e.nextSibling}};this.stringToXMLTree=function(e){if(typeof DOMParser=="undefined"){DOMParser=function(){};DOMParser.prototype.parseFromString=function(h,i){if(typeof ActiveXObject!="undefined"){var g=new ActiveXObject("MSXML.DomDocument");g.loadXML(h);return g}}}var f=new DOMParser();var d=f.parseFromString(e,"text/xml");this.cleanWhitespace(d);return d};this.parseString=function(h,f,i,e){var d,g;if(i.toLowerCase()=="cdy"||i.toLowerCase()=="cinderella"){if(e){h=JXG.Util.Base64.decode(h)}h=JXG.CinderellaReader.readCinderella(h,f);f.xmlString=h;return}if(i.toLowerCase()=="tracenpoche"){f.xmlString=JXG.TracenpocheReader.readTracenpoche(h,f);return}if(i.toLowerCase()=="graph"){h=JXG.GraphReader.readGraph(h,f,false);return}if(i.toLowerCase()=="digraph"){h=JXG.GraphReader.readGraph(h,f,true);return}if(i.toLowerCase()=="geonext"){h=JXG.GeonextReader.prepareString(h)}if(i.toLowerCase()=="geogebra"){e=h.slice(0,2)!=="PK";h=JXG.GeogebraReader.prepareString(h,e)}if(i.toLowerCase()=="intergeo"){if(e){h=JXG.Util.Base64.decode(h)}h=JXG.IntergeoReader.prepareString(h)}f.xmlString=h;d=this.stringToXMLTree(h);this.readElements(d,f,i)};this.readElements=function(d,e,f){if(f.toLowerCase()=="geonext"){e.suspendUpdate();if(d.getElementsByTagName("GEONEXT").length!=0){JXG.GeonextReader.readGeonext(d,e)}e.unsuspendUpdate()}else{if(d.getElementsByTagName("geogebra").length!=0){JXG.GeogebraReader.readGeogebra(d,e)}else{if(f.toLowerCase()=="intergeo"){JXG.IntergeoReader.readIntergeo(d,e)}}}}};if(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)){document.write('<script type="text/vbscript">\nFunction Base64Encode(inData)\n  Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"\n  Dim cOut, sOut, I\n  For I = 1 To LenB(inData) Step 3\n    Dim nGroup, pOut, sGroup\n    nGroup = &H10000 * AscB(MidB(inData, I, 1)) + _\n      &H100 * MyASC(MidB(inData, I + 1, 1)) + MyASC(MidB(inData, I + 2, 1))\n    nGroup = Oct(nGroup)\n    nGroup = String(8 - Len(nGroup), "0") & nGroup\n    pOut = Mid(Base64, CLng("&o" & Mid(nGroup, 1, 2)) + 1, 1) + _\n      Mid(Base64, CLng("&o" & Mid(nGroup, 3, 2)) + 1, 1) + _\n      Mid(Base64, CLng("&o" & Mid(nGroup, 5, 2)) + 1, 1) + _\n      Mid(Base64, CLng("&o" & Mid(nGroup, 7, 2)) + 1, 1)\n    sOut = sOut + pOut\n  Next\n  Select Case LenB(inData) Mod 3\n    Case 1: \'8 bit final\n      sOut = Left(sOut, Len(sOut) - 2) + "=="\n    Case 2: \'16 bit final\n      sOut = Left(sOut, Len(sOut) - 1) + "="\n  End Select\n  Base64Encode = sOut\nEnd Function\n\nFunction MyASC(OneChar)\n  If OneChar = "" Then MyASC = 0 Else MyASC = AscB(OneChar)\nEnd Function\n\nFunction BinFileReader(xhr)\n    Dim byteString\n    Dim b64String\n    Dim i\n    byteString = xhr.responseBody\n    ReDim byteArray(LenB(byteString))\n    For i = 1 To LenB(byteString)\n        byteArray(i-1) = AscB(MidB(byteString, i, 1))\n    Next\n    b64String = Base64Encode(byteString)\n    BinFileReader = b64String\nEnd Function\n<\/script>\n')}JXG.GeonextParser={};JXG.GeonextParser.replacePow=function(f){var k,n,l,j,m,g,d,e,h,q,o;f=f.replace(/(\s*)\^(\s*)/g,"^");h=f.indexOf("^");while(h>=0){e=f.slice(0,h);q=f.slice(h+1);if(e.charAt(e.length-1)==")"){k=1;n=e.length-2;while(n>=0&&k>0){l=e.charAt(n);if(l==")"){k++}else{if(l=="("){k--}}n--}if(k==0){j="";g=e.substring(0,n+1);d=n;while(d>=0&&g.substr(d,1).match(/([\w\.]+)/)){j=RegExp.$1+j;d--}j+=e.substring(n+1,e.length);j=j.replace(/([\(\)\+\*\%\^\-\/\]\[])/g,"\\$1")}else{throw new Error("JSXGraph: Missing '(' in expression")}}else{j="[\\w\\.]+"}if(q.match(/^([\w\.]*\()/)){k=1;n=RegExp.$1.length;while(n<q.length&&k>0){l=q.charAt(n);if(l==")"){k--}else{if(l=="("){k++}}n++}if(k==0){m=q.substring(0,n);m=m.replace(/([\(\)\+\*\%\^\-\/\[\]])/g,"\\$1")}else{throw new Error("JSXGraph: Missing ')' in expression")}}else{m="[\\w\\.]+"}o=new RegExp("("+j+")\\^("+m+")");f=f.replace(o,"JXG.Math.pow($1,$2)");h=f.indexOf("^")}return f};JXG.GeonextParser.replaceIf=function(e){var r="",f,q,h=null,d=null,l=null,g,p,j,m,k,n,o;g=e.indexOf("If(");if(g<0){return e}e=e.replace(/""/g,"0");while(g>=0){f=e.slice(0,g);q=e.slice(g+3);j=1;p=0;m=-1;k=-1;while(p<q.length&&j>0){n=q.charAt(p);if(n==")"){j--}else{if(n=="("){j++}else{if(n==","&&j==1){if(m<0){m=p}else{k=p}}}}p++}o=q.slice(0,p-1);q=q.slice(p);if(m<0){return""}if(k<0){return""}h=o.slice(0,m);d=o.slice(m+1,k);l=o.slice(k+1);h=this.replaceIf(h);d=this.replaceIf(d);l=this.replaceIf(l);r+=f+"(("+h+")?("+d+"):("+l+"))";e=q;h=null;d=null;g=e.indexOf("If(")}r+=q;return r};JXG.GeonextParser.replaceSub=function(f){if(f.indexOf){}else{return f}var e=f.indexOf("_{"),d;while(e>=0){f=f.substr(0,e)+f.substr(e).replace(/_\{/,"<sub>");d=f.substr(e).indexOf("}");if(d>=0){f=f.substr(0,d)+f.substr(d).replace(/\}/,"</sub>")}e=f.indexOf("_{")}e=f.indexOf("_");while(e>=0){f=f.substr(0,e)+f.substr(e).replace(/_(.?)/,"<sub>$1</sub>");e=f.indexOf("_")}return f};JXG.GeonextParser.replaceSup=function(f){if(f.indexOf){}else{return f}var e=f.indexOf("^{"),d;while(e>=0){f=f.substr(0,e)+f.substr(e).replace(/\^\{/,"<sup>");d=f.substr(e).indexOf("}");if(d>=0){f=f.substr(0,d)+f.substr(d).replace(/\}/,"</sup>")}e=f.indexOf("^{")}e=f.indexOf("^");while(e>=0){f=f.substr(0,e)+f.substr(e).replace(/\^(.?)/,"<sup>$1</sup>");e=f.indexOf("^")}return f};JXG.GeonextParser.replaceNameById=function(g,j){var l=0,d,k,h,f,e=["X","Y","L","V"];for(f=0;f<e.length;f++){l=g.indexOf(e[f]+"(");while(l>=0){if(l>=0){d=g.indexOf(")",l+2);if(d>=0){k=g.slice(l+2,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+2)+h.id+g.slice(d)}}d=g.indexOf(")",l+2);l=g.indexOf(e[f]+"(",d)}}l=g.indexOf("Dist(");while(l>=0){if(l>=0){d=g.indexOf(",",l+5);if(d>=0){k=g.slice(l+5,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+5)+h.id+g.slice(d)}}d=g.indexOf(",",l+5);l=g.indexOf(",",d);d=g.indexOf(")",l+1);if(d>=0){k=g.slice(l+1,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+1)+h.id+g.slice(d)}d=g.indexOf(")",l+1);l=g.indexOf("Dist(",d)}e=["Deg","Rad"];for(f=0;f<e.length;f++){l=g.indexOf(e[f]+"(");while(l>=0){if(l>=0){d=g.indexOf(",",l+4);if(d>=0){k=g.slice(l+4,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+4)+h.id+g.slice(d)}}d=g.indexOf(",",l+4);l=g.indexOf(",",d);d=g.indexOf(",",l+1);if(d>=0){k=g.slice(l+1,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+1)+h.id+g.slice(d)}d=g.indexOf(",",l+1);l=g.indexOf(",",d);d=g.indexOf(")",l+1);if(d>=0){k=g.slice(l+1,d);k=k.replace(/\\(['"])?/g,"$1");h=j.elementsByName[k];g=g.slice(0,l+1)+h.id+g.slice(d)}d=g.indexOf(")",l+1);l=g.indexOf(e[f]+"(",d)}}return g};JXG.GeonextParser.replaceIdByObj=function(d){var e=/(X|Y|L)\(([\w_]+)\)/g;d=d.replace(e,'this.board.objects["$2"].$1()');e=/(V)\(([\w_]+)\)/g;d=d.replace(e,'this.board.objects["$2"].Value()');e=/(Dist)\(([\w_]+),([\w_]+)\)/g;d=d.replace(e,'this.board.objects["$2"].Dist(this.board.objects["$3"])');e=/(Deg)\(([\w_]+),([ \w\[\w_]+),([\w_]+)\)/g;d=d.replace(e,'JXG.Math.Geometry.trueAngle(this.board.objects["$2"],this.board.objects["$3"],this.board.objects["$4"])');e=/Rad\(([\w_]+),([\w_]+),([\w_]+)\)/g;d=d.replace(e,'JXG.Math.Geometry.rad(this.board.objects["$1"],this.board.objects["$2"],this.board.objects["$3"])');return d};JXG.GeonextParser.geonext2JS=function(e,g){var h,f,d,k=["Abs","ACos","ASin","ATan","Ceil","Cos","Exp","Factorial","Floor","Log","Max","Min","Random","Round","Sin","Sqrt","Tan","Trunc"],j=["Math.abs","Math.acos","Math.asin","Math.atan","Math.ceil","Math.cos","Math.exp","JXG.Math.factorial","Math.floor","Math.log","Math.max","Math.min","Math.random","this.board.round","Math.sin","Math.sqrt","Math.tan","Math.ceil"];e=e.replace(/</g,"<");e=e.replace(/>/g,">");e=e.replace(/&/g,"&");f=e;f=this.replaceNameById(f,g);f=this.replaceIf(f);f=this.replacePow(f);f=this.replaceIdByObj(f);for(d=0;d<k.length;d++){h=new RegExp(["(\\W|^)(",k[d],")"].join(""),"ig");f=f.replace(h,["$1",j[d]].join(""))}f=f.replace(/True/g,"true");f=f.replace(/False/g,"false");f=f.replace(/fasle/g,"false");f=f.replace(/Pi/g,"Math.PI");return f};JXG.GeonextParser.findDependencies=function(h,e,g){if(typeof g=="undefined"){g=h.board}var i=g.elementsByName,f,j,d;for(f in i){if(f!=h.name){if(i[f].type==JXG.OBJECT_TYPE_TEXT){if(!i[f].visProp.islabel){d=f.replace(/\[/g,"\\[");d=d.replace(/\]/g,"\\]");j=new RegExp("\\(([\\w\\[\\]'_ ]+,)*("+d+")(,[\\w\\[\\]'_ ]+)*\\)","g");if(e.search(j)>=0){i[f].addChild(h)}}}else{d=f.replace(/\[/g,"\\[");d=d.replace(/\]/g,"\\]");j=new RegExp("\\(([\\w\\[\\]'_ ]+,)*("+d+")(,[\\w\\[\\]'_ ]+)*\\)","g");if(e.search(j)>=0){i[f].addChild(h)}}}}};JXG.Board=function(d,i,e,n,m,l,k,j,f,g,h){this.BOARD_MODE_NONE=0;this.BOARD_MODE_DRAG=1;this.BOARD_MODE_MOVE_ORIGIN=2;this.BOARD_QUALITY_LOW=1;this.BOARD_QUALITY_HIGH=2;this.BOARD_MODE_CONSTRUCT=16;this.CONSTRUCTION_TYPE_POINT=1129599060;this.CONSTRUCTION_TYPE_CIRCLE=1129595724;this.CONSTRUCTION_TYPE_LINE=1129598030;this.CONSTRUCTION_TYPE_GLIDER=1129596740;this.CONSTRUCTION_TYPE_MIDPOINT=1129598288;this.CONSTRUCTION_TYPE_PERPENDICULAR=1129599044;this.CONSTRUCTION_TYPE_PARALLEL=1129599052;this.CONSTRUCTION_TYPE_INTERSECTION=1129597267;this.container=d;this.containerObj=document.getElementById(this.container);if(this.containerObj==null){throw new Error("\nJSXGraph: HTML container element '"+(d)+"' not found.")}this.renderer=i;this.grids=[];this.options=JXG.deepCopy(JXG.Options);this.dimension=2;this.origin={};this.origin.usrCoords=[1,0,0];this.origin.scrCoords=[1,n[0],n[1]];this.zoomX=m;this.zoomY=l;this.unitX=k*this.zoomX;this.unitY=j*this.zoomY;this.canvasWidth=f;this.canvasHeight=g;if(JXG.exists(e)&&e!==""&&!JXG.exists(document.getElementById(e))){this.id=e}else{this.id=this.generateId()}this.hooks=[];this.dependentBoards=[];this.objects={};this.groups={};this.animationObjects={};this.highlightedObjects={};this.numObjects=0;this.elementsByName={};this.mode=this.BOARD_MODE_NONE;this.updateQuality=this.BOARD_QUALITY_HIGH;this.isSuspendedRedraw=false;this.calculateSnapSizes();this.drag_dx=0;this.drag_dy=0;this.mouse=null;this.touches=[];this.xmlString="";this.cPos=[];this.touchMoveLast=0;this.showCopyright=false;if((h!=null&&h)||(h==null&&this.options.showCopyright)){this.showCopyright=true;this.renderer.displayCopyright(JXG.JSXGraph.licenseText,this.options.text.fontSize)}this.needsFullUpdate=false;this.reducedUpdate=false;this.currentCBDef="none";this.geonextCompatibilityMode=false;if(this.options.text.useASCIIMathML&&translateASCIIMath){init()}else{this.options.text.useASCIIMathML=false}this.addEventHandlers()};JXG.extend(JXG.Board.prototype,{generateName:function(f){if(f.type==JXG.OBJECT_TYPE_TICKS){return""}var l,h=3,e="",m="",n=[],d="",k,g;if(f.elementClass==JXG.OBJECT_CLASS_POINT){l=["","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]}else{l=["","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]}switch(f.type){case JXG.OBJECT_TYPE_POLYGON:e="P_{";m="}";break;case JXG.OBJECT_TYPE_CIRCLE:e="k_{";m="}";break;case JXG.OBJECT_TYPE_ANGLE:e="W_{";m="}";break;default:if(f.elementClass!=JXG.OBJECT_CLASS_POINT&&f.elementClass!=JXG.OBJECT_CLASS_LINE){e="s_{";m="}"}}for(k=0;k<h;k++){n[k]=0}while(n[h-1]<l.length){for(n[0]=1;n[0]<l.length;n[0]++){d=e;for(k=h;k>0;k--){d+=l[n[k-1]]}if(this.elementsByName[d+m]==null){return d+m}}n[0]=l.length;for(k=1;k<h;k++){if(n[k-1]==l.length){n[k-1]=1;n[k]++}}}return""},generateId:function(){var d=1;while(JXG.JSXGraph.boards["jxgBoard"+d]!=null){d=Math.round(Math.random()*65535)}return("jxgBoard"+d)},setId:function(g,f){var e=this.numObjects++,d=g.id;if(d==""||!JXG.exists(d)){d=this.id+f+e}g.id=d;this.objects[d]=g;return d},finalizeAdding:function(d){if(!d.visProp.visible){this.renderer.hide(d)}},finalizeLabel:function(d){if(d.hasLabel&&!d.label.content.visProp.islabel&&!d.label.content.visProp.visible){this.renderer.hide(d.label.content)}},getCoordsTopLeftCorner:function(){var e=this.containerObj,d=JXG.getOffset(e),f;if(this.mode===JXG.BOARD_MODE_DRAG||this.mode===JXG.BOARD_MODE_MOVE_ORIGIN){return this.cPos}f=parseInt(JXG.getStyle(e,"borderLeftWidth"));if(isNaN(f)){f=0}d[0]+=f;f=parseInt(JXG.getStyle(e,"borderTopWidth"));if(isNaN(f)){f=0}d[1]+=f;f=parseInt(JXG.getStyle(e,"paddingLeft"));if(isNaN(f)){f=0}d[0]+=f;f=parseInt(JXG.getStyle(e,"paddingTop"));if(isNaN(f)){f=0}d[1]+=f;this.cPos=d;return d},getMousePosition:function(h,f){var g=this.getCoordsTopLeftCorner(),d;d=JXG.getPosition(h,f);return[d[0]-g[0],d[1]-g[1]]},initMoveOrigin:function(d,e){this.drag_dx=d-this.origin.scrCoords[1];this.drag_dy=e-this.origin.scrCoords[2];this.mode=this.BOARD_MODE_MOVE_ORIGIN},initMoveObject:function(e,l){var k,g,j=[],d,f,h;this.mode=this.BOARD_MODE_DRAG;for(g in this.objects){k=this.objects[g];if((this.geonextCompatibilityMode&&(k.elementClass==JXG.OBJECT_CLASS_POINT||k.type==JXG.OBJECT_TYPE_TEXT)||!this.geonextCompatibilityMode)&&k.isDraggable&&k.visProp.visible&&(!k.visProp.fixed)&&(!k.visProp.frozen)&&JXG.exists(k.hasPoint)&&k.hasPoint(e,l)){h=false;if(!JXG.isPoint(k)){d=j.length;for(f=0;f<d;f++){if(JXG.exists(k.ancestors[j[f].id])){h=true;break}}}if(!h){j.push(k)}}}return j},moveObject:function(d,i,h){var e=new JXG.Coords(JXG.COORDS_BY_SCREEN,this.getScrCoordsOfMouse(d,i),this),f=h.obj,g;if(f.type!=JXG.OBJECT_TYPE_GLIDER){if(!isNaN(h.targets[0].Xprev+h.targets[0].Yprev)){f.setPositionDirectly(JXG.COORDS_BY_SCREEN,e.scrCoords[1],e.scrCoords[2],h.targets[0].Xprev,h.targets[0].Yprev)}h.targets[0].Xprev=e.scrCoords[1];h.targets[0].Yprev=e.scrCoords[2];this.update(f)}else{if(f.type==JXG.OBJECT_TYPE_GLIDER){g=f.coords;f.setPositionDirectly(JXG.COORDS_BY_USER,e.usrCoords[1],e.usrCoords[2]);if(f.slideObject.type==JXG.OBJECT_TYPE_CIRCLE){f.coords=JXG.Math.Geometry.projectPointToCircle(f,f.slideObject,this)}else{if(f.slideObject.elementClass==JXG.OBJECT_CLASS_LINE){f.coords=JXG.Math.Geometry.projectPointToLine(f,f.slideObject,this)}}if(f.group.length!=0){f.group[f.group.length-1].dX=f.coords.scrCoords[1]-g.scrCoords[1];f.group[f.group.length-1].dY=f.coords.scrCoords[2]-g.scrCoords[2];f.group[f.group.length-1].update(this)}else{this.update(f)}}}this.updateInfobox(f)},highlightElements:function(d,g){var e,f;for(e in this.objects){f=this.objects[e];if(JXG.exists(f.hasPoint)&&f.visProp.visible&&f.hasPoint(d,g)){this.updateInfobox(f);if(this.highlightedObjects[e]==null){this.highlightedObjects[e]=f;f.highlight()}}}},addEventHandlers:function(){JXG.addEvent(this.containerObj,"mousedown",this.mouseDownListener,this);JXG.addEvent(this.containerObj,"mousemove",this.mouseMoveListener,this);JXG.addEvent(document,"mouseup",this.mouseUpListener,this);JXG.addEvent(this.containerObj,"touchstart",this.touchStartListener,this);JXG.addEvent(this.containerObj,"touchmove",this.touchMoveListener,this);JXG.addEvent(this.containerObj,"touchend",this.touchEndListener,this);JXG.addEvent(this.containerObj,"mousewheel",this.mouseWheelListener,this);JXG.addEvent(this.containerObj,"DOMMouseScroll",this.mouseWheelListener,this);this.containerObj.oncontextmenu=function(d){if(JXG.exists(d)){d.preventDefault()}return false}},removeEventHandlers:function(){JXG.removeEvent(this.containerObj,"mousedown",this.mouseDownListener,this);JXG.removeEvent(this.containerObj,"mousemove",this.mouseMoveListener,this);JXG.removeEvent(document,"mouseup",this.mouseUpListener,this);JXG.removeEvent(this.containerObj,"touchstart",this.touchStartListener,this);JXG.removeEvent(this.containerObj,"touchmove",this.touchMoveListener,this);JXG.removeEvent(this.containerObj,"touchend",this.touchEndListener,this);JXG.removeEvent(this.containerObj,"mousewheel",this.mouseWheelListener,this);JXG.removeEvent(this.containerObj,"DOMMouseScroll",this.mouseWheelListener,this)},clickLeftArrow:function(){this.moveOrigin(this.origin.scrCoords[1]+this.canvasWidth*0.1,this.origin.scrCoords[2]);return this},clickRightArrow:function(){this.moveOrigin(this.origin.scrCoords[1]-this.canvasWidth*0.1,this.origin.scrCoords[2]);return this},clickUpArrow:function(){this.moveOrigin(this.origin.scrCoords[1],this.origin.scrCoords[2]+this.canvasHeight*0.1);return this},clickDownArrow:function(){this.moveOrigin(this.origin.scrCoords[1],this.origin.scrCoords[2]-this.canvasHeight*0.1);return this},touchStartListener:function(m){var h,k,d,f,o=this.options.precision.touch,n=false,l=[],g;m.preventDefault();m.stopPropagation();this.updateHooks("mousedown",m);if((this.mode===this.BOARD_MODE_NONE)&&(m.targetTouches.length==2)&&(JXG.Math.Geometry.distance([m.targetTouches[0].screenX,m.targetTouches[0].screenY],[m.targetTouches[1].screenX,m.targetTouches[1].screenY])<80)){k=this.getMousePosition(m,0);this.initMoveOrigin(k[0],k[1]);return}this.options.precision.hasPoint=this.options.precision.touch;for(h=0;h<this.touches.length;h++){l[h]=this.touches[h]}this.touches.length=0;for(h=0;h<m.targetTouches.length;h++){for(f=0;f<l.length;f++){if(Math.abs(Math.pow(m.targetTouches[h].screenX-l[f].targets[0].X,2)+Math.pow(m.targetTouches[h].screenY-l[f].targets[0].Y,2))<o*o){this.touches.push({obj:l[f].obj,targets:[{num:h,X:m.targetTouches[h].screenX,Y:m.targetTouches[h].screenY,Xprev:NaN,Yprev:NaN}]});n=true;break}}if(!n){k=this.getMousePosition(m,h);d=this.initMoveObject(k[0],k[1]);if(d.length!=0){if(this.options.takeFirst){g=d[0]}else{g=d[d.length-1]}this.touches.push({obj:g,targets:[{num:h,X:m.targetTouches[h].screenX,Y:m.targetTouches[h].screenY,Xprev:NaN,Yprev:NaN}]})}}n=false}if(JXG.isWebkitAndroid()){var e=new Date();this.touchMoveLast=e.getTime()-200}this.options.precision.hasPoint=this.options.precision.mouse},touchMoveListener:function(d){var f,e,h;d.preventDefault();d.stopPropagation();if(JXG.isWebkitAndroid()){var g=new Date();g=g.getTime();if(g-this.touchMoveLast<80){this.updateQuality=this.BOARD_QUALITY_HIGH;return}else{this.touchMoveLast=g}}this.updateHooks("mousemove",d,this.mode);if(this.mode!=this.BOARD_MODE_DRAG){this.renderer.hide(this.infobox)}this.options.precision.hasPoint=this.options.precision.touch;if(this.mode==this.BOARD_MODE_MOVE_ORIGIN){h=this.getMousePosition(d,0);this.moveOrigin(h[0],h[1])}else{if(this.mode==this.BOARD_MODE_DRAG){for(f=0;f<this.touches.length;f++){this.touches[f].targets[0].X=d.targetTouches[this.touches[f].targets[0].num].screenX;this.touches[f].targets[0].Y=d.targetTouches[this.touches[f].targets[0].num].screenY;h=this.getMousePosition(d,this.touches[f].targets[0].num);this.moveObject(h[0],h[1],this.touches[f])}}else{for(f=0;f<d.targetTouches.length;f++){h=this.getMousePosition(d,f);this.highlightElements(h[0],h[1])}}}if(this.mode!=this.BOARD_MODE_DRAG){this.renderer.hide(this.infobox)}this.options.precision.hasPoint=this.options.precision.mouse},touchEndListener:function(e){var g,f,d=this.options.precision.touch,k=false,h=[];this.updateHooks("mouseup",e);if(e.targetTouches.length>0){for(g=0;g<this.touches.length;g++){h[g]=this.touches[g]}this.touches.length=0;for(g=0;g<e.targetTouches.length;g++){for(f=0;f<h.length;f++){if(Math.abs(Math.pow(e.targetTouches[g].screenX-h[f].targets[0].X,2)+Math.pow(e.targetTouches[g].screenY-h[f].targets[0].Y,2))<d*d){this.touches.push({obj:h[f].obj,targets:[{num:g,X:e.targetTouches[g].screenX,Y:e.targetTouches[g].screenY,Xprev:NaN,Yprev:NaN}]});break}}}}else{this.updateQuality=this.BOARD_QUALITY_HIGH;this.mode=this.BOARD_MODE_NONE;if(this.mode!==this.BOARD_MODE_MOVE_ORIGIN){this.update()}this.touches.length=0}},mouseDownListener:function(e){var f,d;this.updateHooks("mousedown",e);if(document.selection&&typeof document.selection.empty=="function"){document.selection.empty()}else{if(window.getSelection){window.getSelection().removeAllRanges()}}f=this.getMousePosition(e);if(e.shiftKey){this.initMoveOrigin(f[0],f[1]);return false}if(this.mode==this.BOARD_MODE_CONSTRUCT){return false}d=this.initMoveObject(f[0],f[1]);if(d.length==0){this.mode=this.BOARD_MODE_NONE;return true}else{this.mouse={obj:null,targets:[{X:f[0],Y:f[1],Xprev:NaN,Yprev:NaN}]};if(this.options.takeFirst){this.mouse.obj=d[0]}else{this.mouse.obj=d[d.length-1]}if(e&&e.preventDefault){e.preventDefault()}else{window.event.returnValue=false}}return false},mouseUpListener:function(d){this.updateHooks("mouseup",d);this.updateQuality=this.BOARD_QUALITY_HIGH;this.mode=this.BOARD_MODE_NONE;if(this.mode!==this.BOARD_MODE_MOVE_ORIGIN){this.update()}this.mouse=null},mouseMoveListener:function(d,e){var f;this.updateHooks("mousemove",d,this.mode);e=0;f=this.getMousePosition(d);this.updateQuality=this.BOARD_QUALITY_LOW;this.dehighlightAll();if(this.mode!=this.BOARD_MODE_DRAG){this.renderer.hide(this.infobox)}if(this.mode==this.BOARD_MODE_MOVE_ORIGIN){this.moveOrigin(f[0]-this.drag_dx,f[1]-this.drag_dy)}else{if(this.mode==this.BOARD_MODE_DRAG){this.moveObject(f[0],f[1],this.mouse)}else{this.highlightElements(f[0],f[1])}}this.updateQuality=this.BOARD_QUALITY_HIGH},mouseWheelListener:function(d){d=d?d:window.event;var e=d.detail?d.detail*(-1):d.wheelDelta/40,f=new JXG.Coords(JXG.COORDS_BY_SCREEN,this.getMousePosition(d),this);if(e>0){this.zoomIn(f.usrCoords[1],f.usrCoords[2])}else{this.zoomOut(f.usrCoords[1],f.usrCoords[2])}d.preventDefault();return false},updateInfobox:function(e){var d,h,f,g;if(!e.visProp.showinfobox){return this}if(e.elementClass==JXG.OBJECT_CLASS_POINT){f=e.coords.usrCoords[1];g=e.coords.usrCoords[2];this.infobox.setCoords(f+this.infobox.distanceX/(this.unitX),g+this.infobox.distanceY/(this.unitY));if(typeof(e.infoboxText)!="string"){d=Math.abs(f);if(d>0.1){d=f.toFixed(2)}else{if(d>=0.01){d=f.toFixed(4)}else{if(d>=0.0001){d=f.toFixed(6)}else{d=f}}}h=Math.abs(g);if(h>0.1){h=g.toFixed(2)}else{if(h>=0.01){h=g.toFixed(4)}else{if(h>=0.0001){h=g.toFixed(6)}else{h=g}}}this.highlightInfobox(d,h,e)}else{this.highlightCustomInfobox(e.infoboxText,e)}this.renderer.show(this.infobox);this.renderer.updateText(this.infobox)}return this},highlightCustomInfobox:function(d){this.infobox.setText('<span style="color:#bbbbbb;">'+d+"</span>");return this},highlightInfobox:function(d,e){this.highlightCustomInfobox("("+d+", "+e+")");return this},dehighlightAll:function(){var e,f,d=false;for(e in this.highlightedObjects){f=this.highlightedObjects[e];f.noHighlight();delete (this.highlightedObjects[e]);d=true}if(this.options.renderer=="canvas"&&d){this.prepareUpdate();this.renderer.suspendRedraw(this);this.updateRenderer();this.renderer.unsuspendRedraw()}return this},getScrCoordsOfMouse:function(d,f){if(this.options.grid.snapToGrid){var e=new JXG.Coords(JXG.COORDS_BY_SCREEN,[d,f],this);e.setCoordinates(JXG.COORDS_BY_USER,[Math.round((e.usrCoords[1])*this.options.grid.snapSizeX)/this.options.grid.snapSizeX,Math.round((e.usrCoords[2])*this.options.grid.snapSizeY)/this.options.grid.snapSizeY]);return[e.scrCoords[1],e.scrCoords[2]]}else{return[d,f]}},getUsrCoordsOfMouse:function(h){var f=this.getCoordsTopLeftCorner(),e=JXG.getPosition(h),d=e[0]-f[0],i=e[1]-f[1],g=new JXG.Coords(JXG.COORDS_BY_SCREEN,[d,i],this);if(this.options.grid.snapToGrid){g.setCoordinates(JXG.COORDS_BY_USER,[Math.round((g.usrCoords[1])*this.options.grid.snapSizeX)/this.options.grid.snapSizeX,Math.round((g.usrCoords[2])*this.options.grid.snapSizeY)/this.options.grid.snapSizeY])}return[g.usrCoords[1],g.usrCoords[2]]},getAllUnderMouse:function(e){var d=this.getAllObjectsUnderMouse();d.push(this.getUsrCoordsOfMouse(e));return d},getAllObjectsUnderMouse:function(j){var i=this.getCoordsTopLeftCorner(),d=JXG.getPosition(j),f=d[0]-i[0],e=d[1]-i[1],g=[];for(var h in this.objects){if(this.objects[h].visProp.visible&&this.objects[h].hasPoint&&this.objects[h].hasPoint(f,e)){g.push(this.objects[h])}}return g},moveOrigin:function(d,g){var f,e;if(JXG.exists(d)&&JXG.exists(g)){this.origin.scrCoords[1]=d;this.origin.scrCoords[2]=g}for(e in this.objects){f=this.objects[e];if(!f.visProp.frozen&&(f.elementClass==JXG.OBJECT_CLASS_POINT||f.elementClass==JXG.OBJECT_CLASS_CURVE||f.type==JXG.OBJECT_TYPE_AXIS||f.type==JXG.OBJECT_TYPE_TEXT)){if(f.elementClass!=JXG.OBJECT_CLASS_CURVE&&f.type!=JXG.OBJECT_TYPE_AXIS){f.coords.usr2screen()}}}this.clearTraces();this.fullUpdate();return this},addConditions:function(o){var e="var el, x, y, c, rgbo;\n",n=o.indexOf("<data>"),l=o.indexOf("</data>"),k,h,g,q,d,f;if(n<0){return}while(n>=0){k=o.slice(n+6,l);h=k.indexOf("=");g=k.slice(0,h);q=k.slice(h+1);h=g.indexOf(".");d=g.slice(0,h);f=this.elementsByName[JXG.unescapeHTML(d)];var p=g.slice(h+1).replace(/\s+/g,"").toLowerCase();q=JXG.GeonextParser.geonext2JS(q,this);q=q.replace(/this\.board\./g,"this.");if(!JXG.exists(this.elementsByName[d])){JXG.debug("debug conditions: |"+d+"| undefined")}e+='el = this.objects["'+f.id+'"];\n';switch(p){case"x":e+="var y=el.coords.usrCoords[2];\n";e+="el.setPositionDirectly(JXG.COORDS_BY_USER,"+(q)+",y);\n";e+="el.prepareUpdate().update();\n";break;case"y":e+="var x=el.coords.usrCoords[1];\n";e+="el.coords=new JXG.Coords(JXG.COORDS_BY_USER,[x,"+(q)+"],this);\n";e+="el.setPositionDirectly(JXG.COORDS_BY_USER,x,"+(q)+");\n";e+="el.prepareUpdate().update();\n";break;case"visible":e+="var c="+(q)+";\n";e+="el.visProp.visible = c;\n";e+="if (c) {el.showElement();} else {el.hideElement();}\n";break;case"position":e+="el.position = "+(q)+";\n";e+="el.prepareUpdate().update(true);\n";break;case"stroke":e+="rgbo = JXG.rgba2rgbo("+(q)+");\n";e+="el.visProp.strokecolor = rgbo[0];\n";e+="el.visProp.strokeopacity = rgbo[1];\n";break;case"style":e+="el.setStyle("+(q)+");\n";break;case"strokewidth":e+="el.strokeWidth = "+(q)+";\n";break;case"fill":e+="var rgbo = JXG.rgba2rgbo("+(q)+");\n";e+="el.visProp.fillcolor = rgbo[0];\n";e+="el.visProp.fillopacity = rgbo[1];\n";break;case"label":break;default:JXG.debug("property '"+p+"' in conditions not yet implemented:"+q);break}o=o.slice(l+7);n=o.indexOf("<data>");l=o.indexOf("</data>")}e+="this.prepareUpdate().updateElements();\n";e+="return true;\n";this.updateConditions=new Function(e);this.updateConditions()},updateConditions:function(){return false},calculateSnapSizes:function(){var f=new JXG.Coords(JXG.COORDS_BY_USER,[0,0],this),e=new JXG.Coords(JXG.COORDS_BY_USER,[this.options.grid.gridX,this.options.grid.gridY],this),d=f.scrCoords[1]-e.scrCoords[1],g=f.scrCoords[2]-e.scrCoords[2];this.options.grid.snapSizeX=this.options.grid.gridX;while(Math.abs(d)>25){this.options.grid.snapSizeX*=2;d/=2}this.options.grid.snapSizeY=this.options.grid.gridY;while(Math.abs(g)>25){this.options.grid.snapSizeY*=2;g/=2}return this},applyZoom:function(){var e,d;for(d in this.objects){e=this.objects[d];if(!e.visProp.frozen&&(e.elementClass==JXG.OBJECT_CLASS_POINT||e.elementClass==JXG.OBJECT_CLASS_CURVE||e.type==JXG.OBJECT_TYPE_AXIS||e.type==JXG.OBJECT_TYPE_TEXT)){if(e.elementClass!=JXG.OBJECT_CLASS_CURVE&&e.type!=JXG.OBJECT_TYPE_AXIS){e.coords.usr2screen()}}}this.calculateSnapSizes();this.clearTraces();this.fullUpdate();return this},zoomIn:function(l,j){var g=this.getBoundingBox(),k=this.options.zoom.factorX,i=this.options.zoom.factorY,e=(g[2]-g[0])*(1-1/k),d=(g[1]-g[3])*(1-1/i),f=0.5,h=0.5;if(typeof l==="number"&&typeof j==="number"){f=(l-g[0])/(g[2]-g[0]);h=(g[1]-j)/(g[1]-g[3])}this.setBoundingBox([g[0]+e*f,g[1]-d*h,g[2]-e*(1-f),g[3]+d*(1-h)],false);this.zoomX*=k;this.zoomY*=i;this.applyZoom();return this},zoomOut:function(l,j){var g=this.getBoundingBox(),k=this.options.zoom.factorX,i=this.options.zoom.factorY,e=(g[2]-g[0])*(1-k),d=(g[1]-g[3])*(1-i),f=0.5,h=0.5;if(typeof l==="number"&&typeof j==="number"){f=(l-g[0])/(g[2]-g[0]);h=(g[1]-j)/(g[1]-g[3])}this.setBoundingBox([g[0]+e*f,g[1]-d*h,g[2]-e*(1-f),g[3]+d*(1-h)],false);this.zoomX/=k;this.zoomY/=i;this.applyZoom();return this},zoom100:function(){var f=this.getBoundingBox(),e=(f[2]-f[0])*(1-this.zoomX)*0.5,d=(f[1]-f[3])*(1-this.zoomY)*0.5;this.setBoundingBox([f[0]+e,f[1]-d,f[2]-e,f[3]+d],false);this.zoomX=1;this.zoomY=1;this.applyZoom();return this},zoomAllPoints:function(){var d=0,j=0,k=0,i=0,h,g,f,e;for(h in this.objects){if(JXG.isPoint(this.objects[h])&&this.objects[h].visProp.visible){if(this.objects[h].coords.usrCoords[1]<d){d=this.objects[h].coords.usrCoords[1]}else{if(this.objects[h].coords.usrCoords[1]>j){j=this.objects[h].coords.usrCoords[1]}}if(this.objects[h].coords.usrCoords[2]>i){i=this.objects[h].coords.usrCoords[2]}else{if(this.objects[h].coords.usrCoords[2]<k){k=this.objects[h].coords.usrCoords[2]}}}}g=50;f=g/(this.unitX);e=g/(this.unitY);this.zoomX=1;this.zoomY=1;this.setBoundingBox([d-f,i+e,j+f,k-e],true);this.applyZoom();return this},zoomElements:function(l){var h,g,m,k,f=[0,0,0,0],d=[1,-1,-1,1];if(!JXG.isArray(l)||l.length===0){return this}for(h=0;h<l.length;h++){m=JXG.getRef(this,l[h]);k=m.bounds();if(JXG.isArray(k)){if(JXG.isArray(f)){for(g=0;g<4;g++){if(d[g]*k[g]<d[g]*f[g]){f[g]=k[g]}}}else{f=k}}}if(JXG.isArray(f)){for(g=0;g<4;g++){f[g]-=d[g]}this.zoomX=1;this.zoomY=1;this.setBoundingBox(f,true)}return this},removeObject:function(d){var g,f;if(JXG.isArray(d)){for(f=0;f<d.length;f++){this.removeObject(d[f])}}d=JXG.getReference(this,d);if(!JXG.exists(d)){return this}try{for(g in d.childElements){d.childElements[g].board.removeObject(d.childElements[g])}for(g in this.objects){if(JXG.exists(this.objects[g].childElements)){delete (this.objects[g].childElements[d.id])}}delete (this.objects[d.id]);delete (this.elementsByName[d.name]);if(JXG.exists(d.remove)){d.remove()}}catch(h){JXG.debug(d.id+": Could not be removed, JS says:\n\n"+h)}return this},removeAncestors:function(d){for(var e in d.ancestors){this.removeAncestors(d.ancestors[e])}this.removeObject(d);return this},initGeonextBoard:function(){var h,g,f,e,d;h=this.create("point",[0,0],{id:this.id+"g00e0",name:"Ursprung",withLabel:false,visible:false,fixed:true});g=this.create("point",[1,0],{id:this.id+"gX0e0",name:"Punkt_1_0",withLabel:false,visible:false,fixed:true});f=this.create("point",[0,1],{id:this.id+"gY0e0",name:"Punkt_0_1",withLabel:false,visible:false,fixed:true});e=this.create("line",[h,g],{id:this.id+"gXLe0",name:"X-Achse",withLabel:false,visible:false});d=this.create("line",[h,f],{id:this.id+"gYLe0",name:"Y-Achse",withLabel:false,visible:false});return this},initInfobox:function(){this.infobox=this.create("text",[0,0,"0,0"],{id:this.id+"_infobox",display:"html"});this.infobox.distanceX=-20;this.infobox.distanceY=25;this.renderer.hide(this.infobox);return this},resizeContainer:function(d,e){this.canvasWidth=parseFloat(d);this.canvasHeight=parseFloat(e);this.containerObj.style.width=(this.canvasWidth)+"px";this.containerObj.style.height=(this.canvasHeight)+"px";this.renderer.resize(this.canvasWidth,this.canvasHeight);return this},showDependencies:function(){var g,e,j,h,d;e="<p>\n";for(g in this.objects){d=0;for(j in this.objects[g].childElements){d++}if(d>=0){e+="<b>"+this.objects[g].id+":</b> "}for(j in this.objects[g].childElements){e+=this.objects[g].childElements[j].id+"("+this.objects[g].childElements[j].name+"), "}e+="<p>\n"}e+="</p>\n";h=window.open();h.document.open();h.document.write(e);h.document.close();return this},showXML:function(){var d=window.open("");d.document.open();d.document.write("<pre>"+JXG.escapeHTML(this.xmlString)+"</pre>");d.document.close();return this},prepareUpdate:function(){var d,e;for(d in this.objects){e=this.objects[d];if(!this.needsFullUpdate&&!e.needsRegularUpdate){continue}e.needsUpdate=true}return this},updateElements:function(e){var d,f;e=JXG.getRef(this,e);for(d in this.objects){f=this.objects[d];if(e==null||f.id!=e.id){f.update(true)}else{f.update(false)}}return this},updateRenderer:function(e){var d,f;if(this.options.renderer=="canvas"){this.updateRendererCanvas(e)}else{for(d in this.objects){f=this.objects[d];f.updateRenderer()}}return this},updateRendererCanvas:function(h){var d,l,g,f=this.options.layer,k=this.options.layer.numlayers,m=Number.NEGATIVE_INFINITY,j,e;for(g=0;g<k;g++){j=Number.POSITIVE_INFINITY;for(e in f){if(f[e]>m&&f[e]<j){j=f[e]}}m=j;for(d in this.objects){l=this.objects[d];if(l.visProp.layer===j){l.prepareUpdate().updateRenderer()}}}return this},addHook:function(f,d,e){if(!JXG.exists(d)){d="update"}e=e||this;this.hooks.push({fn:f,mode:d,context:e});if(d=="update"){f.apply(e,[this])}return(this.hooks.length-1)},removeHook:function(d){this.hooks[d]=null;return this},updateHooks:function(d){var f,e=arguments.length>1?Array.prototype.slice.call(arguments,1):[];if(!JXG.exists(d)){d="update"}for(f=0;f<this.hooks.length;f++){if((this.hooks[f]!=null)&&(this.hooks[f].mode==d)){this.hooks[f].fn.apply(this.hooks[f].context,e)}}return this},addChild:function(d){this.dependentBoards.push(d);this.update();return this},removeChild:function(e){var d;for(d=this.dependentBoards.length-1;d>=0;d--){if(this.dependentBoards[d]==e){this.dependentBoards.splice(d,1)}}return this},update:function(g){var f,e,h,d;if(this.isSuspendedUpdate){return this}this.prepareUpdate(g).updateElements(g).updateConditions();this.renderer.suspendRedraw(this);this.updateRenderer(g);this.renderer.unsuspendRedraw();this.updateHooks();e=this.dependentBoards.length;for(f=0;f<e;f++){h=this.dependentBoards[f].id;d=JXG.JSXGraph.boards[h];if(d!=this){d.updateQuality=this.updateQuality;d.prepareUpdate().updateElements().updateConditions();d.renderer.suspendRedraw();d.updateRenderer();d.renderer.unsuspendRedraw();d.updateHooks()}}return this},fullUpdate:function(){this.needsFullUpdate=true;this.update();this.needsFullUpdate=false;return this},addGrid:function(){this.create("grid",[]);return this},removeGrids:function(){var d;for(d=0;d<this.grids.length;d++){this.removeObject(this.grids[d])}this.grids.length=0;this.update();return this},create:function(e,f,d){var j,g,h;e=e.toLowerCase();if(!JXG.exists(f)){f=[]}if(!JXG.exists(d)){d={}}for(g=0;g<f.length;g++){if(e!="text"||g!=2){f[g]=JXG.getReference(this,f[g])}}if(JXG.JSXGraph.elements[e]!=null){if(typeof JXG.JSXGraph.elements[e]=="function"){j=JXG.JSXGraph.elements[e](this,f,d)}else{j=JXG.JSXGraph.elements[e].creator(this,f,d)}}else{throw new Error("JSXGraph: JXG.createElement: Unknown element type given: "+e)}if(!JXG.exists(j)){JXG.debug("JSXGraph: JXG.createElement: failure creating "+e);return j}if(j.prepareUpdate&&j.update&&j.updateRenderer){j.prepareUpdate().update().updateRenderer()}return j},createElement:JXG.shortcut(JXG.Board.prototype,"create"),clearTraces:function(){var d;for(d in this.objects){if(this.objects[d].visProp.trace){this.objects[d].clearTrace()}}this.numTraces=0;return this},suspendUpdate:function(){this.isSuspendedUpdate=true;return this},unsuspendUpdate:function(){this.isSuspendedUpdate=false;this.update();return this},setBoundingBox:function(i,e){if(!JXG.isArray(i)){return this}var f,d,g=JXG.getDimensions(this.container);this.canvasWidth=parseInt(g.width);this.canvasHeight=parseInt(g.height);d=this.canvasWidth;f=this.canvasHeight;if(e){this.unitX=d/(i[2]-i[0]);this.unitY=f/(i[1]-i[3]);if(this.unitX<this.unitY){this.unitY=this.unitX}else{this.unitX=this.unitY}}else{this.unitX=d/(i[2]-i[0]);this.unitY=f/(i[1]-i[3])}this.moveOrigin(-this.unitX*i[0],this.unitY*i[1]);return this},getBoundingBox:function(){var e=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],this),d=new JXG.Coords(JXG.COORDS_BY_SCREEN,[this.canvasWidth,this.canvasHeight],this);return[e.usrCoords[1],e.usrCoords[2],d.usrCoords[1],d.usrCoords[2]]},addAnimation:function(d){this.animationObjects[d.id]=d;if(!this.animationIntervalCode){this.animationIntervalCode=window.setInterval("JXG.JSXGraph.boards['"+this.id+"'].animate();",35)}return this},stopAllAnimation:function(){var d;for(d in this.animationObjects){if(this.animationObjects[d]===null){continue}this.animationObjects[d]=null;delete (this.animationObjects[d])}window.clearInterval(this.animationIntervalCode);delete (this.animationIntervalCode);return this},animate:function(){var j=0,g,f,l,d,e,k,i=null,h;for(g in this.animationObjects){if(this.animationObjects[g]===null){continue}j++;f=this.animationObjects[g];if(f.animationPath){if(JXG.isFunction(f.animationPath)){l=f.animationPath(new Date().getTime()-f.animationStart)}else{l=f.animationPath.pop()}if((!JXG.exists(l))||(!JXG.isArray(l)&&isNaN(l))){delete (f.animationPath)}else{f.setPositionDirectly(JXG.COORDS_BY_USER,l[0],l[1]);f.prepareUpdate().update().updateRenderer();i=f}}if(f.animationData){k=0;for(d in f.animationData){e=f.animationData[d].pop();if(!JXG.exists(e)){delete (f.animationData[e])}else{k++;f.setProperty(d+":"+e)}}if(k==0){delete (f.animationData)}}if(!JXG.exists(f.animationData)&&!JXG.exists(f.animationPath)){this.animationObjects[g]=null;delete (this.animationObjects[g]);if(JXG.exists(f.animationCallback)){h=f.animationCallback;f.animationCallback=null;h()}}}if(j==0){window.clearInterval(this.animationIntervalCode);delete (this.animationIntervalCode)}else{this.update(i)}return this},emulateColorblindness:function(d){var f,g,h=this;if(!JXG.exists(d)){d="none"}if(this.currentCBDef==d){return this}for(f in h.objects){g=h.objects[f];if(d!="none"){if(this.currentCBDef=="none"){g.visPropOriginal={strokecolor:g.visProp.strokecolor,fillcolor:g.visProp.fillcolor,highlightstrokecolor:g.visProp.highlightstrokecolor,highlightfillcolor:g.visProp.highlightfillcolor}}g.setProperty({strokecolor:JXG.rgb2cb(g.visPropOriginal.strokecolor,d),fillcolor:JXG.rgb2cb(g.visPropOriginal.fillcolor,d),highlightstrokecolor:JXG.rgb2cb(g.visPropOriginal.highlightstrokecolor,d),highlightfillcolor:JXG.rgb2cb(g.visPropOriginal.highlightfillcolor,d)})}else{if(JXG.exists(g.visPropOriginal)){JXG.extend(g.visProp,g.visPropOriginal)}}}this.currentCBDef=d;this.update();return this},getPartialConstruction:function(d){var f,e;for(e=1;e<arguments.length;e++){f.push(arguments[e])}},createRoulette:function(h,g,l,i,k,e,j){var f=this;var d=function(){var s=0,w=0,v=0,u=l,t=JXG.Math.Numerics.root(function(E){var G=h.X(u),F=h.Y(u),D=g.X(E),C=g.Y(E);return(G-D)*(G-D)+(F-C)*(F-C)},[0,Math.PI*2]),p=0,m=0,z,A=f.create("transform",[function(){return s}],{type:"rotate"}),o=f.create("transform",[function(){return s},function(){return h.X(u)},function(){return h.Y(u)}],{type:"rotate"}),r=f.create("transform",[function(){return w},function(){return v}],{type:"translate"}),x=function(L,N,M){var K=JXG.Math.Numerics.D(L.X)(N),E=JXG.Math.Numerics.D(L.Y)(N),J=JXG.Math.Numerics.D(L.X)(M),D=JXG.Math.Numerics.D(L.Y)(M),G=JXG.Math.Numerics.D(L.X)((N+M)*0.5),I=JXG.Math.Numerics.D(L.Y)((N+M)*0.5),H=Math.sqrt(K*K+E*E),F=Math.sqrt(J*J+D*D),C=Math.sqrt(G*G+I*I);return(H+4*C+F)*(M-N)/6},B=function(C){return z-x(g,t,C)},y=Math.PI/18,n=y*9,q=null;this.rolling=function(){p=u+k*i;z=x(h,u,p);m=JXG.Math.Numerics.root(B,t);var D=new JXG.Complex(h.X(p),h.Y(p));var E=new JXG.Complex(g.X(m),g.Y(m));var F=new JXG.Complex(JXG.Math.Numerics.D(h.X)(p),JXG.Math.Numerics.D(h.Y)(p));var C=new JXG.Complex(JXG.Math.Numerics.D(g.X)(m),JXG.Math.Numerics.D(g.Y)(m));var G=JXG.C.div(F,C);s=Math.atan2(G.imaginary,G.real);G.div(JXG.C.abs(G));G.mult(E);w=D.real-G.real;v=D.imaginary-G.imaginary;if(s<-y&&s>-n){s=-y;o.applyOnce(j)}else{if(s>y&&s<n){s=y;o.applyOnce(j)}else{A.applyOnce(j);r.applyOnce(j);u=p;t=m}}f.update()};this.start=function(){if(e>0){q=setInterval(this.rolling,e)}return this};this.stop=function(){clearInterval(q);return this};return this};return new d()}});JXG.Options={showCopyright:true,showNavigation:true,takeSizeFromFile:false,renderer:"svg",takeFirst:false,zoom:{factorX:1.25,factorY:1.25},navbar:{strokeColor:"#aaaaaa",fillColor:"#f5f5f5",padding:"2px",position:"absolute",fontSize:"10px",cursor:"pointer",zIndex:"100",right:"5px",bottom:"5px"},elements:{strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",fillColor:"red",highlightFillColor:"none",strokeOpacity:1,highlightStrokeOpacity:1,fillOpacity:1,highlightFillOpacity:1,strokeWidth:2,highlightStrokeWidth:2,fixed:false,frozen:false,withLabel:false,visible:true,layer:0,dash:0,shadow:false,trace:false,needsRegularUpdate:true,draft:{draft:false,strokeColor:"#565656",fillColor:"#565656",strokeOpacity:0.8,fillOpacity:0.8,strokeWidth:1}},ticks:{drawLabels:false,drawZero:false,insertTicks:false,minTicksDistance:50,minorHeight:4,majorHeight:10,minorTicks:4,ticksDistance:1,strokeOpacity:1,strokeWidth:1,strokeColor:"black",highlightStrokeColor:"#888888"},precision:{touch:30,mouse:4,epsilon:0.0001,hasPoint:4},layer:{numlayers:20,text:9,point:9,arc:8,line:7,circle:6,curve:5,polygon:3,sector:3,angle:3,integral:3,axis:2,grid:1,image:0,trace:0},angle:{withLabel:true,radius:1,fillColor:"#FF7F00",highlightFillColor:"#FF7F00",strokeColor:"#FF7F00",textColor:"#0000FF",fillOpacity:0.3,highlightFillOpacity:0.3,point:{withLabel:false,visible:false,name:""},dot:{visible:false,strokeColor:"none",fillColor:"black",size:2,face:"o",withLabel:false,name:""}},arc:{firstArrow:false,lastArrow:false,fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",useDirection:false,center:{visible:false,withLabel:false,fixed:false,name:""}},axis:{needsRegularUpdate:false,strokeWidth:1,strokeColor:"#666666",highlightStrokeWidth:1,highlightStrokeColor:"#888888",withTicks:true,straightFirst:true,straightLast:true,lastArrow:true,withLabel:false,ticks:{needsRegularUpdate:false,strokeWidth:1,strokeColor:"#666666",highlightStrokeColor:"#888888",drawLabels:true,drawZero:true,insertTicks:true,minTicksDistance:50,minorHeight:4,majorHeight:-1,minorTicks:4,ticksDistance:1,strokeOpacity:0.25},point1:{needsRegularUpdate:false},point2:{needsRegularUpdate:false}},bisector:{strokeColor:"#000000",point:{visible:false,fixed:false,withLabel:false,name:""}},bisectorlines:{line1:{strokeColor:"red"},line2:{strokeColor:"black"}},chart:{chartStyle:"line",colors:["#B02B2C","#3F4C6B","#C79810","#D15600","#FFFF88","#C3D9FF","#4096EE","#008C00"],highlightcolors:null,fillcolor:null,highlightonsector:false,highlightbysize:false},circle:{fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",center:{visible:false,withLabel:false,fixed:false,name:""}},circumcircle:{fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",point:{visible:false,fixed:false,withLabel:false,name:""}},circumcirclesector:{useDirection:true,fillColor:"#00FF00",highlightFillColor:"#00FF00",fillOpacity:0.3,highlightFillOpacity:0.3,strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",point:{visible:false,fixed:false,withLabel:false,name:""}},conic:{fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",foci:{fixed:false,visible:false,withLabel:false,name:""}},curve:{strokeWidth:1,strokeColor:"#0000ff",fillColor:"none",curveType:null,RDPsmoothing:false,numberPointsHigh:1600,numberPointsLow:400,doAdvancedPlot:true},grid:{needsRegularUpdate:false,hasGrid:false,gridX:1,gridY:1,strokeColor:"#C0C0C0",strokeOpacity:"0.5",strokeWidth:1,dash:2,snapToGrid:false,snapSizeX:2,snapSizeY:2},image:{imageString:null,fillOpacity:1},incircle:{fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#C3D9FF",point:{visible:false,fixed:false,withLabel:false,name:""}},integral:{withLabel:false,strokeWidth:0,strokeOpacity:0,start:{visible:true},startproject:{visible:false,fixed:false,withLabel:false,name:""},end:{visible:true},endproject:{visible:false,fixed:false,withLabel:false,name:""},text:{fontSize:20}},legend:{style:"vertical",labels:["1","2","3","4","5","6","7","8"],colors:["#B02B2C","#3F4C6B","#C79810","#D15600","#FFFF88","#C3D9FF","#4096EE","#008C00"]},line:{firstArrow:false,lastArrow:false,straightFirst:true,straightLast:true,fillColor:"none",highlightFillColor:"none",strokeColor:"#0000ff",highlightStrokeColor:"#888888",withTicks:false,point1:{visible:false,withLabel:false,fixed:false,name:""},point2:{visible:false,withLabel:false,fixed:false,name:""},ticks:{drawLabels:true,drawZero:false,insertTicks:false,minTicksDistance:50,maxTicksDistance:300,minorHeight:4,majorHeight:-1,minorTicks:4,defaultDistance:1,strokeOpacity:0.3},labelOffsets:[10,10]},locus:{translateToOrigin:false,translateTo10:false,stretch:false,toOrigin:null,to10:null},parallel:{strokeColor:"#000000",point:{visible:false,fixed:true,withLabel:false,name:""}},perpendicular:{strokeColor:"#000000",straightFirst:false,straightLast:false,point:{visible:false,fixed:true,withLabel:false,name:""}},point:{withLabel:true,style:5,face:"o",size:3,fillColor:"#ff0000",highlightFillColor:"#EEEEEE",strokeWidth:2,strokeColor:"#ff0000",highlightStrokeColor:"#C3D9FF",zoom:false,showInfobox:true,draft:false},polygon:{fillColor:"#00FF00",highlightFillColor:"#00FF00",fillOpacity:0.3,highlightFillOpacity:0.3,withLines:true,lines:{withLabel:false,strokeWidth:1,highlightStrokeWidth:1,layer:5},points:{withLabel:true,strokeColor:"#ff0000",fillColor:"#ff0000",fixed:true}},riemannsum:{withLabel:false,fillOpacity:0.3,fillColor:"#ffff00"},sector:{fillColor:"#00FF00",highlightFillColor:"#00FF00",fillOpacity:0.3,highlightFillOpacity:0.3},slider:{snapWidth:-1,precision:2,firstArrow:false,lastArrow:false,withTicks:true,withLabel:true,point1:{needsRegularUpdate:false,showInfobox:false,withLabel:false,visible:false,fixed:true,name:""},point2:{needsRegularUpdate:false,showInfobox:false,withLabel:false,visible:false,fixed:true,name:""},glider:{showInfobox:false,name:"",withLabel:false,visible:true,strokeColor:"#000000",highlightStrokeColor:"#888888",fillColor:"#ffffff",highlightFillColor:"none",size:6},segment1:{needsRegularUpdate:false,name:"",strokeWidth:1,strokeColor:"#000000",highlightStrokeColor:"#888888"},ticks:{needsRegularUpdate:false,drawLabels:false,drawZero:true,insertTicks:true,minorHeight:4,majorHeight:10,minorTicks:0,defaultDistance:1,strokeOpacity:1,strokeWidth:1,strokeColor:"#000000"},segment2:{strokeWidth:3,name:"",strokeColor:"#000000",highlightStrokeColor:"#888888"},text:{strokeColor:"#000000"}},text:{fontSize:12,digits:2,isLabel:false,strokeColor:"#000000",useASCIIMathML:false,useMathJax:false,display:"html",withLabel:false},shortcuts:{color:["strokeColor","fillColor"],opacity:["strokeOpacity","fillOpacity"],highlightColor:["highlightStrokeColor","highlightFillColor"],highlightOpacity:["highlightStrokeOpacity","highlightFillOpacity"],strokeWidth:["strokeWidth","highlightStrokeWidth"]}};JXG.Validator=(function(){var h=function(i){return/^[0-9]+px$/.test(i)},k=function(i){return(i in {html:0,internal:0})},l=function(i){return JXG.isString(i)},j=function(i){return JXG.exists(JXG.Point.prototype.normalizeFace.call(this,i))},n=function(i){return(Math.abs(i-Math.round(i))<JXG.Math.eps)},o=function(i){return n(i)&&i>0},g=function(i){return i.length>=2&&n(i[0])&&n(i[1])},d=function(i){return(i in {vml:0,svg:0,canvas:0})},f,m={},e={color:l,defaultDistance:JXG.isNumber,display:k,doAdvancedPlot:false,draft:false,drawLabels:false,drawZero:false,face:j,factor:JXG.isNumber,fillColor:l,fillOpacity:JXG.isNumber,firstArrow:false,fontSize:n,dash:n,gridX:JXG.isNumber,gridY:JXG.isNumber,hasGrid:false,highlightFillColor:l,highlightFillOpacity:JXG.isNumber,highlightStrokeColor:l,highlightStrokeOpacity:JXG.isNumber,insertTicks:false,labelOffsets:g,lastArrow:false,majorHeight:n,maxTicksDistance:o,minorHeight:n,minorTicks:o,minTicksDistance:o,numberPointsHigh:o,numberPointsLow:o,opacity:JXG.isNumber,radius:JXG.isNumber,RDPsmoothing:false,renderer:d,right:h,showCopyright:false,showInfobox:false,showNavigation:false,size:n,snapSizeX:JXG.isNumber,snapSizeY:JXG.isNumber,snapWidth:JXG.isNumber,snapToGrid:false,straightFirst:false,straightLast:false,stretch:false,strokeColor:l,strokeOpacity:JXG.isNumber,strokeWidth:n,takeFirst:false,takeSizeFromFile:false,textColor:l,to10:false,toOrigin:false,translateTo10:false,translateToOrigin:false,useASCIIMathML:false,useDirection:false,useMathJax:false,withLabel:false,withTicks:false,zoom:false};for(f in e){m[f.toLowerCase()]=e[f]}return m})();JXG.useStandardOptions=function(h){var j=JXG.Options,g=h.hasGrid,f,e,i,d;h.options.grid.hasGrid=j.grid.hasGrid;h.options.grid.gridX=j.grid.gridX;h.options.grid.gridY=j.grid.gridY;h.options.grid.gridColor=j.grid.gridColor;h.options.grid.gridOpacity=j.grid.gridOpacity;h.options.grid.gridDash=j.grid.gridDash;h.options.grid.snapToGrid=j.grid.snapToGrid;h.options.grid.snapSizeX=j.grid.SnapSizeX;h.options.grid.snapSizeY=j.grid.SnapSizeY;h.takeSizeFromFile=j.takeSizeFromFile;d=function(k,l){k.visProp.fillcolor=l.fillColor;k.visProp.highlightfillcolor=l.highlightFillColor;k.visProp.strokecolor=l.strokeColor;k.visProp.highlightstrokecolor=l.highlightStrokeColor};for(f in h.objects){i=h.objects[f];if(i.elementClass==JXG.OBJECT_CLASS_POINT){d(i,j.point)}else{if(i.elementClass==JXG.OBJECT_CLASS_LINE){d(i,j.line);for(e in i.ticks){e.majorTicks=j.line.ticks.majorTicks;e.minTicksDistance=j.line.ticks.minTicksDistance;e.visProp.minorheight=j.line.ticks.minorHeight;e.visProp.majorheight=j.line.ticks.majorHeight}}else{if(i.elementClass==JXG.OBJECT_CLASS_CIRCLE){d(i,j.circle)}else{if(i.type==JXG.OBJECT_TYPE_ANGLE){d(i,j.angle)}else{if(i.type==JXG.OBJECT_TYPE_ARC){d(i,j.arc)}else{if(i.type==JXG.OBJECT_TYPE_POLYGON){d(i,j.polygon)}else{if(i.type==JXG.OBJECT_TYPE_CONIC){d(i,j.conic)}else{if(i.type==JXG.OBJECT_TYPE_CURVE){d(i,j.curve)}else{if(i.type==JXG.OBJECT_TYPE_SECTOR){i.arc.visProp.fillcolor=j.sector.fillColor;i.arc.visProp.highlightfillcolor=j.sector.highlightFillColor;i.arc.visProp.fillopacity=j.sector.fillOpacity;i.arc.visProp.highlightfillopacity=j.sector.highlightFillOpacity}}}}}}}}}}h.fullUpdate();if(g&&!h.hasGrid){h.removeGrids(h)}else{if(!g&&h.hasGrid){h.create("grid",[])}}};JXG.useBlackWhiteOptions=function(d){var e=JXG.Options;e.point.fillColor=JXG.rgb2bw(e.point.fillColor);e.point.highlightFillColor=JXG.rgb2bw(e.point.highlightFillColor);e.point.strokeColor=JXG.rgb2bw(e.point.strokeColor);e.point.highlightStrokeColor=JXG.rgb2bw(e.point.highlightStrokeColor);e.line.fillColor=JXG.rgb2bw(e.line.fillColor);e.line.highlightFillColor=JXG.rgb2bw(e.line.highlightFillColor);e.line.strokeColor=JXG.rgb2bw(e.line.strokeColor);e.line.highlightStrokeColor=JXG.rgb2bw(e.line.highlightStrokeColor);e.circle.fillColor=JXG.rgb2bw(e.circle.fillColor);e.circle.highlightFillColor=JXG.rgb2bw(e.circle.highlightFillColor);e.circle.strokeColor=JXG.rgb2bw(e.circle.strokeColor);e.circle.highlightStrokeColor=JXG.rgb2bw(e.circle.highlightStrokeColor);e.arc.fillColor=JXG.rgb2bw(e.arc.fillColor);e.arc.highlightFillColor=JXG.rgb2bw(e.arc.highlightFillColor);e.arc.strokeColor=JXG.rgb2bw(e.arc.strokeColor);e.arc.highlightStrokeColor=JXG.rgb2bw(e.arc.highlightStrokeColor);e.polygon.fillColor=JXG.rgb2bw(e.polygon.fillColor);e.polygon.highlightFillColor=JXG.rgb2bw(e.polygon.highlightFillColor);e.sector.fillColor=JXG.rgb2bw(e.sector.fillColor);e.sector.highlightFillColor=JXG.rgb2bw(e.sector.highlightFillColor);e.curve.strokeColor=JXG.rgb2bw(e.curve.strokeColor);e.grid.gridColor=JXG.rgb2bw(e.grid.gridColor);JXG.useStandardOptions(d)};JXG.JSXGraph={licenseText:"JSXGraph v0.92 Copyright (C) see http://jsxgraph.org",boards:{},elements:{},rendererType:(function(){var f,d;if(JXG.supportsSVG()){JXG.Options.renderer="svg"}else{if(JXG.supportsVML()){JXG.Options.renderer="vml";function e(){document.body.scrollLeft;document.body.scrollTop}document.onmousemove=e}else{JXG.Options.renderer="canvas"}}d=JXG.rendererFiles[JXG.Options.renderer].split(",");for(f=0;f<d.length;f++){(function(g){JXG.require(JXG.requirePath+g+".js")})(d[f])}return JXG.Options.renderer})(),initBoard:function(g,e){var l,u,t,o,m,q,f,d,s,r,p,n,k,i,j;d=JXG.getDimensions(g);if(typeof e=="undefined"){e={}}if(typeof e.boundingbox!="undefined"){s=e.boundingbox;q=parseInt(d.width);f=parseInt(d.height);if(e.keepaspectratio){o=q/(s[2]-s[0]);m=f/(-s[3]+s[1]);if(o<m){m=o}else{o=m}}else{o=q/(s[2]-s[0]);m=f/(-s[3]+s[1])}u=-o*s[0];t=m*s[1]}else{u=((typeof e.originX)=="undefined"?150:e.originX);t=((typeof e.originY)=="undefined"?150:e.originY);o=((typeof e.unitX)=="undefined"?50:e.unitX);m=((typeof e.unitY)=="undefined"?50:e.unitY)}r=((typeof e.zoom)=="undefined"?1:e.zoom);p=r*((typeof e.zoomX)=="undefined"?1:e.zoomX);n=r*((typeof e.zoomY)=="undefined"?1:e.zoomY);k=((typeof e.showCopyright)=="undefined"?JXG.Options.showCopyright:e.showCopyright);if(JXG.Options.renderer=="svg"){l=new JXG.SVGRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="vml"){l=new JXG.VMLRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="silverlight"){l=new JXG.SilverlightRenderer(document.getElementById(g),d.width,d.height)}else{l=new JXG.CanvasRenderer(document.getElementById(g))}}}j=new JXG.Board(g,l,"",[u,t],p,n,o,m,d.width,d.height,k);this.boards[j.id]=j;j.keepaspectratio=e.keepaspectratio;j.suspendUpdate();j.initInfobox();if(e.axis){j.defaultAxes={};j.defaultAxes.x=j.create("axis",[[0,0],[1,0]],{ticks:{drawZero:true}});j.defaultAxes.y=j.create("axis",[[0,0],[0,1]],{ticks:{drawZero:false}})}if(e.grid){j.create("grid",[])}if(typeof e.shownavigation!="undefined"){e.showNavigation=e.shownavigation}i=((typeof e.showNavigation)=="undefined"?j.options.showNavigation:e.showNavigation);if(i){j.renderer.drawZoomBar(j)}j.unsuspendUpdate();return j},loadBoardFromFile:function(g,d,i){var h,e,f;if(JXG.Options.renderer=="svg"){h=new JXG.SVGRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="vml"){h=new JXG.VMLRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="silverlight"){h=new JXG.SilverlightRenderer(document.getElementById(g),f.width,f.height)}else{h=new JXG.CanvasRenderer(document.getElementById(g))}}}f=JXG.getDimensions(g);e=new JXG.Board(g,h,"",[150,150],1,1,50,50,f.width,f.height);e.initInfobox();JXG.FileReader.parseFileContent(d,e,i);if(e.options.showNavigation){e.renderer.drawZoomBar(e)}this.boards[e.id]=e;return e},loadBoardFromString:function(g,d,i){var h,f,e;if(JXG.Options.renderer=="svg"){h=new JXG.SVGRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="vml"){h=new JXG.VMLRenderer(document.getElementById(g))}else{if(JXG.Options.renderer=="silverlight"){h=new JXG.SilverlightRenderer(document.getElementById(g),f.width,f.height)}else{h=new JXG.CanvasRenderer(document.getElementById(g))}}}f=JXG.getDimensions(g);e=new JXG.Board(g,h,"",[150,150],1,1,50,50,f.width,f.height);e.initInfobox();JXG.FileReader.parseString(d,e,i,true);if(e.options.showNavigation){e.renderer.drawZoomBar(e)}this.boards[e.id]=e;return e},freeBoard:function(f){var e,d;if(typeof(f)=="string"){f=this.boards[f]}f.removeEventHandlers();for(e in f.objects){f.removeObject(f.objects[e])}for(d=0;d<f.containerObj.childNodes.length;d++){f.containerObj.removeChild(f.containerObj.childNodes[d])}for(e in f.objects){delete (f.objects[e])}delete (f.renderer);delete (f.algebra);delete (this.boards[f.id])},registerElement:function(d,e){d=d.toLowerCase();this.elements[d]=e;if(JXG.Board.prototype["_"+d]){throw new Error("JSXGraph: Can't create wrapper method in JXG.Board because member '_"+d+"' already exists'")}JXG.Board.prototype["_"+d]=function(g,f){return this.create(d,g,f)}},unregisterElement:function(d){delete (this.elements[d.toLowerCase()]);delete (JXG.Board.prototype["_"+d.toLowerCase()])}};JXG.OBJECT_TYPE_ARC=1330921795;JXG.OBJECT_TYPE_ARROW=1330921815;JXG.OBJECT_TYPE_AXIS=1330921816;JXG.OBJECT_TYPE_AXISPOINT=83181904;JXG.OBJECT_TYPE_TICKS=1330926680;JXG.OBJECT_TYPE_CIRCLE=1330922316;JXG.OBJECT_TYPE_CONIC=1330922319;JXG.OBJECT_TYPE_CURVE=1330923344;JXG.OBJECT_TYPE_GLIDER=1330923340;JXG.OBJECT_TYPE_IMAGE=1330926157;JXG.OBJECT_TYPE_LINE=1330924622;JXG.OBJECT_TYPE_POINT=1330925652;JXG.OBJECT_TYPE_SLIDER=1330926404;JXG.OBJECT_TYPE_CAS=1330922320;JXG.OBJECT_TYPE_POLYGON=1330925657;JXG.OBJECT_TYPE_SECTOR=1330926403;JXG.OBJECT_TYPE_TEXT=1330926661;JXG.OBJECT_TYPE_ANGLE=1330921799;JXG.OBJECT_TYPE_INTERSECTION=1330926158;JXG.OBJECT_TYPE_TURTLE=5198933;JXG.OBJECT_TYPE_VECTOR=1330927188;JXG.OBJECT_CLASS_POINT=1;JXG.OBJECT_CLASS_LINE=2;JXG.OBJECT_CLASS_CIRCLE=3;JXG.OBJECT_CLASS_CURVE=4;JXG.OBJECT_CLASS_AREA=5;JXG.OBJECT_CLASS_OTHER=6;JXG.GeometryElement=function(h,d,g,i){var e,f;this.needsUpdate=true;this.isDraggable=false;this.isReal=true;this.childElements={};this.hasLabel=false;this.notExistingParents={};this.traces={};this.numTraces=0;this.transformations=[];this.baseElement=null;this.descendants={};this.ancestors={};this.symbolic={};this.stdform=[1,0,0,0,1,1,0,0];this.quadraticform=[[1,0,0],[0,1,0],[0,0,1]];if(arguments.length>0){this.board=h;this.type=g;this.elementClass=i||JXG.OBJECT_CLASS_OTHER;this.id=d.id;e=d.name;if(!JXG.exists(e)){e=this.board.generateName(this)}this.board.elementsByName[e]=this;this.name=e;this.needsRegularUpdate=d.needsregularupdate;this.visProp={};JXG.clearVisPropOld(this);d=this.resolveShortcuts(d);for(f in d){this._set(f,d[f])}this.visProp.draft=d.draft&&d.draft.draft;this.visProp.gradientangle="270";this.visProp.gradientsecondopacity=this.visProp.fillopacity;this.visProp.gradientpositionx=0.5;this.visProp.gradientpositiony=0.5}};JXG.extend(JXG.GeometryElement.prototype,{addChild:function(f){var e,d;this.childElements[f.id]=f;this.addDescendants(f);f.ancestors[this.id]=this;for(e in this.descendants){this.descendants[e].ancestors[this.id]=this;for(d in this.ancestors){this.descendants[e].ancestors[this.ancestors[d].id]=this.ancestors[d]}}for(e in this.ancestors){for(d in this.descendants){this.ancestors[e].descendants[this.descendants[d].id]=this.descendants[d]}}return this},addDescendants:function(e){var d;this.descendants[e.id]=e;for(d in e.childElements){this.addDescendants(e.childElements[d])}return this},countChildren:function(){var g,e=0,f;f=this.childElements;for(g in f){if(f.hasOwnProperty(g)&&g.indexOf("Label")<0){e++}}return e},draggable:function(){if(this.isDraggable&&!this.visProp.fixed&&!this.visProp.frozen&&this.type!=JXG.OBJECT_TYPE_GLIDER&&this.countChildren()<=1){return true}else{return false}},generatePolynomial:function(){return[]},animate:function(g,f,o){o=o||{};var d,e,j=35,k=Math.ceil(f/(j*1)),h,m=this;this.animationData={};var n=function(v,u,s){var t,r,q,p,i;t=JXG.rgb2hsv(v);r=JXG.rgb2hsv(u);q=(r[0]-t[0])/(1*k);p=(r[1]-t[1])/(1*k);i=(r[2]-t[2])/(1*k);m.animationData[s]=new Array(k);for(h=0;h<k;h++){m.animationData[s][k-h-1]=JXG.hsv2rgb(t[0]+(h+1)*q,t[1]+(h+1)*p,t[2]+(h+1)*i)}},l=function(r,i,q){r=parseFloat(r);i=parseFloat(i);if(isNaN(r)||isNaN(i)){return}var p=(i-r)/(1*k);m.animationData[q]=new Array(k);for(h=0;h<k;h++){m.animationData[q][k-h-1]=r+(h+1)*p}};for(d in g){e=d.toLowerCase();switch(e){case"strokecolor":case"fillcolor":n(this.visProp[e],g[d],e);break;case"strokeopacity":case"strokewidth":case"fillopacity":l(this.visProp[e],g[d],e);break}}this.animationCallback=o.callback;this.board.addAnimation(this);return this},update:function(){if(this.visProp.trace){this.cloneToBackground(true)}return this},updateRenderer:function(){return this},hideElement:function(){this.visProp.visible=false;this.board.renderer.hide(this);if(this.label!=null&&this.hasLabel){this.label.hiddenByParent=true;if(this.label.content.visProp.visible){this.board.renderer.hide(this.label.content)}}return this},showElement:function(){this.visProp.visible=true;this.board.renderer.show(this);if(this.label!=null&&this.hasLabel&&this.label.hiddenByParent){this.label.hiddenByParent=false;if(this.label.content.visProp.visible){this.board.renderer.show(this.label.content)}}return this},_set:function(e,d){e=e.toLocaleLowerCase();if(this.visProp.hasOwnProperty(e)&&e.indexOf("color")>=0&&JXG.isString(d)&&d.length==9&&d.charAt(0)==="#"){d=JXG.rgba2rgbo(d);this.visProp[e]=d[0];this.visProp[e.replace("color","opacity")]=d[1]}else{this.visProp[e]=d}},resolveShortcuts:function(f){var e,d;for(e in JXG.Options.shortcuts){if(JXG.exists(f[e])){for(d=0;d<JXG.Options.shortcuts[e].length;d++){if(!JXG.exists(f[JXG.Options.shortcuts[e][d]])){f[JXG.Options.shortcuts[e][d]]=f[e]}}}}return f},setAttribute:JXG.shortcut(JXG.GeometryElement.prototype,"setProperty"),setProperty:function(){var h,g,j,d,e,k,f={};for(h=0;h<arguments.length;h++){d=arguments[h];if(JXG.isString(d)){k=d.split(":");f[JXG.trim(k[0])]=JXG.trim(k[1])}else{if(!JXG.isArray(d)){JXG.extend(f,d)}else{f[d[0]]=d[1]}}}f=this.resolveShortcuts(f);for(h in f){g=h.replace(/\s+/g,"").toLowerCase();j=f[h];switch(g){case"name":delete this.board.elementsByName[this.name];this.name=j;this.board.elementsByName[this.name]=this;break;case"needsregularupdate":this.needsRegularUpdate=!(j=="false"||j==false);this.board.renderer.setBuffering(this,this.needsRegularUpdate?"auto":"static");break;case"labelcolor":j=JXG.rgba2rgbo(j);e=j[1];j=j[0];if(e==0){if(this.label!=null&&this.hasLabel){this.label.content.hideElement()}}if(this.label!=null&&this.hasLabel){this.label.color=j;this.board.renderer.setObjectStrokeColor(this.label.content,j,e)}if(this.type==JXG.OBJECT_TYPE_TEXT){this.visProp.strokecolor=j;this.visProp.strokeopacity=e;this.board.renderer.setObjectStrokeColor(this,this.visProp.strokecolor,this.visProp.strokeopacity)}break;case"infoboxtext":if(typeof(j)=="string"){this.infoboxText=j}else{this.infoboxText=false}break;case"visible":if(j=="false"||j==false){this.visProp.visible=false;this.hideElement()}else{if(j=="true"||j==true){this.visProp.visible=true;this.showElement()}}break;case"face":if(this.elementClass==JXG.OBJECT_CLASS_POINT){this.visProp.face=j;this.board.renderer.changePointStyle(this)}break;case"gradient":this.visProp.gradient=j;this.board.renderer.setGradient(this);break;case"gradientsecondcolor":j=JXG.rgba2rgbo(j);this.visProp.gradientsecondcolor=j[1];this.visProp.gradientsecondopacity=j[0];this.board.renderer.updateGradient(this);break;case"gradientsecondopacity":this.visProp.gradientsecondopacity=j;this.board.renderer.updateGradient(this);break;case"withlabel":this.visProp.withlabel=j;if(!j){if(JXG.exists(this.label)&&this.hasLabel){this.label.content.hideElement()}}else{if(this.label!=null&&this.hasLabel){if(this.visProp.visible){this.label.content.showElement()}}else{this.createLabel();if(!this.visProp.visible){this.label.content.hideElement()}}}this.hasLabel=j;break;default:if(JXG.exists(this.visProp[g])&&(!JXG.Validator[g]||(JXG.Validator[g]&&JXG.Validator[g](j)))){j=j.toLowerCase&&j.toLowerCase()==="false"?false:j;this._set(g,j)}break}}this.board.update(this);return this},getAttribute:JXG.shortcut(JXG.GeometryElement.prototype,"getProperty"),getProperty:function(e){var d;e=e.toLowerCase();switch(e){case"needsregularupdate":d=this.needsRegularUpdate;break;case"labelcolor":d=this.label.color;break;case"infoboxtext":d=this.infoboxText;break;case"withlabel":d=this.hasLabel;break;default:d=this.visProp[e];break}return d},setDash:function(d){this.setProperty({dash:d});return this},prepareUpdate:function(){this.needsUpdate=true;return this},remove:function(){this.board.renderer.remove(this.board.renderer.getElementById(this.id));if(this.hasLabel){this.board.renderer.remove(this.board.renderer.getElementById(this.label.content.id))}return this},getTextAnchor:function(){return new JXG.Coords(JXG.COORDS_BY_USER,[0,0],this.board)},getLabelAnchor:function(){return new JXG.Coords(JXG.COORDS_BY_USER,[0,0],this.board)},setStraight:function(d,e){return this},setArrow:function(e,d){this.visProp.firstarrow=e;this.visProp.lastarrow=d;this.prepareUpdate().update();return this},createGradient:function(){if(this.visProp.gradient==="linear"||this.visProp.gradient==="radial"){this.board.renderer.setGradient(this)}},createLabel:function(d){if(!JXG.exists(d)){d=[10,10]}this.nameHTML=JXG.GeonextParser.replaceSup(JXG.GeonextParser.replaceSub(this.name));this.label={};if(this.visProp.withlabel){this.label.relativeCoords=d;this.label.content=JXG.createText(this.board,[this.label.relativeCoords[0],-this.label.relativeCoords[1],this.nameHTML],{anchor:this,id:this.id+"Label",isLabel:true,visible:this.visProp.visible,strokeColor:this.visProp.labelcolor||this.board.options.text.strokeColor});this.label.color=this.label.content.visProp.strokecolor;if(!this.visProp.visible){this.label.hiddenByParent=true;this.label.content.visProp.visible=false}this.hasLabel=true}return this},highlight:function(){this.board.renderer.highlight(this);return this},noHighlight:function(){this.board.renderer.noHighlight(this);return this},clearTrace:function(){var d;for(d in this.traces){this.board.renderer.remove(this.traces[d])}this.numTraces=0;return this},cloneToBackground:function(){return this},bounds:function(){},normalize:function(){this.stdform=JXG.Math.normalize(this.stdform);return this},toJSON:function(){var e='{"name":'+this.name;e+=', "id":'+this.id;var f=[];for(var d in this.visProp){if(this.visProp[d]!=null){f.push('"'+d+'":'+this.visProp[d])}}e+=', "visProp":{'+f.toString()+"}";e+="}";return e},highlightStrokeColor:function(d){this.setProperty({highlightStrokeColor:d});return this},strokeColor:function(d){this.setProperty({strokeColor:d});return this},strokeWidth:function(d){this.setProperty({strokeWidth:d});return this},fillColor:function(d){this.setProperty({fillColor:d});return this},highlightFillColor:function(d){this.setProperty({highlightFillColor:d});return this},labelColor:function(d){this.setProperty({labelColor:d});return this},dash:function(e){this.setProperty({dash:e});return this},visible:function(d){this.setProperty({visible:d});return this},shadow:function(d){this.setProperty({shadow:d});return this}});JXG.clearVisPropOld=function(d){d.visPropOld={strokecolor:"",strokeopacity:"",strokewidth:"",fillcolor:"",fillopacity:"",shadow:false,firstarrow:false,lastarrow:false}};JXG.COORDS_BY_USER=1;JXG.COORDS_BY_SCREEN=2;JXG.Coords=function(f,e,d){this.board=d;this.usrCoords=[];this.scrCoords=[];this.setCoordinates(f,e)};JXG.extend(JXG.Coords.prototype,{normalizeUsrCoords:function(){var d=JXG.Math.eps;if(Math.abs(this.usrCoords[0])>d){this.usrCoords[1]/=this.usrCoords[0];this.usrCoords[2]/=this.usrCoords[0];this.usrCoords[0]=1}},usr2screen:function(h){var g=Math.round,d=this.board,f=this.usrCoords,e=d.origin.scrCoords;if(h===null||h){this.scrCoords[0]=g(f[0]);this.scrCoords[1]=g(f[0]*e[1]+f[1]*d.unitX);this.scrCoords[2]=g(f[0]*e[2]-f[2]*d.unitY)}else{this.scrCoords[0]=f[0];this.scrCoords[1]=f[0]*e[1]+f[1]*d.unitX;this.scrCoords[2]=f[0]*e[2]-f[2]*d.unitY}},screen2usr:function(){var f=this.board.origin.scrCoords,e=this.scrCoords,d=this.board;this.usrCoords[0]=1;this.usrCoords[1]=(e[1]-f[1])/d.unitX;this.usrCoords[2]=(f[2]-e[2])/d.unitY},distance:function(e,j){var g=0,k,d=this.usrCoords,i=this.scrCoords,h;if(e===JXG.COORDS_BY_USER){k=j.usrCoords;h=d[0]-k[0];g=h*h;h=d[1]-k[1];g+=h*h;h=d[2]-k[2];g+=h*h}else{k=j.scrCoords;h=i[0]-k[0];g=h*h;h=i[1]-k[1];g+=h*h;h=i[2]-k[2];g+=h*h}return Math.sqrt(g)},setCoordinates:function(e,h,f){var d=this.usrCoords,g=this.scrCoords;if(e===JXG.COORDS_BY_USER){if(h.length===2){d[0]=1;d[1]=h[0];d[2]=h[1]}else{d[0]=h[0];d[1]=h[1];d[2]=h[2];this.normalizeUsrCoords()}this.usr2screen(f)}else{g[1]=h[0];g[2]=h[1];this.screen2usr()}}});JXG.Point=function(e,f,d){this.constructor(e,d,JXG.OBJECT_TYPE_POINT,JXG.OBJECT_CLASS_POINT);if(f==null){f=[0,0]}this.coords=new JXG.Coords(JXG.COORDS_BY_USER,f,this.board);this.initialCoords=new JXG.Coords(JXG.COORDS_BY_USER,f,this.board);this.position=null;this.onPolygon=false;this.slideObject=null;this.group=[];this.id=this.board.setId(this,"P");this.board.renderer.drawPoint(this);this.board.finalizeAdding(this);this.createLabel()};JXG.Point.prototype=new JXG.GeometryElement();JXG.extend(JXG.Point.prototype,{hasPoint:function(e,g){var d=this.coords.scrCoords,f;f=parseFloat(this.visProp.size);if(f<this.board.options.precision.hasPoint){f=this.board.options.precision.hasPoint}return((Math.abs(d[1]-e)<f+2)&&(Math.abs(d[2]-g))<f+2)},updateConstraint:function(){return this},update:function(h){var j,g,l,m,r,e,k,q,f,p,n,s,o,d;if(!this.needsUpdate){return this}if(typeof h=="undefined"){h=false}if(this.visProp.trace){this.cloneToBackground(true)}if(this.type==JXG.OBJECT_TYPE_GLIDER){if(this.slideObject.elementClass==JXG.OBJECT_CLASS_CIRCLE){if(h){this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.slideObject.midpoint.X()+Math.cos(this.position),this.slideObject.midpoint.Y()+Math.sin(this.position)]);this.coords=JXG.Math.Geometry.projectPointToCircle(this,this.slideObject,this.board)}else{this.coords=JXG.Math.Geometry.projectPointToCircle(this,this.slideObject,this.board);this.position=JXG.Math.Geometry.rad([this.slideObject.midpoint.X()+1,this.slideObject.midpoint.Y()],this.slideObject.midpoint,this)}}else{if(this.slideObject.elementClass==JXG.OBJECT_CLASS_LINE){this.coords=JXG.Math.Geometry.projectPointToLine(this,this.slideObject,this.board);g=this.slideObject.point1.coords;l=this.slideObject.point2.coords;if(h){if(Math.abs(g.usrCoords[0])>=JXG.Math.eps&&Math.abs(l.usrCoords[0])>=JXG.Math.eps){this.coords.setCoordinates(JXG.COORDS_BY_USER,[g.usrCoords[1]+this.position*(l.usrCoords[1]-g.usrCoords[1]),g.usrCoords[2]+this.position*(l.usrCoords[2]-g.usrCoords[2])])}}else{m=1;r=g.distance(JXG.COORDS_BY_USER,this.coords);e=g.distance(JXG.COORDS_BY_USER,l);k=l.distance(JXG.COORDS_BY_USER,this.coords);if(((r>e)||(k>e))&&(r<k)){m=-1}this.position=m*r/e;if(this.visProp.snapwidth>0&&Math.abs(this._smax-this._smin)>=JXG.Math.eps){if(this.position<0){this.position=0}if(this.position>1){this.position=1}q=this.position*(this._smax-this._smin)+this._smin;q=Math.round(q/this.visProp.snapwidth)*this.visProp.snapwidth;this.position=(q-this._smin)/(this._smax-this._smin);this.update(true)}}f=this.slideObject.point1.coords.scrCoords;p=this.slideObject.point2.coords.scrCoords;if(this.slideObject.getSlope()==0){j=1}else{j=2}n=this.coords.scrCoords[j];if(!this.slideObject.visProp.straightfirst){if(f[j]<p[j]){if(n<f[j]){this.coords=this.slideObject.point1.coords;this.position=0}}else{if(f[j]>p[j]){if(n>f[j]){this.coords=this.slideObject.point1.coords;this.position=0}}}}if(!this.slideObject.visProp.straightlast){if(f[j]<p[j]){if(n>p[j]){this.coords=this.slideObject.point2.coords;this.position=1}}else{if(f[j]>p[j]){if(n<p[j]){this.coords=this.slideObject.point2.coords;this.position=1}}}}if(this.onPolygon){s=this.slideObject.point1.coords;o=this.slideObject.point2.coords;if(Math.abs(this.coords.scrCoords[1]-s.scrCoords[1])<this.board.options.precision.hasPoint&&Math.abs(this.coords.scrCoords[2]-s.scrCoords[2])<this.board.options.precision.hasPoint){d=this.slideObject.parentPolygon;for(j=0;j<d.borders.length;j++){if(this.slideObject==d.borders[j]){this.slideObject=d.borders[(j-1+d.borders.length)%d.borders.length];break}}}else{if(Math.abs(this.coords.scrCoords[1]-o.scrCoords[1])<this.board.options.precision.hasPoint&&Math.abs(this.coords.scrCoords[2]-o.scrCoords[2])<this.board.options.precision.hasPoint){d=this.slideObject.parentPolygon;for(j=0;j<d.borders.length;j++){if(this.slideObject==d.borders[j]){this.slideObject=d.borders[(j+1+d.borders.length)%d.borders.length];break}}}}}}else{if(this.slideObject.type==JXG.OBJECT_TYPE_TURTLE){this.updateConstraint();this.coords=JXG.Math.Geometry.projectPointToTurtle(this,this.slideObject,this.board)}else{if(this.slideObject.elementClass==JXG.OBJECT_CLASS_CURVE){this.updateConstraint();this.coords=JXG.Math.Geometry.projectPointToCurve(this,this.slideObject,this.board)}}}}}if(this.type==JXG.OBJECT_TYPE_CAS){this.updateConstraint()}this.updateTransform();return this},updateRenderer:function(){if(!this.needsUpdate){return this}if(this.visProp.visible){var d=this.isReal;this.isReal=(!isNaN(this.coords.usrCoords[1]+this.coords.usrCoords[2]));this.isReal=(Math.abs(this.coords.usrCoords[0])>JXG.Math.eps)?this.isReal:false;if(this.isReal){if(d!=this.isReal){this.board.renderer.show(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.show(this.label.content)}}this.board.renderer.updatePoint(this)}else{if(d!=this.isReal){this.board.renderer.hide(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.hide(this.label.content)}}}}if(this.hasLabel&&this.visProp.visible&&this.label.content&&this.label.content.visProp.visible&&this.isReal){this.label.content.update();this.board.renderer.updateText(this.label.content)}this.needsUpdate=false;return this},X:function(){return this.coords.usrCoords[1]},Y:function(){return this.coords.usrCoords[2]},Z:function(){return this.coords.usrCoords[0]},XEval:function(){return this.coords.usrCoords[1]},YEval:function(){return this.coords.usrCoords[2]},ZEval:function(){return this.coords.usrCoords[0]},bounds:function(){return this.coords.usrCoords.slice(1).concat(this.coords.usrCoords.slice(1))},Dist:function(e){var g,i=e.coords.usrCoords,d=this.coords.usrCoords,h;h=d[0]-i[0];g=h*h;h=d[1]-i[1];g+=h*h;h=d[2]-i[2];g+=h*h;return Math.sqrt(g)},setPositionDirectly:function(d,k,h){var g,n,m,f,e,j=this.coords,l;this.coords=new JXG.Coords(d,[k,h],this.board);if(this.group.length!=0){n=this.coords.usrCoords[1]-j.usrCoords[1];m=this.coords.usrCoords[2]-j.usrCoords[2];for(g=0;g<this.group.length;g++){for(f in this.group[g].objects){e=this.group[g].objects[f];e.initialCoords=new JXG.Coords(JXG.COORDS_BY_USER,[e.initialCoords.usrCoords[1]+n,e.initialCoords.usrCoords[2]+m],this.board)}}this.group[this.group.length-1].dX=this.coords.scrCoords[1]-j.scrCoords[1];this.group[this.group.length-1].dY=this.coords.scrCoords[2]-j.scrCoords[2];this.group[this.group.length-1].update(this)}else{for(g=this.transformations.length-1;g>=0;g--){if(d==JXG.COORDS_BY_SCREEN){l=(new JXG.Coords(d,[k,h],this.board)).usrCoords}else{l=[1,k,h]}this.initialCoords=new JXG.Coords(JXG.COORDS_BY_USER,JXG.Math.matVecMult(JXG.Math.inverse(this.transformations[g].matrix),l),this.board)}this.update()}return this},setPositionByTransform:function(g,d,f){var e=this.board.create("transform",[d,f],{type:"translate"});if(this.transformations.length>0&&this.transformations[this.transformations.length-1].isNumericMatrix){this.transformations[this.transformations.length-1].melt(e)}else{this.addTransform(this,e)}if(this.group.length==0){this.update()}return this},setPosition:function(f,d,e){this.setPositionDirectly(f,d,e);return this},makeGlider:function(d){this.slideObject=JXG.getReference(this.board,d);this.type=JXG.OBJECT_TYPE_GLIDER;this.visProp.snapwidth=-1;this.slideObject.addChild(this);this.isDraggable=true;this.generatePolynomial=function(){return this.slideObject.generatePolynomial(this)};return this},addConstraint:function(h){this.type=JXG.OBJECT_TYPE_CAS;var j=this.board.elementsByName;var k=[];var d;this.isDraggable=false;for(var g=0;g<h.length;g++){var e=h[g];if(typeof e=="string"){var f=JXG.GeonextParser.geonext2JS(e,this.board);k[g]=new Function("","return "+f+";")}else{if(typeof e=="function"){k[g]=e}else{if(typeof e=="number"){k[g]=function(i){return function(){return i}}(e)}else{if(typeof e=="object"&&typeof e.Value=="function"){k[g]=(function(i){return function(){return i.Value()}})(e)}}}}}if(h.length==1){this.updateConstraint=function(){var i=k[0]();if(JXG.isArray(i)){this.coords.setCoordinates(JXG.COORDS_BY_USER,i)}else{this.coords=i}}}else{if(h.length==2){this.XEval=k[0];this.YEval=k[1];d="this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.XEval(),this.YEval()]);";this.updateConstraint=new Function("",d)}else{this.ZEval=k[0];this.XEval=k[1];this.YEval=k[2];d="this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.ZEval(),this.XEval(),this.YEval()]);";this.updateConstraint=new Function("",d)}}return this},updateTransform:function(){if(this.transformations.length==0||this.baseElement==null){return}var e,d;if(this===this.baseElement){e=this.transformations[0].apply(this.baseElement,"self")}else{e=this.transformations[0].apply(this.baseElement)}this.coords.setCoordinates(JXG.COORDS_BY_USER,e);for(d=1;d<this.transformations.length;d++){this.coords.setCoordinates(JXG.COORDS_BY_USER,this.transformations[d].apply(this))}return this},addTransform:function(g,e){var h,f,d;if(this.transformations.length==0){this.baseElement=g}if(JXG.isArray(e)){h=e}else{h=[e]}d=h.length;for(f=0;f<d;f++){this.transformations.push(h[f])}return this},startAnimation:function(d,e){if((this.type==JXG.OBJECT_TYPE_GLIDER)&&(typeof this.intervalCode=="undefined")){this.intervalCode=window.setInterval("JXG.JSXGraph.boards['"+this.board.id+"'].objects['"+this.id+"']._anim("+d+", "+e+")",250);if(typeof this.intervalCount=="undefined"){this.intervalCount=0}}return this},stopAnimation:function(){if(typeof this.intervalCode!="undefined"){window.clearInterval(this.intervalCode);delete (this.intervalCode)}return this},moveAlong:function(m,e,n){n=n||{};var l=[],h=35,j=function(p,o){return function(){return m[p][o]}},d=[],g,f,k=e/h;if(JXG.isArray(m)){for(g=0;g<m.length;g++){if(JXG.isPoint(m[g])){d[g]=m[g]}else{d[g]={elementClass:JXG.OBJECT_CLASS_POINT,X:j(g,0),Y:j(g,1)}}}e=e||0;if(e===0){this.setPosition(JXG.COORDS_BY_USER,d[d.length-1].X(),d[d.length-1].Y());return this.board.update(this)}f=JXG.Math.Numerics.Neville(d);for(g=0;g<k;g++){l[g]=[];l[g][0]=f[0]((k-g)/k*f[3]());l[g][1]=f[1]((k-g)/k*f[3]())}this.animationPath=l}else{if(JXG.isFunction(m)){this.animationPath=m;this.animationStart=new Date().getTime()}}this.animationCallback=n.callback;this.board.addAnimation(this);return this},moveTo:function(k,f,p){if(typeof f=="undefined"||f==0){this.setPosition(JXG.COORDS_BY_USER,k[0],k[1]);return this.board.update(this)}p=p||{};var l=35,m=Math.ceil(f/(l*1)),n=new Array(m+1),e=this.coords.usrCoords[1],d=this.coords.usrCoords[2],h=(k[0]-e),g=(k[1]-d),j,o=function(q){if(p.effect&&p.effect=="<>"){return Math.pow(Math.sin((q/(m*1))*Math.PI/2),2)}return q/m};if(Math.abs(h)<JXG.Math.eps&&Math.abs(g)<JXG.Math.eps){return this}for(j=m;j>=0;j--){n[m-j]=[e+h*o(j),d+g*o(j)]}this.animationPath=n;this.animationCallback=p.callback;this.board.addAnimation(this);return this},visit:function(m,f,r){if(typeof r=="number"){r={repeat:r}}else{r=r||{};if(typeof r.repeat=="undefined"){r.repeat=1}}var n=35,o=Math.ceil(f/(n*1)),p=new Array(repeat*(o+1)),e=this.coords.usrCoords[1],d=this.coords.usrCoords[2],k=(m[0]-e),g=(m[1]-d),l,h,q=function(j){if(r.effect&&r.effect=="<>"){return Math.pow(Math.sin((j/(o*1))*Math.PI/2),2)}return j/o};for(h=0;h<r.repeat;h++){for(l=o;l>=0;l--){p[h*(o+1)+o-l]=[e+k*q(l),d+g*q(l)]}}this.animationPath=p;this.animationCallback=r.callback;this.board.addAnimation(this);return this},_anim:function(n,i){var e,l,j,h,g,f,m=1,d,k;this.intervalCount++;if(this.intervalCount>i){this.intervalCount=0}if(this.slideObject.elementClass==JXG.OBJECT_CLASS_LINE){e=this.slideObject.point1.coords.distance(JXG.COORDS_BY_SCREEN,this.slideObject.point2.coords);l=this.slideObject.getSlope();if(l!="INF"){g=Math.atan(l);j=Math.round((this.intervalCount/i)*e*Math.cos(g));h=Math.round((this.intervalCount/i)*e*Math.sin(g))}else{j=0;h=Math.round((this.intervalCount/i)*e)}if(n<0){f=this.slideObject.point2;if(this.slideObject.point2.coords.scrCoords[1]-this.slideObject.point1.coords.scrCoords[1]>0){m=-1}else{if(this.slideObject.point2.coords.scrCoords[1]-this.slideObject.point1.coords.scrCoords[1]==0){if(this.slideObject.point2.coords.scrCoords[2]-this.slideObject.point1.coords.scrCoords[2]>0){m=-1}}}}else{f=this.slideObject.point1;if(this.slideObject.point1.coords.scrCoords[1]-this.slideObject.point2.coords.scrCoords[1]>0){m=-1}else{if(this.slideObject.point1.coords.scrCoords[1]-this.slideObject.point2.coords.scrCoords[1]==0){if(this.slideObject.point1.coords.scrCoords[2]-this.slideObject.point2.coords.scrCoords[2]>0){m=-1}}}}this.coords.setCoordinates(JXG.COORDS_BY_SCREEN,[f.coords.scrCoords[1]+m*j,f.coords.scrCoords[2]+m*h])}else{if(this.slideObject.elementClass==JXG.OBJECT_CLASS_CURVE){if(n>0){d=Math.round(this.intervalCount/i*this.board.canvasWidth)}else{d=Math.round((i-this.intervalCount)/i*this.board.canvasWidth)}this.coords.setCoordinates(JXG.COORDS_BY_SCREEN,[d,0]);this.coords=JXG.Math.Geometry.projectPointToCurve(this,this.slideObject,this.board)}else{if(this.slideObject.elementClass==JXG.OBJECT_CLASS_CIRCLE){if(n<0){g=this.intervalCount/i*2*Math.PI}else{g=(i-this.intervalCount)/i*2*Math.PI}k=this.slideObject.Radius();this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.slideObject.midpoint.coords.usrCoords[1]+k*Math.cos(g),this.slideObject.midpoint.coords.usrCoords[2]+k*Math.sin(g)])}}}this.board.update(this);return this},setStyle:function(d){var e=["cross","cross","cross","circle","circle","circle","circle","square","square","square","plus","plus","plus"],f=[2,3,4,1,2,3,4,2,3,4,2,3,4];this.visProp.face=e[d];this.visProp.size=f[d];this.board.renderer.changePointStyle(this);return this},normalizeFace:function(d){var e={cross:"x",x:"x",circle:"o",o:"o",square:"[]","[]":"[]",plus:"+","+":"+",diamond:"<>","<>":"<>",triangleup:"^",a:"^","^":"^",triangledown:"v",v:"v",triangleleft:"<","<":"<",triangleright:">",">":">"};return e[d]},remove:function(){if(this.hasLabel){this.board.renderer.remove(this.board.renderer.getElementById(this.label.content.id))}this.board.renderer.remove(this.board.renderer.getElementById(this.id))},getTextAnchor:function(){return this.coords},getLabelAnchor:function(){return this.coords},face:function(d){this.setProperty({face:d})},size:function(d){this.setProperty({size:d})},cloneToBackground:function(){var d={};d.id=this.id+"T"+this.numTraces;this.numTraces++;d.coords=this.coords;d.visProp=this.visProp;d.visProp.layer=this.board.options.layer.trace;d.elementClass=JXG.OBJECT_CLASS_POINT;d.board=this.board;JXG.clearVisPropOld(d);this.board.renderer.drawPoint(d);this.traces[d.id]=d.rendNode;return this}});JXG.createPoint=function(l,h,g){var k,f=false,j,e,d;d=JXG.copyAttributes(g,l.options,"point");for(j=0;j<h.length;j++){if(typeof h[j]=="function"||typeof h[j]=="string"){f=true}}if(!f){if((JXG.isNumber(h[0]))&&(JXG.isNumber(h[1]))){k=new JXG.Point(l,h,d);if(JXG.exists(d.slideobject)){k.makeGlider(d.slideobject)}else{k.baseElement=k}k.isDraggable=true}else{if((typeof h[0]=="object")&&(typeof h[1]=="object")){k=new JXG.Point(l,[0,0],d);k.addTransform(h[0],h[1]);k.isDraggable=false}else{throw new Error("JSXGraph: Can't create point with parent types '"+(typeof h[0])+"' and '"+(typeof h[1])+"'.\nPossible parent types: [x,y], [z,x,y], [point,transformation]")}}}else{k=new JXG.Point(l,[NaN,NaN],d);k.addConstraint(h)}return k};JXG.createGlider=function(h,f,e){var g,d=JXG.copyAttributes(e,h.options,"point");if(f.length===1){g=h.create("point",[0,0],d)}else{g=h.create("point",f.slice(0,2),d)}g.makeGlider(f[f.length-1]);return g};JXG.createIntersectionPoint=function(g,e,d){var f;if(e.length>=3){if(e.length==3){e.push(null)}f=g.create("point",[g.intersection(e[0],e[1],e[2],e[3])],d)}e[0].addChild(f);e[1].addChild(f);f.generatePolynomial=function(){var h=e[0].generatePolynomial(f);var i=e[1].generatePolynomial(f);if((h.length==0)||(i.length==0)){return[]}else{return[h[0],i[0]]}};return f};JXG.createOtherIntersectionPoint=function(g,e,d){var f;if(e.length!=3||!JXG.isPoint(e[2])||(e[0].elementClass!=JXG.OBJECT_CLASS_LINE&&e[0].elementClass!=JXG.OBJECT_CLASS_CIRCLE)||(e[1].elementClass!=JXG.OBJECT_CLASS_LINE&&e[1].elementClass!=JXG.OBJECT_CLASS_CIRCLE)){throw new Error("JSXGraph: Can't create 'other intersection point' with parent types '"+(typeof e[0])+"',  '"+(typeof e[1])+"'and  '"+(typeof e[2])+"'.\nPossible parent types: [circle|line,circle|line,point]")}else{f=g.create("point",[g.otherIntersection(e[0],e[1],e[2])],d)}e[0].addChild(f);e[1].addChild(f);f.generatePolynomial=function(){var h=e[0].generatePolynomial(f);var i=e[1].generatePolynomial(f);if((h.length==0)||(i.length==0)){return[]}else{return[h[0],i[0]]}};return f};JXG.JSXGraph.registerElement("point",JXG.createPoint);JXG.JSXGraph.registerElement("glider",JXG.createGlider);JXG.JSXGraph.registerElement("intersection",JXG.createIntersectionPoint);JXG.JSXGraph.registerElement("otherintersection",JXG.createOtherIntersectionPoint);JXG.Line=function(e,g,f,d){this.constructor(e,d,JXG.OBJECT_TYPE_LINE,JXG.OBJECT_CLASS_LINE);this.point1=JXG.getReference(this.board,g);this.point2=JXG.getReference(this.board,f);this.ticks=[];this.defaultTicks=null;this.parentPolygon=null;this.labelOffsets=[].concat(d.labeloffsets);this.labelOffsets[0]=Math.abs(this.labelOffsets[0]);this.labelOffsets[1]=Math.abs(this.labelOffsets[1]);this.id=this.board.setId(this,"L");this.board.renderer.drawLine(this);this.board.finalizeAdding(this);this.createLabel();this.point1.addChild(this);this.point2.addChild(this);this.updateStdform()};JXG.Line.prototype=new JXG.GeometryElement;JXG.extend(JXG.Line.prototype,{hasPoint:function(l,j){var h=[],q,o=[1,l,j],m=[],r,f,k,e,n,p,g,d;h[0]=this.stdform[0]-this.stdform[1]*this.board.origin.scrCoords[1]/this.board.unitX+this.stdform[2]*this.board.origin.scrCoords[2]/this.board.unitY;h[1]=this.stdform[1]/this.board.unitX;h[2]=this.stdform[2]/(-this.board.unitY);var m=[0,h[1],h[2]];m=JXG.Math.crossProduct(m,o);m=JXG.Math.crossProduct(m,h);m[1]/=m[0];m[2]/=m[0];m[0]=1;q=(o[0]-m[0])*(o[0]-m[0])+(o[1]-m[1])*(o[1]-m[1])+(o[2]-m[2])*(o[2]-m[2]);if(isNaN(q)||q>this.board.options.precision.hasPoint*this.board.options.precision.hasPoint){return false}if(this.visProp.straightfirst&&this.visProp.straightlast){return true}else{e=this.point1.coords.scrCoords;n=this.point2.coords.scrCoords;d=(n[1]-e[1])*(n[1]-e[1])+(n[2]-e[2])*(n[2]-e[2]);p=(m[1]-e[1])*(m[1]-e[1])+(m[2]-e[2])*(m[2]-e[2]);g=(m[1]-n[1])*(m[1]-n[1])+(m[2]-n[2])*(m[2]-n[2]);if((p>d)||(g>d)){if(p<g){if(!this.visProp.straightfirst){return false}}else{if(!this.visProp.straightlast){return false}}}return true}},update:function(){var d,e,f;if(this.needsUpdate){if(this.constrained){if(typeof this.funps!="undefined"){e=this.funps();this.point1=e[0];this.point2=e[1]}else{this.point1=this.funp1();this.point2=this.funp2()}}this.updateStdform();if(this.visProp.trace){this.cloneToBackground(true)}}return this},updateStdform:function(){var d=JXG.Math.crossProduct(this.point1.coords.usrCoords,this.point2.coords.usrCoords);this.stdform[0]=d[0];this.stdform[1]=d[1];this.stdform[2]=d[2];this.stdform[3]=0;this.normalize()},updateRenderer:function(){var d,e;if(this.needsUpdate&&this.visProp.visible){d=this.isReal;this.isReal=(!isNaN(this.point1.coords.usrCoords[1]+this.point1.coords.usrCoords[2]+this.point2.coords.usrCoords[1]+this.point2.coords.usrCoords[2])&&(JXG.Math.innerProduct(this.stdform,this.stdform,3)>=JXG.Math.eps*JXG.Math.eps));if(this.isReal){if(d!=this.isReal){this.board.renderer.show(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.show(this.label.content)}}this.board.renderer.updateLine(this)}else{if(d!=this.isReal){this.board.renderer.hide(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.hide(this.label.content)}}}this.needsUpdate=false}if(this.hasLabel&&this.label.content.visProp.visible&&this.isReal){this.label.content.update();this.board.renderer.updateText(this.label.content)}return this},generatePolynomial:function(h){var g=this.point1.symbolic.x,f=this.point1.symbolic.y,j=this.point2.symbolic.x,i=this.point2.symbolic.y,e=h.symbolic.x,d=h.symbolic.y;return[["(",f,")*(",e,")-(",f,")*(",j,")+(",d,")*(",j,")-(",g,")*(",d,")+(",g,")*(",i,")-(",e,")*(",i,")"].join("")]},getRise:function(){if(Math.abs(this.stdform[2])>=JXG.Math.eps){return -this.stdform[0]/this.stdform[2]}else{return Infinity}},getSlope:function(){if(Math.abs(this.stdform[2])>=JXG.Math.eps){return -this.stdform[1]/this.stdform[2]}else{return Infinity}},getAngle:function(){var d=Math.atan2(this.point2.Y()-this.point1.Y(),this.point2.X()-this.point1.X());return d},setStraight:function(d,e){this.visProp.straightfirst=d;this.visProp.straightlast=e;this.board.renderer.updateLine(this);return this},getTextAnchor:function(){return new JXG.Coords(JXG.COORDS_BY_USER,[0.5*(this.point2.X()+this.point1.X()),0.5*(this.point2.Y()+this.point1.Y())],this.board)},setLabelRelativeCoords:function(d){if(JXG.exists(this.label.content)){this.label.content.relativeCoords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[d[0],-d[1]],this.board)}},getLabelAnchor:function(){var h,f,e,g,d,i=this.labelOffsets[0],j=this.labelOffsets[1];if(!this.visProp.straightfirst&&!this.visProp.straightlast){this.setLabelRelativeCoords(this.labelOffsets);return new JXG.Coords(JXG.COORDS_BY_USER,[this.point2.X()-0.5*(this.point2.X()-this.point1.X()),this.point2.Y()-0.5*(this.point2.Y()-this.point1.Y())],this.board)}else{f=new JXG.Coords(JXG.COORDS_BY_USER,this.point1.coords.usrCoords,this.board);e=new JXG.Coords(JXG.COORDS_BY_USER,this.point2.coords.usrCoords,this.board);JXG.Math.Geometry.calcStraight(this,f,e);if(!this.visProp.straightfirst||this.type==JXG.OBJECT_TYPE_AXIS){h=e}else{h=f}if(this.label.content!=null){g=[0,0];d=this.getSlope();if(h.scrCoords[2]==0){if(d==Infinity){g=[i,-j]}else{if(d>=0){g=[i,-j]}else{g=[-i,-j]}}}else{if(h.scrCoords[2]==this.board.canvasHeight){if(d==Infinity){g=[i,j]}else{if(d>=0){g=[-i,j]}else{g=[i,j]}}}}if(h.scrCoords[1]==0){if(d==Infinity){g=[i,j]}else{if(d>=0){g=[i,-j]}else{g=[i,j]}}}else{if(h.scrCoords[1]==this.board.canvasWidth){if(d==Infinity){g=[-i,j]}else{if(d>=0){g=[-i,j]}else{g=[-i,-j]}}}}this.setLabelRelativeCoords(g)}return h}},cloneToBackground:function(e){var h={},f,d,g;h.id=this.id+"T"+this.numTraces;h.elementClass=JXG.OBJECT_CLASS_LINE;this.numTraces++;h.point1=this.point1;h.point2=this.point2;h.stdform=this.stdform;h.board=this.board;h.visProp=this.visProp;h.visProp.layer=this.board.options.layer.trace;JXG.clearVisPropOld(h);d=this.getSlope();f=this.getRise();h.getSlope=function(){return d};h.getRise=function(){return f};g=this.board.renderer.enhancedRendering;this.board.renderer.enhancedRendering=true;this.board.renderer.drawLine(h);this.board.renderer.enhancedRendering=g;this.traces[h.id]=h.rendNode;delete h},addTransform:function(d){var f,e;if(JXG.isArray(d)){f=d}else{f=[d]}for(e=0;e<f.length;e++){this.point1.transformations.push(f[e]);this.point2.transformations.push(f[e])}},setPosition:function(g,d,f){var e=this.board.create("transform",[d,f],{type:"translate"});if(this.point1.transformations.length>0&&this.point1.transformations[this.point1.transformations.length-1].isNumericMatrix){this.point1.transformations[this.point1.transformations.length-1].melt(e)}else{this.point1.addTransform(this.point1,e)}if(this.point2.transformations.length>0&&this.point2.transformations[this.point2.transformations.length-1].isNumericMatrix){this.point2.transformations[this.point2.transformations.length-1].melt(e)}else{this.point2.addTransform(this.point2,e)}},setPositionDirectly:function(d,k,j,f,e){var m=k-f,l=j-e,h,g,i;if(!this.point1.draggable()||!this.point2.draggable()){return this}i=this.point1.coords;if(d==JXG.COORDS_BY_SCREEN){h=i.scrCoords[1]+m;g=i.scrCoords[2]+l}else{h=i.usrCoords[1]+m;g=i.usrCoords[2]+l}this.point1.setPositionDirectly(d,h,g);i=this.point2.coords;if(d==JXG.COORDS_BY_SCREEN){h=i.scrCoords[1]+m;g=i.scrCoords[2]+l}else{h=i.usrCoords[1]+m;g=i.usrCoords[2]+l}this.point2.setPositionDirectly(d,h,g);this.update();return this},X:function(i){var l=this.stdform[1],k=this.stdform[2],j=this.stdform[0],g,f,d,e,h;i*=Math.PI;g=l*Math.cos(i)+k*Math.sin(i);f=j;d=Math.sqrt(g*g+f*f);e=-f/d;h=g/d;if(Math.abs(h)<JXG.Math.eps){h=1}return e*Math.cos(i)/h},Y:function(i){var l=this.stdform[1],k=this.stdform[2],j=this.stdform[0],g,f,d,e,h;i*=Math.PI;g=l*Math.cos(i)+k*Math.sin(i);f=j;d=Math.sqrt(g*g+f*f);e=-f/d;h=g/d;if(Math.abs(h)<JXG.Math.eps){h=1}return e*Math.sin(i)/h},Z:function(h){var f=this.stdform[1],e=this.stdform[2],k=this.stdform[0],d,j,g,i;h*=Math.PI;d=f*Math.cos(h)+e*Math.sin(h);j=k;g=Math.sqrt(d*d+j*j);i=d/g;if(Math.abs(i)>=JXG.Math.eps){return 1}else{return 0}},L:function(){return this.point1.Dist(this.point2)},minX:function(){return 0},maxX:function(){return 1},bounds:function(){var d=this.point1.coords.usrCoords,e=this.point2.coords.usrCoords;return[Math.min(d[1],e[1]),Math.max(d[2],e[2]),Math.max(d[1],e[1]),Math.min(d[2],e[2])]},addTicks:function(d){if(d.id==""||typeof d.id=="undefined"){d.id=this.id+"_ticks_"+(this.ticks.length+1)}this.board.renderer.drawTicks(d);this.ticks.push(d);return d.id},removeAllTicks:function(){var e,d;for(d=this.ticks.length;d>0;d--){this.removeTicks(this.ticks[d-1])}this.ticks=new Array();this.board.update()},removeTicks:function(f){var e,d;if(this.defaultTicks!=null&&this.defaultTicks==f){this.defaultTicks=null}for(e=this.ticks.length;e>0;e--){if(this.ticks[e-1]==f){this.board.removeObject(this.ticks[e-1]);for(d=0;d<this.ticks[e-1].ticks.length;d++){if(this.ticks[e-1].labels[d]!=null){this.board.removeObject(this.ticks[e-1].labels[d])}}delete (this.ticks[e-1]);break}}}});JXG.createLine=function(k,n,h){var f,p,o,j,l,m=[],g=false,e;if(n.length==2){if(JXG.isArray(n[0])&&n[0].length>1){l=JXG.copyAttributes(h,k.options,"line","point1");p=k.create("point",n[0],l)}else{if(JXG.isString(n[0])||n[0].elementClass==JXG.OBJECT_CLASS_POINT){p=JXG.getReference(k,n[0])}else{if((typeof n[0]=="function")&&(n[0]().elementClass==JXG.OBJECT_CLASS_POINT)){p=n[0]();g=true}else{throw new Error("JSXGraph: Can't create line with parent types '"+(typeof n[0])+"' and '"+(typeof n[1])+"'.\nPossible parent types: [point,point], [[x1,y1],[x2,y2]], [a,b,c]")}}}if(JXG.isArray(n[1])&&n[1].length>1){l=JXG.copyAttributes(h,k.options,"line","point2");o=k.create("point",n[1],l)}else{if(JXG.isString(n[1])||n[1].elementClass==JXG.OBJECT_CLASS_POINT){o=JXG.getReference(k,n[1])}else{if((typeof n[1]=="function")&&(n[1]().elementClass==JXG.OBJECT_CLASS_POINT)){o=n[1]();g=true}else{throw new Error("JSXGraph: Can't create line with parent types '"+(typeof n[0])+"' and '"+(typeof n[1])+"'.\nPossible parent types: [point,point], [[x1,y1],[x2,y2]], [a,b,c]")}}}l=JXG.copyAttributes(h,k.options,"line");f=new JXG.Line(k,p,o,l);if(g){f.constrained=true;f.funp1=n[0];f.funp2=n[1]}else{f.isDraggable=true}}else{if(n.length==3){e=true;for(j=0;j<3;j++){if(typeof n[j]=="number"){m[j]=function(i){return function(){return i}}(n[j])}else{if(typeof n[j]=="function"){m[j]=n[j];e=false}else{throw new Error("JSXGraph: Can't create line with parent types '"+(typeof n[0])+"' and '"+(typeof n[1])+"' and '"+(typeof n[2])+"'.\nPossible parent types: [point,point], [[x1,y1],[x2,y2]], [a,b,c]")}}}l=JXG.copyAttributes(h,k.options,"line","point1");if(e){p=k.create("point",[m[2]()*m[2]()+m[1]()*m[1](),m[2]()-m[1]()*m[0]()+m[2](),-m[1]()-m[2]()*m[0]()-m[1]()],l)}else{p=k.create("point",[function(){return(0+m[2]()*m[2]()+m[1]()*m[1]())*0.5},function(){return(m[2]()-m[1]()*m[0]()+m[2]())*0.5},function(){return(-m[1]()-m[2]()*m[0]()-m[1]())*0.5}],l)}l=JXG.copyAttributes(h,k.options,"line","point2");if(e){o=k.create("point",[m[2]()*m[2]()+m[1]()*m[1](),-m[1]()*m[0]()+m[2](),-m[2]()*m[0]()-m[1]()],l)}else{o=k.create("point",[function(){return m[2]()*m[2]()+m[1]()*m[1]()},function(){return -m[1]()*m[0]()+m[2]()},function(){return -m[2]()*m[0]()-m[1]()}],l)}p.prepareUpdate().update();o.prepareUpdate().update();l=JXG.copyAttributes(h,k.options,"line");f=new JXG.Line(k,p,o,l);f.isDraggable=e}else{if((n.length==1)&&(typeof n[0]=="function")&&(n[0]().length==2)&&(n[0]()[0].elementClass==JXG.OBJECT_CLASS_POINT)&&(n[0]()[1].elementClass==JXG.OBJECT_CLASS_POINT)){var d=n[0]();l=JXG.copyAttributes(h,k.options,"line");f=new JXG.Line(k,d[0],d[1],l);f.constrained=true;f.funps=n[0]}else{throw new Error("JSXGraph: Can't create line with parent types '"+(typeof n[0])+"' and '"+(typeof n[1])+"'.\nPossible parent types: [point,point], [[x1,y1],[x2,y2]], [a,b,c]")}}}return f};JXG.JSXGraph.registerElement("line",JXG.createLine);JXG.createSegment=function(f,e,d){d.straightFirst=false;d.straightLast=false;return f.create("line",e,d)};JXG.JSXGraph.registerElement("segment",JXG.createSegment);JXG.createArrow=function(g,e,d){var f;f=g.create("line",e,d).setStraight(false,false);f.setArrow(false,true);f.type=JXG.OBJECT_TYPE_VECTOR;return f};JXG.JSXGraph.registerElement("arrow",JXG.createArrow);JXG.createAxis=function(i,f,e){var d,h,j;if((JXG.isArray(f[0])||JXG.isPoint(f[0]))&&(JXG.isArray(f[1])||JXG.isPoint(f[1]))){d=JXG.copyAttributes(e,i.options,"axis");h=i.create("line",f,d);h.type=JXG.OBJECT_TYPE_AXIS;for(var g in h.ancestors){h.ancestors[g].type=JXG.OBJECT_TYPE_AXISPOINT}d=JXG.copyAttributes(e,i.options,"axis","ticks");if(JXG.exists(d.ticksdistance)){j=d.ticksdistance}else{if(JXG.isArray(d.ticks)){j=d.ticks}else{j=1}}h.defaultTicks=i.create("ticks",[h,j],d)}else{throw new Error("JSXGraph: Can't create point with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [point,point], [[x1,y1],[x2,y2]]")}return h};JXG.JSXGraph.registerElement("axis",JXG.createAxis);JXG.createTangent=function(o,r,k){var d,q,m,n,l,h,e,s,t,u;if(r.length==1){d=r[0];q=d.slideObject}else{if(r.length==2){if(JXG.isPoint(r[0])){d=r[0];q=r[1]}else{if(JXG.isPoint(r[1])){q=r[0];d=r[1]}else{throw new Error("JSXGraph: Can't create tangent with parent types '"+(typeof r[0])+"' and '"+(typeof r[1])+"'.\nPossible parent types: [glider], [point,line|curve|circle|conic]")}}}else{throw new Error("JSXGraph: Can't create tangent with parent types '"+(typeof r[0])+"' and '"+(typeof r[1])+"'.\nPossible parent types: [glider], [point,line|curve|circle|conic]")}}if(q.elementClass==JXG.OBJECT_CLASS_LINE){u=o.create("line",[q.point1,q.point2],k)}else{if(q.elementClass==JXG.OBJECT_CLASS_CURVE&&!(q.type==JXG.OBJECT_TYPE_CONIC)){if(q.visProp.curvetype!="plot"){m=q.X;n=q.Y;u=o.create("line",[function(){return -d.X()*o.D(n)(d.position)+d.Y()*o.D(m)(d.position)},function(){return o.D(n)(d.position)},function(){return -o.D(m)(d.position)}],k);d.addChild(u);u.glider=d}else{u=o.create("line",[function(){l=Math.floor(d.position);if(l==q.numberPoints-1){l--}if(l<0){return 1}return q.Y(l)*q.X(l+1)-q.X(l)*q.Y(l+1)},function(){l=Math.floor(d.position);if(l==q.numberPoints-1){l--}if(l<0){return 0}return q.Y(l+1)-q.Y(l)},function(){l=Math.floor(d.position);if(l==q.numberPoints-1){l--}if(l<0){return 0}return q.X(l)-q.X(l+1)}],k);d.addChild(u);u.glider=d}}else{if(q.type==JXG.OBJECT_TYPE_TURTLE){u=o.create("line",[function(){l=Math.floor(d.position);for(h=0;h<q.objects.length;h++){e=q.objects[h];if(e.type==JXG.OBJECT_TYPE_CURVE){if(l<e.numberPoints){break}l-=e.numberPoints}}if(l==e.numberPoints-1){l--}if(l<0){return 1}return e.Y(l)*e.X(l+1)-e.X(l)*e.Y(l+1)},function(){l=Math.floor(d.position);for(h=0;h<q.objects.length;h++){e=q.objects[h];if(e.type==JXG.OBJECT_TYPE_CURVE){if(l<e.numberPoints){break}l-=e.numberPoints}}if(l==e.numberPoints-1){l--}if(l<0){return 0}return e.Y(l+1)-e.Y(l)},function(){l=Math.floor(d.position);for(h=0;h<q.objects.length;h++){e=q.objects[h];if(e.type==JXG.OBJECT_TYPE_CURVE){if(l<e.numberPoints){break}l-=e.numberPoints}}if(l==e.numberPoints-1){l--}if(l<0){return 0}return e.X(l)-e.X(l+1)}],k);d.addChild(u);u.glider=d}else{if(q.elementClass==JXG.OBJECT_CLASS_CIRCLE||q.type==JXG.OBJECT_TYPE_CONIC){u=o.create("line",[function(){return JXG.Math.matVecMult(q.quadraticform,d.coords.usrCoords)[0]},function(){return JXG.Math.matVecMult(q.quadraticform,d.coords.usrCoords)[1]},function(){return JXG.Math.matVecMult(q.quadraticform,d.coords.usrCoords)[2]}],k);d.addChild(u);u.glider=d}}}}return u};JXG.JSXGraph.registerElement("tangent",JXG.createTangent);JXG.JSXGraph.registerElement("polar",JXG.createTangent);JXG.Group=function(h,l,d){var j,g,e,k,f;this.board=h;this.objects={};j=this.board.numObjects;this.board.numObjects++;if((l=="")||!JXG.exists(l)){this.id=this.board.id+"Group"+j}else{this.id=l}this.board.groups[this.id]=this;this.type=JXG.OBJECT_TYPE_POINT;this.elementClass=JXG.OBJECT_CLASS_POINT;if((d=="")||!JXG.exists(d)){this.name="group_"+this.board.generateName(this)}else{this.name=d}delete (this.type);if((arguments.length==4)&&(JXG.isArray(arguments[3]))){g=arguments[3]}else{g=[];for(e=3;e<arguments.length;e++){g.push(arguments[e])}}for(e=0;e<g.length;e++){k=JXG.getReference(this.board,g[e]);if((!k.visProp.fixed)&&((k.type==JXG.OBJECT_TYPE_POINT)||(k.type==JXG.OBJECT_TYPE_GLIDER))){if(k.group.length!=0){this.addGroup(k.group[k.group.length-1])}else{this.addPoint(k)}}}for(f in this.objects){this.objects[f].group.push(this)}this.dX=0;this.dY=0};JXG.extend(JXG.Group.prototype,{ungroup:function(){var d;for(d in this.objects){if(this.objects[d].group[this.objects[d].group.length-1]==this){this.objects[d].group.pop()}delete (this.objects[d])}},update:function(d){var f=null,e;for(e in this.objects){f=this.objects[e];if(f.id!=d.id){f.coords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[f.coords.scrCoords[1]+this.dX,f.coords.scrCoords[2]+this.dY],f.board)}}for(e in this.objects){if(JXG.exists(this.board.objects[e])){this.objects[e].update(false)}else{delete (this.objects[e])}}return this},addPoint:function(d){this.objects[d.id]=d},addPoints:function(d){var e;for(e in d){this.objects[e.id]=e}},addGroup:function(e){var d;for(d in e.objects){this.addPoint(e.objects[d])}}});JXG.createGroup=function(f,e,d){return new JXG.Group(f,d.id,d.name,e)};JXG.JSXGraph.registerElement("group",JXG.createGroup);JXG.Circle=function(g,h,f,e,d){this.constructor(g,d,JXG.OBJECT_TYPE_CIRCLE,JXG.OBJECT_CLASS_CIRCLE);this.method=h;this.midpoint=JXG.getReference(this.board,f);this.point2=null;this.radius=0;this.line=null;this.circle=null;if(h=="twoPoints"){this.point2=JXG.getReference(g,e);this.radius=this.Radius()}else{if(h=="pointRadius"){this.generateTerm(e);this.updateRadius()}else{if(h=="pointLine"){this.line=JXG.getReference(g,e);this.radius=this.line.point1.coords.distance(JXG.COORDS_BY_USER,this.line.point2.coords)}else{if(h=="pointCircle"){this.circle=JXG.getReference(g,e);this.radius=this.circle.Radius()}}}}this.id=this.board.setId(this,"C");this.board.renderer.drawEllipse(this);this.board.finalizeAdding(this);this.createGradient();this.createLabel();this.midpoint.addChild(this);if(h=="pointRadius"){this.notifyParents(e)}else{if(h=="pointLine"){this.line.addChild(this)}else{if(h=="pointCircle"){this.circle.addChild(this)}else{if(h=="twoPoints"){this.point2.addChild(this)}}}}};JXG.Circle.prototype=new JXG.GeometryElement;JXG.extend(JXG.Circle.prototype,{hasPoint:function(d,j){var e=this.board.options.precision.hasPoint/(this.board.unitX),g=this.midpoint.coords.usrCoords,h=new JXG.Coords(JXG.COORDS_BY_SCREEN,[d,j],this.board),f=this.Radius();var i=Math.sqrt((g[1]-h.usrCoords[1])*(g[1]-h.usrCoords[1])+(g[2]-h.usrCoords[2])*(g[2]-h.usrCoords[2]));return(Math.abs(i-f)<e)},generatePolynomial:function(j){var h=this.midpoint.symbolic.x;var g=this.midpoint.symbolic.y;var f=j.symbolic.x;var e=j.symbolic.y;var d=this.generateRadiusSquared();if(d==""){return[]}var i="(("+f+")-("+h+"))^2 + (("+e+")-("+g+"))^2 - ("+d+")";return[i]},generateRadiusSquared:function(){var e="";if(this.method=="twoPoints"){var g=this.midpoint.symbolic.x;var f=this.midpoint.symbolic.y;var i=this.point2.symbolic.x;var h=this.point2.symbolic.y;e="(("+i+")-("+g+"))^2 + (("+h+")-("+f+"))^2"}else{if(this.method=="pointRadius"){if(typeof(this.radius)=="number"){e=""+this.radius*this.radius}}else{if(this.method=="pointLine"){var i=this.line.point1.symbolic.x;var h=this.line.point1.symbolic.y;var d=this.line.point2.symbolic.x;var j=this.line.point2.symbolic.y;e="(("+i+")-("+d+"))^2 + (("+h+")-("+j+"))^2"}else{if(this.method=="pointCircle"){e=this.circle.Radius()}}}}return e},update:function(){if(this.needsUpdate){if(this.visProp.trace){this.cloneToBackground(true)}if(this.method=="pointLine"){this.radius=this.line.point1.coords.distance(JXG.COORDS_BY_USER,this.line.point2.coords)}else{if(this.method=="pointCircle"){this.radius=this.circle.Radius()}else{if(this.method=="pointRadius"){this.radius=this.updateRadius()}}}this.updateStdform();this.updateQuadraticform()}return this},updateQuadraticform:function(){var d=this.midpoint,g=d.X(),f=d.Y(),e=this.Radius();this.quadraticform=[[g*g+f*f-e*e,-g,-f],[-g,1,0],[-f,0,1]]},updateStdform:function(){this.stdform[3]=0.5;this.stdform[4]=this.Radius();this.stdform[1]=-this.midpoint.coords.usrCoords[1];this.stdform[2]=-this.midpoint.coords.usrCoords[2];this.normalize()},updateRenderer:function(){if(this.needsUpdate&&this.visProp.visible){var d=this.isReal;this.isReal=(isNaN(this.midpoint.coords.usrCoords[1]+this.midpoint.coords.usrCoords[2]+this.Radius()))?false:true;if(this.isReal){if(d!=this.isReal){this.board.renderer.show(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.show(this.label.content)}}this.board.renderer.updateEllipse(this)}else{if(d!=this.isReal){this.board.renderer.hide(this);if(this.hasLabel&&this.label.content.visProp.visible){this.board.renderer.hide(this.label.content)}}}this.needsUpdate=false}if(this.hasLabel&&this.label.content.visProp.visible&&this.isReal){this.label.content.update();this.board.renderer.updateText(this.label.content)}},generateTerm:function(e){if(typeof e=="string"){var f=this.board.elementsByName;var d=JXG.GeonextParser.geonext2JS(e+"",this.board);this.updateRadius=new Function("return "+d+";")}else{if(typeof e=="number"){this.updateRadius=function(){return e}}else{this.updateRadius=e}}},notifyParents:function(e){var d=null;var f=this.board.elementsByName;if(typeof e=="string"){JXG.GeonextParser.findDependencies(this,e+"",this.board)}},Radius:function(){if(this.method=="twoPoints"){return(Math.sqrt(Math.pow(this.midpoint.coords.usrCoords[1]-this.point2.coords.usrCoords[1],2)+Math.pow(this.midpoint.coords.usrCoords[2]-this.point2.coords.usrCoords[2],2)))}else{if(this.method=="pointLine"||this.method=="pointCircle"){return this.radius}else{if(this.method=="pointRadius"){return this.updateRadius()}}}},getRadius:function(){return this.Radius()},getTextAnchor:function(){return this.midpoint.coords},getLabelAnchor:function(){if(this.method=="twoPoints"){var e=this.midpoint.coords.usrCoords[1]-this.point2.coords.usrCoords[1];var d=this.midpoint.coords.usrCoords[2]-this.point2.coords.usrCoords[2];return new JXG.Coords(JXG.COORDS_BY_USER,[this.midpoint.coords.usrCoords[1]+e,this.midpoint.coords.usrCoords[2]+d],this.board)}else{if(this.method=="pointLine"||this.method=="pointCircle"||this.method=="pointRadius"){return new JXG.Coords(JXG.COORDS_BY_USER,[this.midpoint.coords.usrCoords[1]-this.Radius(),this.midpoint.coords.usrCoords[2]],this.board)}}},cloneToBackground:function(d){var g={},e,f;g.id=this.id+"T"+this.numTraces;g.elementClass=JXG.OBJECT_CLASS_CIRCLE;this.numTraces++;g.midpoint={};g.midpoint.coords=this.midpoint.coords;e=this.Radius();g.Radius=function(){return e};g.getRadius=function(){return e};g.board=this.board;g.visProp=this.visProp;g.visProp.layer=this.board.options.layer.trace;JXG.clearVisPropOld(g);f=this.board.renderer.enhancedRendering;this.board.renderer.enhancedRendering=true;this.board.renderer.drawEllipse(g);this.board.renderer.enhancedRendering=f;this.traces[g.id]=g.rendNode},addTransform:function(d){var f;if(JXG.isArray(d)){f=d}else{f=[d]}for(var e=0;e<f.length;e++){this.midpoint.transformations.push(f[e]);if(this.method=="twoPoints"){this.point2.transformations.push(f[e])}}},setPosition:function(g,d,f){var e=this.board.create("transform",[d,f],{type:"translate"});this.addTransform(e);return this},setPositionDirectly:function(d,j,i,f,e){var l=j-f,k=i-e,h,g;if(!this.midpoint.draggable()){return this}if(this.method=="twoPoints"&&!this.point2.draggable()){return this}if(d==JXG.COORDS_BY_SCREEN){h=this.midpoint.coords.scrCoords[1]+l;g=this.midpoint.coords.scrCoords[2]+k}else{h=this.midpoint.coords.usrCoords[1]+l;g=this.midpoint.coords.usrCoords[2]+k}this.midpoint.setPositionDirectly(d,h,g);if(this.method=="twoPoints"){if(d==JXG.COORDS_BY_SCREEN){h=this.point2.coords.scrCoords[1]+l;g=this.point2.coords.scrCoords[2]+k}else{h=this.point2.coords.usrCoords[1]+l;g=this.point2.coords.usrCoords[2]+k}this.point2.setPositionDirectly(d,h,g)}this.update();return this},X:function(d){d*=2*Math.PI;return this.Radius()*Math.cos(d)+this.midpoint.coords.usrCoords[1]},Y:function(d){d*=2*Math.PI;return this.Radius()*Math.sin(d)+this.midpoint.coords.usrCoords[2]},minX:function(){return 0},maxX:function(){return 1},Area:function(){var d=this.Radius();return d*d*Math.PI},bounds:function(){var d=this.midpoint.coords.usrCoords,e=this.Radius();return[d[1]-e,d[2]+e,d[1]+e,d[2]-e]}});JXG.createCircle=function(k,f,e){var j,l,h,d,g=true;l=[];for(h=0;h<f.length;h++){if(JXG.isPoint(f[h])){l[h]=f[h]}else{if(f[h].length>1){d=JXG.copyAttributes(e,k.options,"circle","center");l[h]=k.create("point",f[h],d)}else{l[h]=f[h]}}}d=JXG.copyAttributes(e,k.options,"circle");if(f.length==2&&JXG.isPoint(l[0])&&JXG.isPoint(l[1])){j=new JXG.Circle(k,"twoPoints",l[0],l[1],d)}else{if((JXG.isNumber(l[0])||JXG.isFunction(l[0])||JXG.isString(l[0]))&&JXG.isPoint(l[1])){j=new JXG.Circle(k,"pointRadius",l[1],l[0],d)}else{if((JXG.isNumber(l[1])||JXG.isFunction(l[1])||JXG.isString(l[1]))&&JXG.isPoint(l[0])){j=new JXG.Circle(k,"pointRadius",l[0],l[1],d)}else{if((l[0].elementClass==JXG.OBJECT_CLASS_CIRCLE)&&JXG.isPoint(l[1])){j=new JXG.Circle(k,"pointCircle",l[1],l[0],d)}else{if((l[1].elementClass==JXG.OBJECT_CLASS_CIRCLE)&&JXG.isPoint(l[0])){j=new JXG.Circle(k,"pointCircle",l[0],l[1],d)}else{if((l[0].elementClass==JXG.OBJECT_CLASS_LINE)&&JXG.isPoint(l[1])){j=new JXG.Circle(k,"pointLine",l[1],l[0],d)}else{if((l[1].elementClass==JXG.OBJECT_CLASS_LINE)&&JXG.isPoint(l[0])){j=new JXG.Circle(k,"pointLine",l[0],l[1],d)}else{if(f.length==3&&JXG.isPoint(l[0])&&JXG.isPoint(l[1])&&JXG.isPoint(l[2])){j=JXG.createCircumcircle(k,l,e);j.midpoint.setProperty({visible:false});g=false}else{throw new Error("JSXGraph: Can't create circle with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [point,point], [point,number], [point,function], [point,circle], [point,point,point]")}}}}}}}}j.isDraggable=g;return j};JXG.JSXGraph.registerElement("circle",JXG.createCircle);JXG.createEllipse=function(n,p,h){var r=[],e,d,k,l,j=JXG.copyAttributes(h,n.options,"conic","foci"),m=JXG.copyAttributes(h,n.options,"conic");for(k=0;k<2;k++){if(p[k].length>1){r[k]=n.create("point",p[k],j)}else{if(JXG.isPoint(p[k])){r[k]=JXG.getReference(n,p[k])}else{if((typeof p[k]=="function")&&(p[k]().elementClass===JXG.OBJECT_CLASS_POINT)){r[k]=p[k]()}else{if(JXG.isString(p[k])){r[k]=JXG.getReference(n,p[k])}else{throw new Error("JSXGraph: Can't create Ellipse with parent types '"+(typeof p[0])+"' and '"+(typeof p[1])+"'.\nPossible parent types: [point,point,point], [point,point,number|function]")}}}}}if(JXG.isNumber(p[2])){d=JXG.createFunction(p[2],n)}else{if((typeof p[2]=="function")&&(JXG.isNumber(p[2]()))){d=p[2]}else{if(JXG.isPoint(p[2])){e=JXG.getReference(n,p[2])}else{if(p[2].length>1){e=n.create("point",p[2],j)}else{if((typeof p[2]=="function")&&(p[2]().elementClass==JXG.OBJECT_CLASS_POINT)){e=p[2]()}else{if(JXG.isString(p[2])){e=JXG.getReference(n,p[2])}else{throw new Error("JSXGraph: Can't create Ellipse with parent types '"+(typeof p[0])+"' and '"+(typeof p[1])+"' and '"+(typeof p[2])+"'.\nPossible parent types: [point,point,point], [point,point,number|function]")}}}}d=function(){return e.Dist(r[0])+e.Dist(r[1])}}}if(typeof p[4]=="undefined"){p[4]=1.0001*Math.PI}if(typeof p[3]=="undefined"){p[3]=-1.0001*Math.PI}var o=n.create("point",[function(){return(r[0].X()+r[1].X())*0.5},function(){return(r[0].Y()+r[1].Y())*0.5}],j);var q=function(){var i=r[0].X(),z=r[0].Y(),w=r[1].X(),v=r[1].Y(),y,x,u;var t=(w-i>0)?1:-1;if(Math.abs(w-i)>1e-7){y=Math.atan2(v-z,w-i)+((t<0)?Math.PI:0)}else{y=((v-z>0)?0.5:-0.5)*Math.PI}x=Math.cos(y);u=Math.sin(y);var s=[[1,0,0],[o.X(),x,-u],[o.Y(),u,x]];return s};var f=n.create("curve",[function(i){return 0},function(i){return 0},p[3],p[4]],m);var g=function(u,s){var y=d()*0.5,i=y*y,t=r[1].Dist(r[0])*0.5,v=i-t*t,x=Math.sqrt(v),w=[[1,0,0],[0,1,0],[0,0,1]],A,z;if(!s){l=q();A=o.X();z=o.Y();w[0][0]=l[0][0];w[0][1]=0;w[0][2]=0;w[1][0]=A*(1-l[1][1])+z*l[1][2];w[1][1]=l[1][1];w[1][2]=l[2][1];w[2][0]=z*(1-l[1][1])-A*l[1][2];w[2][1]=l[1][2];w[2][2]=l[2][2];f.quadraticform=JXG.Math.matMatMult(JXG.Math.transpose(w),JXG.Math.matMatMult([[-1+A*A/(y*y)+z*z/v,-A/i,-A/v],[-A/i,1/i,0],[-z/v,0,1/v]],w))}return JXG.Math.matVecMult(l,[1,y*Math.cos(u),x*Math.sin(u)])};f.X=function(i,s){return g(i,s)[1]};f.Y=function(i,s){return g(i,s)[2]};f.midpoint=o;f.type=JXG.OBJECT_TYPE_CONIC;return f};JXG.createHyperbola=function(n,p,h){var r=[],e,d,k,l,j=JXG.copyAttributes(h,n.options,"conic","foci"),m=JXG.copyAttributes(h,n.options,"conic");for(k=0;k<2;k++){if(p[k].length>1){r[k]=n.create("point",p[k],attr_focu)}else{if(JXG.isPoint(p[k])){r[k]=JXG.getReference(n,p[k])}else{if((typeof p[k]=="function")&&(p[k]().elementClass==JXG.OBJECT_CLASS_POINT)){r[k]=p[k]()}else{if(JXG.isString(p[k])){r[k]=JXG.getReference(n,p[k])}else{throw new Error("JSXGraph: Can't create Hyperbola with parent types '"+(typeof p[0])+"' and '"+(typeof p[1])+"'.\nPossible parent types: [point,point,point], [point,point,number|function]")}}}}}if(JXG.isNumber(p[2])){d=JXG.createFunction(p[2],n)}else{if((typeof p[2]=="function")&&(JXG.isNumber(p[2]()))){d=p[2]}else{if(JXG.isPoint(p[2])){e=JXG.getReference(n,p[2])}else{if(p[2].length>1){e=n.create("point",p[2],j)}else{if((typeof p[2]=="function")&&(p[2]().elementClass==JXG.OBJECT_CLASS_POINT)){e=p[2]()}else{if(JXG.isString(p[2])){e=JXG.getReference(n,p[2])}else{throw new Error("JSXGraph: Can't create Hyperbola with parent types '"+(typeof p[0])+"' and '"+(typeof p[1])+"' and '"+(typeof p[2])+"'.\nPossible parent types: [point,point,point], [point,point,number|function]")}}}}d=function(){return e.Dist(r[0])-e.Dist(r[1])}}}if(typeof p[4]=="undefined"){p[4]=1.0001*Math.PI}if(typeof p[3]=="undefined"){p[3]=-1.0001*Math.PI}var o=n.create("point",[function(){return(r[0].X()+r[1].X())*0.5},function(){return(r[0].Y()+r[1].Y())*0.5}],j);var q=function(){var t=r[0].X(),s=r[0].Y(),x=r[1].X(),v=r[1].Y(),u;var w=(x-t>0)?1:-1;if(Math.abs(x-t)>1e-7){u=Math.atan2(v-s,x-t)+((w<0)?Math.PI:0)}else{u=((v-s>0)?0.5:-0.5)*Math.PI}var i=[[1,0,0],[o.X(),Math.cos(u),-Math.sin(u)],[o.Y(),Math.sin(u),Math.cos(u)]];return i};var f=n.create("curve",[function(i){return 0},function(i){return 0},p[3],p[4]],m);var g=function(u,s){var y=d()*0.5,i=y*y,t=r[1].Dist(r[0])*0.5,x=Math.sqrt(-y*y+t*t),v=x*x,w=[[1,0,0],[0,1,0],[0,0,1]],A,z;if(!s){l=q();A=o.X();z=o.Y();w[0][0]=l[0][0];w[0][1]=0;w[0][2]=0;w[1][0]=A*(1-l[1][1])+z*l[1][2];w[1][1]=l[1][1];w[1][2]=l[2][1];w[2][0]=z*(1-l[1][1])-A*l[1][2];w[2][1]=l[1][2];w[2][2]=l[2][2];f.quadraticform=JXG.Math.matMatMult(JXG.Math.transpose(w),JXG.Math.matMatMult([[-1+A*A/i+z*z/v,-A/i,z/v],[-A/i,1/i,0],[z/v,0,-1/v]],w))}return JXG.Math.matVecMult(l,[1,y/Math.cos(u),x*Math.tan(u)])};f.X=function(i,s){return g(i,s)[1]};f.Y=function(i,s){return g(i,s)[2]};f.midpoint=o;f.type=JXG.OBJECT_TYPE_CONIC;return f};JXG.createParabola=function(m,o,g){var k=o[0],e=o[1],i,h=JXG.copyAttributes(g,m.options,"conic","foci"),j=JXG.copyAttributes(g,m.options,"conic");if(o[0].length>1){k=m.create("point",o[0],h)}else{if(JXG.isPoint(o[0])){k=JXG.getReference(m,o[0])}else{if((typeof o[0]=="function")&&(o[0]().elementClass==JXG.OBJECT_CLASS_POINT)){k=o[0]()}else{if(JXG.isString(o[0])){k=JXG.getReference(m,o[0])}else{throw new Error("JSXGraph: Can't create Parabola with parent types '"+(typeof o[0])+"' and '"+(typeof o[1])+"'.\nPossible parent types: [point,line]")}}}}if(typeof o[3]=="undefined"){o[3]=10}if(typeof o[2]=="undefined"){o[2]=-10}var n=m.create("point",[function(){var l=[0,e.stdform[1],e.stdform[2]];l=JXG.Math.crossProduct(l,k.coords.usrCoords);return JXG.Math.Geometry.meetLineLine(l,e.stdform,0,m).usrCoords}],h);var p=function(){var r=Math.atan(e.getSlope()),q=(n.X()+k.X())*0.5,s=(n.Y()+k.Y())*0.5;r+=(k.Y()-n.Y()<0||(k.Y()==n.Y()&&k.X()>n.X()))?Math.PI:0;var l=[[1,0,0],[q*(1-Math.cos(r))+s*Math.sin(r),Math.cos(r),-Math.sin(r)],[s*(1-Math.cos(r))-q*Math.sin(r),Math.sin(r),Math.cos(r)]];return l};var d=m.create("curve",[function(l){return 0},function(l){return 0},o[2],o[3]],j);var f=function(s,u){var v=n.Dist(k)*0.5,r=[[1,0,0],[0,1,0],[0,0,1]],q=(n.X()+k.X())*0.5,l=(n.Y()+k.Y())*0.5;if(!u){i=p();r[0][0]=i[0][0];r[0][1]=0;r[0][2]=0;r[1][0]=q*(1-i[1][1])+l*i[1][2];r[1][1]=i[1][1];r[1][2]=i[2][1];r[2][0]=l*(1-i[1][1])-q*i[1][2];r[2][1]=i[1][2];r[2][2]=i[2][2];d.quadraticform=JXG.Math.matMatMult(JXG.Math.transpose(r),JXG.Math.matMatMult([[-l*4*v-q*q,q,2*v],[q,-1,0],[2*v,0,0]],r))}return JXG.Math.matVecMult(i,[1,s+q,s*s/(v*4)+l])};d.X=function(l,q){return f(l,q)[1]};d.Y=function(l,q){return f(l,q)[2]};d.type=JXG.OBJECT_TYPE_CONIC;return d};JXG.createConic=function(e,w,g){var j=[[1,0,0],[0,1,0],[0,0,1]],B,z,y,x,f=[[1,0,0],[0,1,0],[0,0,1]],o,n,t=[],u,r,A,m=[],s=JXG.copyAttributes(g,e.options,"conic","foci"),q=JXG.copyAttributes(g,e.options,"conic");if(w.length==5){A=true}else{if(w.length==6){A=false}else{throw new Error("JSXGraph: Can't create generic Conic with "+parent.length+" parameters.")}}if(A){for(u=0;u<5;u++){if(w[u].length>1){t[u]=e.create("point",w[u],s)}else{if(JXG.isPoint(w[u])){t[u]=JXG.getReference(e,w[u])}else{if((typeof w[u]=="function")&&(w[u]().elementClass==JXG.OBJECT_CLASS_POINT)){t[u]=w[u]()}else{if(JXG.isString(w[u])){t[u]=JXG.getReference(e,w[u])}else{throw new Error("JSXGraph: Can't create Conic section with parent types '"+(typeof w[u])+"'.\nPossible parent types: [point,point,point,point,point], [a00,a11,a22,a01,a02,a12]")}}}}}}else{r=[[0,0,0],[0,0,0],[0,0,0]];r[0][0]=(JXG.isFunction(w[2]))?function(){return w[2]()}:function(){return w[2]};r[0][1]=(JXG.isFunction(w[4]))?function(){return w[4]()}:function(){return w[4]};r[0][2]=(JXG.isFunction(w[5]))?function(){return w[5]()}:function(){return w[5]};r[1][1]=(JXG.isFunction(w[0]))?function(){return w[0]()}:function(){return w[0]};r[1][2]=(JXG.isFunction(w[3]))?function(){return w[3]()}:function(){return w[3]};r[2][2]=(JXG.isFunction(w[1]))?function(){return w[1]()}:function(){return w[1]}}var h=function(p){var D,C;for(D=0;D<3;D++){for(C=D;C<3;C++){p[D][C]+=p[C][D]}}for(D=0;D<3;D++){for(C=0;C<D;C++){p[D][C]=p[C][D]}}return p};var l=function(C,p){var F,D,E=[[0,0,0],[0,0,0],[0,0,0]];for(F=0;F<3;F++){for(D=0;D<3;D++){E[F][D]=C[F]*p[D]}}return h(E)};var v=function(F,D,E){var I,J,C,K=[[0,0,0],[0,0,0],[0,0,0]],H,G;C=JXG.Math.matVecMult(D,E);I=JXG.Math.innerProduct(E,C);C=JXG.Math.matVecMult(F,E);J=JXG.Math.innerProduct(E,C);for(H=0;H<3;H++){for(G=0;G<3;G++){K[H][G]=I*F[H][G]-J*D[H][G]}}return K};var k=e.create("curve",[function(i){return 0},function(i){return 0},0,2*Math.PI],q);var d=function(F,G){var E,D,p,C;if(!G){if(A){for(E=0;E<5;E++){m[E]=t[E].coords.usrCoords}o=l(JXG.Math.crossProduct(m[0],m[1]),JXG.Math.crossProduct(m[2],m[3]));n=l(JXG.Math.crossProduct(m[0],m[2]),JXG.Math.crossProduct(m[1],m[3]));f=v(o,n,m[4])}else{for(E=0;E<3;E++){for(D=E;D<3;D++){f[E][D]=r[E][D]();if(D>E){f[D][E]=f[E][D]}}}}k.quadraticform=f;B=JXG.Math.Numerics.Jacobi(f);if(B[0][0][0]<0){B[0][0][0]*=(-1);B[0][1][1]*=(-1);B[0][2][2]*=(-1)}for(E=0;E<3;E++){p=0;for(D=0;D<3;D++){p+=B[1][D][E]*B[1][D][E]}p=Math.sqrt(p);for(D=0;D<3;D++){}}j=B[1];x=Math.sqrt(Math.abs(B[0][0][0]));z=Math.sqrt(Math.abs(B[0][1][1]));y=Math.sqrt(Math.abs(B[0][2][2]))}if(B[0][1][1]<=0&&B[0][2][2]<=0){C=JXG.Math.matVecMult(j,[1/x,Math.cos(F)/z,Math.sin(F)/y])}else{if(B[0][1][1]<=0&&B[0][2][2]>0){C=JXG.Math.matVecMult(j,[Math.cos(F)/x,1/z,Math.sin(F)/y])}else{if(B[0][2][2]<0){C=JXG.Math.matVecMult(j,[Math.sin(F)/x,Math.cos(F)/z,1/y])}}}C[1]/=C[0];C[2]/=C[0];C[0]=1;return C};k.X=function(i,p){return d(i,p)[1]};k.Y=function(i,p){return d(i,p)[2]};k.midpoint=e.create("point",[function(){var i=k.quadraticform;return[i[1][1]*i[2][2]-i[1][2]*i[1][2],i[1][2]*i[0][2]-i[2][2]*i[0][1],i[0][1]*i[1][2]-i[1][1]*i[0][2]]}],s);k.type=JXG.OBJECT_TYPE_CONIC;return k};JXG.JSXGraph.registerElement("ellipse",JXG.createEllipse);JXG.JSXGraph.registerElement("hyperbola",JXG.createHyperbola);JXG.JSXGraph.registerElement("parabola",JXG.createParabola);JXG.JSXGraph.registerElement("conic",JXG.createConic);JXG.Polygon=function(h,f,e){this.constructor(h,e,JXG.OBJECT_TYPE_POLYGON,JXG.OBJECT_CLASS_AREA);var g,k,d,j=JXG.copyAttributes(e,h.options,"polygon","lines");this.withLines=e.withlines;this.vertices=[];for(g=0;g<f.length;g++){k=JXG.getRef(this.board,f[g]);this.vertices[g]=k}if(this.vertices[this.vertices.length-1]!=this.vertices[0]){this.vertices.push(this.vertices[0])}this.borders=[];if(this.withLines){for(g=0;g<this.vertices.length-1;g++){j.id=j.ids&&j.ids[g];j.strokecolor=JXG.isArray(j.colors)&&j.colors[g%j.colors.length]||j.strokecolor;if(j.strokecolor===false){j.strokecolor="none"}d=JXG.createSegment(h,[this.vertices[g],this.vertices[g+1]],j);this.borders[g]=d;d.parentPolygon=this}}for(g=0;g<this.vertices.length-1;g++){k=JXG.getReference(this.board,this.vertices[g]);k.addChild(this)}this.createLabel([0,0]);this.id=this.board.setId(this,"Py");this.board.renderer.drawPolygon(this);this.board.finalizeAdding(this)};JXG.Polygon.prototype=new JXG.GeometryElement;JXG.extend(JXG.Polygon.prototype,{hasPoint:function(d,h){var f,e,g=false;for(f=0,e=this.vertices.length-2;f<this.vertices.length-1;e=f++){if(((this.vertices[f].coords.scrCoords[2]>h)!=(this.vertices[e].coords.scrCoords[2]>h))&&(d<(this.vertices[e].coords.scrCoords[1]-this.vertices[f].coords.scrCoords[1])*(h-this.vertices[f].coords.scrCoords[2])/(this.vertices[e].coords.scrCoords[2]-this.vertices[f].coords.scrCoords[2])+this.vertices[f].coords.scrCoords[1])){g=!g}}return g},updateRenderer:function(){if(this.needsUpdate){this.board.renderer.updatePolygon(this);this.needsUpdate=false}if(this.hasLabel&&this.label.content.visProp.visible){this.label.content.update();this.board.renderer.updateText(this.label.content)}},getTextAnchor:function(){var f=this.vertices[0].X(),e=this.vertices[0].Y(),d=f,h=e,g;for(g=0;g<this.vertices.length;g++){if(this.vertices[g].X()<f){f=this.vertices[g].X()}if(this.vertices[g].X()>d){d=this.vertices[g].X()}if(this.vertices[g].Y()>e){e=this.vertices[g].Y()}if(this.vertices[g].Y()<h){h=this.vertices[g].Y()}}return new JXG.Coords(JXG.COORDS_BY_USER,[(f+d)*0.5,(e+h)*0.5],this.board)},getLabelAnchor:JXG.shortcut(JXG.Polygon.prototype,"getTextAnchor"),cloneToBackground:function(){var e={},d;e.id=this.id+"T"+this.numTraces;this.numTraces++;e.vertices=this.vertices;e.visProp=this.visProp;e.visProp.layer=this.board.options.layer.trace;e.board=this.board;JXG.clearVisPropOld(e);d=this.board.renderer.enhancedRendering;this.board.renderer.enhancedRendering=true;this.board.renderer.drawPolygon(e);this.board.renderer.enhancedRendering=d;this.traces[e.id]=e.rendNode},hideElement:function(){var d;this.visProp.visible=false;this.board.renderer.hide(this);for(d=0;d<this.borders.length;d++){this.borders[d].hideElement()}if(this.hasLabel&&JXG.exists(this.label)){this.label.hiddenByParent=true;if(this.label.content.visProp.visible){this.board.renderer.hide(this.label.content)}}},showElement:function(){var d;this.visProp.visible=true;this.board.renderer.show(this);for(d=0;d<this.borders.length;d++){this.borders[d].showElement()}if(this.hasLabel&&JXG.exists(this.label)){if(this.label.content.visProp.visible){this.board.renderer.show(this.label.content)}}},Area:function(){var e=0,d;for(d=0;d<this.vertices.length-1;d++){e+=(this.vertices[d].X()*this.vertices[d+1].Y()-this.vertices[d+1].X()*this.vertices[d].Y())}e/=2;return Math.abs(e)},remove:function(){var d;for(d=0;d<this.borders.length;d++){this.borders[d].remove()}this.board.renderer.remove(this.rendNode)}});JXG.createPolygon=function(j,f,e){var h,g,d=JXG.copyAttributes(e,j.options,"polygon");for(g=0;g<f.length;g++){f[g]=JXG.getReference(j,f[g]);if(!JXG.isPoint(f[g])){throw new Error("JSXGraph: Can't create polygon with parent types other than 'point'.")}}h=new JXG.Polygon(j,f,d);return h};JXG.createRegularPolygon=function(m,r,h){var f,j,g,d=[],e,q,k,o,l;if(JXG.isNumber(r[r.length-1])&&r.length!=3){throw new Error("JSXGraph: A regular polygon needs two point and a number as input.")}k=r.length;g=r[k-1];if((!JXG.isNumber(g)&&!JXG.isPoint(JXG.getReference(m,g)))||g<3){throw new Error("JSXGraph: The third parameter has to be number greater than 2 or a point.")}if(JXG.isPoint(JXG.getReference(m,g))){g=k;o=true}else{k--;o=false}for(j=0;j<k;j++){r[j]=JXG.getReference(m,r[j]);if(!JXG.isPoint(r[j])){throw new Error("JSXGraph: Can't create regular polygon if the first two parameters aren't points.")}}d[0]=r[0];d[1]=r[1];l=JXG.copyAttributes(h,m.options,"polygon","points");for(j=2;j<g;j++){e=m.create("transform",[Math.PI*(2-(g-2)/g),d[j-1]],{type:"rotate"});if(o){d[j]=r[j];d[j].addTransform(r[j-2],e)}else{d[j]=m.create("point",[d[j-2],e],l)}}l=JXG.copyAttributes(h,m.options,"polygon");f=m.create("polygon",d,l);return f};JXG.JSXGraph.registerElement("polygon",JXG.createPolygon);JXG.JSXGraph.registerElement("regularpolygon",JXG.createRegularPolygon);JXG.Curve=function(f,e,d){this.constructor(f,d,JXG.OBJECT_TYPE_CURVE,JXG.OBJECT_CLASS_CURVE);this.points=[];this.doAdvancedPlot=d.doadvancedplot;this.numberPointsHigh=d.numberpointshigh;this.numberPointsLow=d.numberpointslow;this.numberPoints=this.numberPointsHigh;this.dataX=null;this.dataY=null;if(e[0]!=null){this.varname=e[0]}else{this.varname="x"}this.xterm=e[1];this.yterm=e[2];this.generateTerm(this.varname,this.xterm,this.yterm,e[3],e[4]);this.updateCurve();this.id=this.board.setId(this,"G");this.board.renderer.drawCurve(this);this.board.finalizeAdding(this);this.createGradient();this.createLabel();if(typeof this.xterm=="string"){this.notifyParents(this.xterm)}if(typeof this.yterm=="string"){this.notifyParents(this.yterm)}};JXG.Curve.prototype=new JXG.GeometryElement;JXG.extend(JXG.Curve.prototype,{minX:function(){if(this.visProp.curvetype=="polar"){return 0}else{var d=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],this.board);return d.usrCoords[1]}},maxX:function(){var d;if(this.visProp.curvetype=="polar"){return 2*Math.PI}else{d=new JXG.Coords(JXG.COORDS_BY_SCREEN,[this.board.canvasWidth,0],this.board);return d.usrCoords[1]}},hasPoint:function(r,q){var s,A=Infinity,I,m,C,B,v,u,w,f,J,z,o,G,l,F,h,n,p,E=this.numberPointsLow,H=(this.maxX()-this.minX())/E,e=this.board.options.precision.hasPoint/this.board.unitX,g,D,k=true;e=e*e;g=new JXG.Coords(JXG.COORDS_BY_SCREEN,[r,q],this.board);r=g.usrCoords[1];q=g.usrCoords[2];if(this.visProp.curvetype=="parameter"||this.visProp.curvetype=="polar"||this.visProp.curvetype=="functiongraph"){D=this.transformations.length;for(C=0,s=this.minX();C<E;C++){v=this.X(s,k);u=this.Y(s,k);for(B=0;B<D;B++){m=this.transformations[B];m.update();I=JXG.Math.matVecMult(m.matrix,[1,v,u]);v=I[1];u=I[2]}A=(r-v)*(r-v)+(q-u)*(q-u);if(A<e){return true}s+=H}}else{if(this.visProp.curvetype=="plot"){D=this.numberPoints;for(C=0;C<D-1;C++){w=this.X(C);f=this.X(C+1);J=this.Y(C);z=this.Y(C+1);F=f-w;h=z-J;G=r-w;l=q-J;p=F*F+h*h;if(p>=JXG.Math.eps){n=G*F+l*h;o=n/p;A=G*G+l*l-o*n}else{o=0;A=G*G+l*l}if(o>=0&&o<=1&&A<e){return true}}return false}}return(A<e)},allocatePoints:function(){var e,d;d=this.numberPoints;if(this.points.length<this.numberPoints){for(e=this.points.length;e<d;e++){this.points[e]=new JXG.Coords(JXG.COORDS_BY_USER,[0,0],this.board)}}},update:function(){if(this.needsUpdate){if(this.visProp.trace){this.cloneToBackground(true)}this.updateCurve()}return this},updateRenderer:function(){if(this.needsUpdate){this.board.renderer.updateCurve(this);this.needsUpdate=false;if(this.hasLabel&&this.label.content.visProp.visible){this.label.content.update();this.board.renderer.updateText(this.label.content)}}return this},updateDataArray:function(){return this},updateCurve:function(){var e,f,k,d,j,g,h=false;this.updateDataArray();f=this.minX();k=this.maxX();if(this.dataX!=null){this.numberPoints=this.dataX.length;e=this.numberPoints;this.allocatePoints();for(g=0;g<e;g++){d=g;if(this.dataY!=null){j=g}else{j=this.X(d)}this.points[g].setCoordinates(JXG.COORDS_BY_USER,[this.X(d,h),this.Y(j,h)],false);this.updateTransform(this.points[g]);h=true}}else{if(this.doAdvancedPlot){this.updateParametricCurve(f,k,e)}else{if(this.board.updateQuality==this.board.BOARD_QUALITY_HIGH){this.numberPoints=this.numberPointsHigh}else{this.numberPoints=this.numberPointsLow}e=this.numberPoints;this.allocatePoints();this.updateParametricCurveNaive(f,k,e)}}return this},updateParametricCurveNaive:function(f,k,e){var h,g,j=false,d=(k-f)/e;for(h=0;h<e;h++){g=f+h*d;this.points[h].setCoordinates(JXG.COORDS_BY_USER,[this.X(g,j),this.Y(g,j)],false);this.updateTransform(this.points[h]);j=true}return this},updateParametricCurve:function(E,e){var v,p,o,g=false,z=new JXG.Coords(JXG.COORDS_BY_USER,[0,0],this.board),n,m,B,f,q,G,F,s,k,w=[],h=[],D=[],A=[],r=false,u=0,C,l=function(K,J,L){var t=L[1]-K[1],I=L[2]-K[2],j=J[0]-K[1],y=J[1]-K[2],H=j*j+y*y,i,x;if(H>=JXG.Math.eps){i=(t*j+I*y)/H;if(i>0){if(i<=1){t-=i*j;I-=i*y}else{t-=j;I-=y}}}x=t*t+I*I;return Math.sqrt(x)};if(this.board.updateQuality==this.board.BOARD_QUALITY_LOW){F=15;s=10;k=10}else{F=21;s=0.7;k=0.7}A[0]=e-E;for(v=1;v<F;v++){A[v]=A[v-1]*0.5}v=1;w[0]=1;h[0]=0;p=E;z.setCoordinates(JXG.COORDS_BY_USER,[this.X(p,g),this.Y(p,g)],false);g=true;B=z.scrCoords[1];f=z.scrCoords[2];o=p;p=e;z.setCoordinates(JXG.COORDS_BY_USER,[this.X(p,g),this.Y(p,g)],false);n=z.scrCoords[1];m=z.scrCoords[2];D[0]=[n,m];q=1;G=0;this.points=[];this.points[u++]=new JXG.Coords(JXG.COORDS_BY_SCREEN,[B,f],this.board);do{r=this.isDistOK(n-B,m-f,s,k)||this.isSegmentOutside(B,f,n,m);while(G<F&&(!r||G<3)&&(this.isSegmentDefined(B,f,n,m)||G<=7)){w[q]=v;h[q]=G;D[q]=[n,m];q++;v=2*v-1;G++;p=E+v*A[G];z.setCoordinates(JXG.COORDS_BY_USER,[this.X(p,g),this.Y(p,g)],false);n=z.scrCoords[1];m=z.scrCoords[2];r=this.isDistOK(n-B,m-f,s,k)||this.isSegmentOutside(B,f,n,m)}if(u>1){C=l(this.points[u-2].scrCoords,[n,m],this.points[u-1].scrCoords);if(C<0.015){u--}}this.points[u]=new JXG.Coords(JXG.COORDS_BY_SCREEN,[n,m],this.board);this.updateTransform(this.points[u]);u++;B=n;f=m;o=p;q--;n=D[q][0];m=D[q][1];G=h[q]+1;v=w[q]*2}while(q>0&&u<500000);this.numberPoints=this.points.length;return this},isSegmentOutside:function(e,g,d,f){if(g<0&&f<0){return true}else{if(g>this.board.canvasHeight&&f>this.board.canvasHeight){return true}else{if(e<0&&d<0){return true}else{if(e>this.board.canvasWidth&&d>this.board.canvasWidth){return true}}}}return false},isDistOK:function(f,d,g,e){if(isNaN(f+d)){return false}return(Math.abs(f)<e&&Math.abs(d)<e)},isSegmentDefined:function(e,g,d,f){return !(isNaN(e+g)&&isNaN(d+f))},updateTransform:function(g){var f,h,e,d=this.transformations.length;if(d==0){return g}for(e=0;e<d;e++){f=this.transformations[e];f.update();h=JXG.Math.matVecMult(f.matrix,g.usrCoords);g.setCoordinates(JXG.COORDS_BY_USER,[h[1],h[2]])}return g},addTransform:function(e){var g,f,d;g=JXG.isArray(e)?e:[e];d=g.length;for(f=0;f<d;f++){this.transformations.push(g[f])}return this},setPosition:function(g,d,f){var e=this.board.create("transform",[d,f],{type:"translate"});if(this.transformations.length>0&&this.transformations[this.transformations.length-1].isNumericMatrix){this.transformations[this.transformations.length-1].melt(e)}else{this.addTransform(e)}return this},generateTerm:function(e,i,f,d,j){var h,g;if(JXG.isArray(i)){this.dataX=i;this.X=function(m){var l=parseInt(Math.floor(m)),k,n;if(m<0){l=0}else{if(m>this.dataX.length-2){l=this.dataX.length-2}}if(l==m){return this.dataX[l]}else{k=this.dataX[l];n=this.dataX[l+1];return k+(n-k)*(m-l)}};this.visProp.curvetype="plot";this.numberPoints=this.dataX.length}else{this.X=JXG.createFunction(i,this.board,e);if(JXG.isString(i)){this.visProp.curvetype="functiongraph"}else{if(JXG.isFunction(i)||JXG.isNumber(i)){this.visProp.curvetype="parameter"}}}if(JXG.isArray(f)){this.dataY=f;this.Y=function(m){var l=parseInt(Math.floor(m)),k,n;if(m<0){l=0}else{if(m>this.dataY.length-2){l=this.dataY.length-2}}if(l==m){if(JXG.isFunction(this.dataY[l])){return this.dataY[l]()}else{return this.dataY[l]}}else{if(JXG.isFunction(this.dataY[l])){k=this.dataY[l]()}else{k=this.dataY[l]}if(JXG.isFunction(this.dataY[l+1])){n=this.dataY[l+1]()}else{n=this.dataY[l+1]}return k+(n-k)*(m-l)}}}else{this.Y=JXG.createFunction(f,this.board,e)}if(JXG.isFunction(i)&&JXG.isArray(f)){h=JXG.createFunction(f[0],this.board,"");g=JXG.createFunction(f[1],this.board,"");this.X=function(k){return(i)(k)*Math.cos(k)+h()};this.Y=function(k){return(i)(k)*Math.sin(k)+g()};this.visProp.curvetype="polar"}if(d!=null){this.minX=JXG.createFunction(d,this.board,"")}if(j!=null){this.maxX=JXG.createFunction(j,this.board,"")}},notifyParents:function(d){JXG.GeonextParser.findDependencies(this,d,this.board)},getLabelAnchor:function(){var d=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,this.board.canvasHeight*0.5],this.board);d=JXG.Math.Geometry.projectCoordsToCurve(d.usrCoords[1],d.usrCoords[2],0,this,this.board)[0];return d},cloneToBackground:function(){var e={},d;e.id=this.id+"T"+this.numTraces;e.elementClass=JXG.OBJECT_CLASS_CURVE;this.numTraces++;e.points=this.points.slice(0);e.numberPoints=this.numberPoints;e.board=this.board;e.visProp=this.visProp;e.visProp.layer=this.board.options.layer.trace;e.visProp.curvetype=this.visProp.curvetype;JXG.clearVisPropOld(e);d=this.board.renderer.enhancedRendering;this.board.renderer.enhancedRendering=true;this.board.renderer.drawCurve(e);this.board.renderer.enhancedRendering=d;this.traces[e.id]=e.rendNode},bounds:function(){var m=this.numberPointsLow,k=(this.maxX()-this.minX())/m,f,e,q,p,l,h,o,n,g=[this.minX(),0,this.maxX(),0];if(this.visProp.curvetype=="parameter"||this.visProp.curvetype=="polar"||this.visProp.curvetype=="functiongraph"){h=this.transformations.length;p=this.minX();for(f=0;f<m;f++){o=this.X(p,true);n=this.Y(p,true);for(e=0;e<h;e++){q=this.transformations[e];q.update();l=JXG.Math.matVecMult(q.matrix,[1,o,n]);o=l[1];n=l[2]}if(g[1]<n){g[1]=n}if(g[3]>n){g[3]=n}p+=k}}else{if(this.visProp.curvetype=="plot"){h=this.numberPoints;for(f=0;f<h;f++){n=this.Y(f);if(g[1]<n){g[1]=n}if(g[3]>n){g[3]=n}}}}return g}});JXG.createCurve=function(g,f,e){var d=JXG.copyAttributes(e,g.options,"curve");return new JXG.Curve(g,["x"].concat(f),d)};JXG.JSXGraph.registerElement("curve",JXG.createCurve);JXG.createFunctiongraph=function(h,f,e){var d,g=["x","x"].concat(f);d=JXG.copyAttributes(e,h.options,"curve");d.curvetype="functiongraph";return new JXG.Curve(h,g,d)};JXG.JSXGraph.registerElement("functiongraph",JXG.createFunctiongraph);JXG.JSXGraph.registerElement("plot",JXG.createFunctiongraph);JXG.createSpline=function(f,e,d){var g;g=function(){var j,h=[],k=[];var i=function(o,n){var m,l;if(!n){h=[];k=[];if(e.length==2&&JXG.isArray(e[0])&&JXG.isArray(e[1])&&e[0].length==e[1].length){for(m=0;m<e[0].length;m++){if(typeof e[0][m]=="function"){h.push(e[0][m]())}else{h.push(e[0][m])}if(typeof e[1][m]=="function"){k.push(e[1][m]())}else{k.push(e[1][m])}}}else{for(m=0;m<e.length;m++){if(JXG.isPoint(e[m])){h.push(e[m].X());k.push(e[m].Y())}else{if(JXG.isArray(e[m])&&e[m].length==2){for(m=0;m<e.length;m++){if(typeof e[m][0]=="function"){h.push(e[m][0]())}else{h.push(e[m][0])}if(typeof e[m][1]=="function"){k.push(e[m][1]())}else{k.push(e[m][1])}}}}}}j=JXG.Math.Numerics.splineDef(h,k)}return JXG.Math.Numerics.splineEval(o,h,k,j)};return i};return f.create("curve",["x",g()],d)};JXG.JSXGraph.registerElement("spline",JXG.createSpline);JXG.createRiemannsum=function(i,m,e){var d,l,g,j,k,h;h=JXG.copyAttributes(e,i.options,"riemannsum");h.curvetype="plot";g=m[0];d=JXG.createFunction(m[1],i,"");if(d==null){throw new Error("JSXGraph: JXG.createRiemannsum: argument '2' n has to be number or function.\nPossible parent types: [function,n:number|function,type,start:number|function,end:number|function]")}l=JXG.createFunction(m[2],i,"",false);if(l==null){throw new Error("JSXGraph: JXG.createRiemannsum: argument 3 'type' has to be string or function.\nPossible parent types: [function,n:number|function,type,start:number|function,end:number|function]")}j=[[0],[0]].concat(m.slice(3));k=i.create("curve",j,h);k.updateDataArray=function(){var f=JXG.Math.Numerics.riemann(g,d(),l(),this.minX(),this.maxX());this.dataX=f[0];this.dataY=f[1]};return k};JXG.JSXGraph.registerElement("riemannsum",JXG.createRiemannsum);JXG.createArc=function(h,f,e){var g,d;if(!(f=JXG.checkParents("arc",f,[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT],[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]))){throw new Error("JSXGraph: Can't create Arc with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"' and '"+(typeof f[2])+"'.\nPossible parent types: [point,point,point]")}d=JXG.copyAttributes(e,h.options,"arc");g=h.create("curve",[[0],[0]],d);g.type=JXG.OBJECT_TYPE_ARC;g.midpoint=JXG.getReference(h,f[0]);g.radiuspoint=JXG.getReference(h,f[1]);g.point2=g.radiuspoint;g.anglepoint=JXG.getReference(h,f[2]);g.point3=g.anglepoint;g.midpoint.addChild(g);g.radiuspoint.addChild(g);g.anglepoint.addChild(g);g.useDirection=d.usedirection;g.updateDataArray=function(){var u=this.radiuspoint,t=this.midpoint,s=this.anglepoint,F,m,H,z,j=JXG.Math.Geometry.rad(u,t,s),D,w=Math.ceil(j/Math.PI*90)+1,G=j/w,p=t.X(),o=t.Y(),q,l,k,r,E;if(this.useDirection){k=f[1].coords.usrCoords;r=f[3].coords.usrCoords;E=f[2].coords.usrCoords;l=(k[1]-E[1])*(k[2]-r[2])-(k[2]-E[2])*(k[1]-r[1]);if(l<0){this.radiuspoint=f[1];this.anglepoint=f[2]}else{this.radiuspoint=f[2];this.anglepoint=f[1]}}this.dataX=[u.X()];this.dataY=[u.Y()];for(F=G,D=1;D<=w;D++,F+=G){m=Math.cos(F);H=Math.sin(F);z=[[1,0,0],[p*(1-m)+o*H,m,-H],[o*(1-m)-p*H,H,m]];q=JXG.Math.matVecMult(z,u.coords.usrCoords);this.dataX.push(q[1]/q[0]);this.dataY.push(q[2]/q[0])}this.updateStdform();this.updateQuadraticform()};g.Radius=function(){return this.radiuspoint.Dist(this.midpoint)};g.getRadius=function(){return this.Radius()};g.hasPoint=function(i,p){var k=this.board.options.precision.hasPoint/(this.board.unitX),o=new JXG.Coords(JXG.COORDS_BY_SCREEN,[i,p],this.board),l=this.Radius(),n=this.midpoint.coords.distance(JXG.COORDS_BY_USER,o),j=(Math.abs(n-l)<k),m;if(j){m=JXG.Math.Geometry.rad(this.radiuspoint,this.midpoint,o.usrCoords.slice(1));if(m>JXG.Math.Geometry.rad(this.radiuspoint,this.midpoint,this.anglepoint)){j=false}}return j};g.hasPointSector=function(i,o){var n=new JXG.Coords(JXG.COORDS_BY_SCREEN,[i,o],this.board),k=this.Radius(),m=this.midpoint.coords.distance(JXG.COORDS_BY_USER,n),j=(m<k),l;if(j){l=JXG.Math.Geometry.rad(this.radiuspoint,this.midpoint,n.usrCoords.slice(1));if(l>JXG.Math.Geometry.rad(this.radiuspoint,this.midpoint,this.anglepoint)){j=false}}return j};g.getTextAnchor=function(){return this.midpoint.coords};g.getLabelAnchor=function(){var k=JXG.Math.Geometry.rad(this.radiuspoint,this.midpoint,this.anglepoint),s=10/(this.board.unitX),q=10/(this.board.unitY),o=this.point2.coords.usrCoords,i=this.midpoint.coords.usrCoords,j=o[1]-i[1],r=o[2]-i[2],p,m,l,n;if(this.label.content!=null){this.label.content.relativeCoords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],this.board)}p=new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+Math.cos(k*0.5)*j-Math.sin(k*0.5)*r,i[2]+Math.sin(k*0.5)*j+Math.cos(k*0.5)*r],this.board);m=p.usrCoords[1]-i[1];l=p.usrCoords[2]-i[2];n=Math.sqrt(m*m+l*l);m=m*(n+s)/n;l=l*(n+q)/n;return new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+m,i[2]+l],this.board)};g.updateQuadraticform=function(){var i=this.midpoint,l=i.X(),k=i.Y(),j=this.Radius();this.quadraticform=[[l*l+k*k-j*j,-l,-k],[-l,1,0],[-k,0,1]]};g.updateStdform=function(){this.stdform[3]=0.5;this.stdform[4]=this.Radius();this.stdform[1]=-this.midpoint.coords.usrCoords[1];this.stdform[2]=-this.midpoint.coords.usrCoords[2];this.normalize()};g.prepareUpdate().update();return g};JXG.JSXGraph.registerElement("arc",JXG.createArc);JXG.createSemicircle=function(h,f,e){var g,i,d;if((JXG.isPoint(f[0]))&&(JXG.isPoint(f[1]))){d=JXG.copyAttributes(e,h.options,"circle","center");i=h.create("midpoint",[f[0],f[1]],d);d=JXG.copyAttributes(e,h.options,"circle");g=h.create("arc",[i,f[1],f[0]],d);g.midpoint=i}else{throw new Error("JSXGraph: Can't create Semicircle with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [point,point]")}return g};JXG.JSXGraph.registerElement("semicircle",JXG.createSemicircle);JXG.createCircumcircleArc=function(h,f,e){var g,i,d;if((JXG.isPoint(f[0]))&&(JXG.isPoint(f[1]))&&(JXG.isPoint(f[2]))){d=JXG.copyAttributes(e,h.options,"arc","center");i=h.create("circumcirclemidpoint",[f[0],f[1],f[2]],d);d=JXG.copyAttributes(e,h.options,"arc");d.usedirection=true;g=h.create("arc",[i,f[0],f[2],f[1]],d);g.midpoint=i}else{throw new Error("JSXGraph: create Circumcircle Arc with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"' and '"+(typeof f[2])+"'.\nPossible parent types: [point,point,point]")}return g};JXG.JSXGraph.registerElement("circumcirclearc",JXG.createCircumcircleArc);JXG.createSector=function(h,f,e){var g,d;if(!(JXG.isPoint(f[0])&&JXG.isPoint(f[1])&&JXG.isPoint(f[2]))){throw new Error("JSXGraph: Can't create Sector with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"' and '"+(typeof f[2])+"'.")}d=JXG.copyAttributes(e,h.options,"sector");g=h.create("curve",[[0],[0]],d);g.type=JXG.OBJECT_TYPE_SECTOR;g.point1=JXG.getReference(h,f[0]);g.point2=JXG.getReference(h,f[1]);g.point3=JXG.getReference(h,f[2]);g.point1.addChild(g);g.point2.addChild(g);g.point3.addChild(g);g.useDirection=e.usedirection;g.updateDataArray=function(){var u=this.point2,t=this.point1,s=this.point3,F,m,H,z,j=JXG.Math.Geometry.rad(u,t,s),D,w=Math.ceil(j/Math.PI*90)+1,G=j/w,p=t.X(),o=t.Y(),q,l,k,r,E;if(this.useDirection){k=f[1].coords.usrCoords,r=f[3].coords.usrCoords,E=f[2].coords.usrCoords;l=(k[1]-E[1])*(k[2]-r[2])-(k[2]-E[2])*(k[1]-r[1]);if(l<0){this.point2=f[1];this.point3=f[2]}else{this.point2=f[2];this.point3=f[1]}}this.dataX=[t.X(),u.X()];this.dataY=[t.Y(),u.Y()];for(F=G,D=1;D<=w;D++,F+=G){m=Math.cos(F);H=Math.sin(F);z=[[1,0,0],[p*(1-m)+o*H,m,-H],[o*(1-m)-p*H,H,m]];q=JXG.Math.matVecMult(z,u.coords.usrCoords);this.dataX.push(q[1]/q[0]);this.dataY.push(q[2]/q[0])}this.dataX.push(t.X());this.dataY.push(t.Y())};g.Radius=function(){return this.point2.Dist(this.point1)};g.getRadius=function(){return this.Radius()};g.hasPointSector=function(i,o){var n=new JXG.Coords(JXG.COORDS_BY_SCREEN,[i,o],this.board),k=this.Radius(),m=this.point1.coords.distance(JXG.COORDS_BY_USER,n),j=(m<k),l;if(j){l=JXG.Math.Geometry.rad(this.point2,this.point1,n.usrCoords.slice(1));if(l>JXG.Math.Geometry.rad(this.point2,this.point1,this.point3)){j=false}}return j};g.getTextAnchor=function(){return this.point1.coords};g.getLabelAnchor=function(){var k=JXG.Math.Geometry.rad(this.point2,this.point1,this.point3),s=10/(this.board.unitX),q=10/(this.board.unitY),o=this.point2.coords.usrCoords,i=this.point1.coords.usrCoords,j=o[1]-i[1],r=o[2]-i[2],p,m,l,n;if(this.label.content!=null){this.label.content.relativeCoords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],this.board)}p=new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+Math.cos(k*0.5)*j-Math.sin(k*0.5)*r,i[2]+Math.sin(k*0.5)*j+Math.cos(k*0.5)*r],this.board);m=p.usrCoords[1]-i[1];l=p.usrCoords[2]-i[2];n=Math.sqrt(m*m+l*l);m=m*(n+s)/n;l=l*(n+q)/n;return new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+m,i[2]+l],this.board)};g.prepareUpdate().update();return g};JXG.JSXGraph.registerElement("sector",JXG.createSector);JXG.createCircumcircleSector=function(h,f,e){var g,i,d;if((JXG.isPoint(f[0]))&&(JXG.isPoint(f[1]))&&(JXG.isPoint(f[2]))){d=JXG.copyAttributes(e,h.options,"circumcirclesector","point");i=h.create("circumcirclemidpoint",[f[0],f[1],f[2]],d);d=JXG.copyAttributes(e,h.options,"circumcirclesector");g=h.create("sector",[i,f[0],f[2],f[1]],d)}else{throw new Error("JSXGraph: Can't create circumcircle sector with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"' and '"+(typeof f[2])+"'.")}return g};JXG.JSXGraph.registerElement("circumcirclesector",JXG.createCircumcircleSector);JXG.createAngle=function(m,r,k){var f,e,t,n,q=["&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;"],l=0,h,o,g,s,u,d;if((JXG.isPoint(r[0]))&&(JXG.isPoint(r[1]))&&(JXG.isPoint(r[2]))){t=k.text;if(t==""){while(l<q.length){h=l;o=q[l];for(f in m.objects){if(m.objects[f].type==JXG.OBJECT_TYPE_ANGLE){if(m.objects[f].text==o){l++;break}}}if(l==h){t=o;l=q.length+1}}if(l==q.length){g="&alpha;_{";s="}";u=false;h=0;while(!u){for(f in m.objects){if(m.objects[f].type==JXG.OBJECT_TYPE_ANGLE){if(m.objects[f].text==(g+h+s)){u=true;break}}}if(u){u=false}else{u=true;t=(g+h+s)}}}}n=JXG.copyAttributes(k,m.options,"angle","point");e=m.create("point",[function(){var i=r[0],v=r[1],j=n.radius,p=v.Dist(i);return[v.X()+(i.X()-v.X())*j/p,v.Y()+(i.Y()-v.Y())*j/p]}],n);n=JXG.copyAttributes(k,m.options,"angle");f=m.create("sector",[r[1],e,r[2]],n);f.radiuspoint=e;d=JXG.copyAttributes(k,m.options,"angle","dot");f.dot=m.create("point",[function(){if(JXG.exists(f.dot)&&f.dot.visProp.visible===false){return[0,0]}var j=e.coords.usrCoords,i=m.create("transform",[-r[1].X(),-r[1].Y()],{type:"translate"});i.melt(m.create("transform",[0.5,0.5],{type:"scale"}));i.melt(m.create("transform",[JXG.Math.Geometry.rad(r[0],r[1],r[2])/2,0,0],{type:"rotate"}));i.melt(m.create("transform",[r[1].X(),r[1].Y()],{type:"translate"}));i.update();return JXG.Math.matVecMult(i.matrix,j)}],d);for(l=0;l<3;l++){JXG.getRef(m,r[l]).addChild(e);JXG.getRef(m,r[l]).addChild(f.dot)}f.type=JXG.OBJECT_TYPE_ANGLE;if(f.visProp.withlabel){f.label.content.setText(t);f.label.content.setProperty({fontSize:f.visProp.fontsize,strokeColor:f.visProp.textcolor})}JXG.getRef(m,r[0]).addChild(f);f.getLabelAnchor=function(){var p=JXG.Math.Geometry.rad(this.point2,this.point1,this.point3),C=10/(this.board.unitX),A=10/(this.board.unitY),y=this.point2.coords.usrCoords,i=this.point1.coords.usrCoords,j=y[1]-i[1],B=y[2]-i[2],z,w,v,x;if(this.label.content!=null){this.label.content.relativeCoords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],this.board)}z=new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+Math.cos(p*0.5*1.125)*j-Math.sin(p*0.5*1.125)*B,i[2]+Math.sin(p*0.5*1.125)*j+Math.cos(p*0.5*1.125)*B],this.board);w=z.usrCoords[1]-i[1];v=z.usrCoords[2]-i[2];x=Math.sqrt(w*w+v*v);w=w*(x+C)/x;v=v*(x+A)/x;return new JXG.Coords(JXG.COORDS_BY_USER,[i[1]+w,i[2]+v],this.board)}}else{throw new Error("JSXGraph: Can't create angle with parent types '"+(typeof r[0])+"' and '"+(typeof r[1])+"' and '"+(typeof r[2])+"'.")}return f};JXG.JSXGraph.registerElement("angle",JXG.createAngle);JXG.Composition=function(h){var g=["setProperty","prepareUpdate","updateRenderer","update","highlight","noHighlight"],d=function(e){return function(){var j;for(j in f.elements){if(JXG.exists(f.elements[j][e])){f.elements[j][e].apply(f.elements[j],arguments)}}return f}},f=this,i;for(i=0;i<g.length;i++){this[g[i]]=d(g[i])}this.elements={};for(i in h){if(h.hasOwnProperty(i)){this.add(i,h[i])}}};JXG.extend(JXG.Composition.prototype,{add:function(e,d){if(!JXG.exists(this[e])&&JXG.exists(d)){if(JXG.exists(d.id)){this.elements[d.id]=d}else{this.elements[e]=d}this[e]=d;return true}return false},remove:function(g){var d=false,f;for(f in this.elements){if(this.elements[f].id===this[g].id){d=true;break}}if(d){delete this.elements[this[g].id];delete this[g]}return d}});JXG.createPerpendicularPoint=function(h,f,e){var d,i,g;if(JXG.isPoint(f[0])&&f[1].elementClass==JXG.OBJECT_CLASS_LINE){i=f[0];d=f[1]}else{if(JXG.isPoint(f[1])&&f[0].elementClass==JXG.OBJECT_CLASS_LINE){i=f[1];d=f[0]}else{throw new Error("JSXGraph: Can't create perpendicular point with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [point,line]")}}g=h.create("point",[function(){return JXG.Math.Geometry.perpendicular(d,i,h)[0]}],e);i.addChild(g);d.addChild(g);g.update();g.generatePolynomial=function(){var k=d.point1.symbolic.x;var j=d.point1.symbolic.y;var q=d.point2.symbolic.x;var p=d.point2.symbolic.y;var s=i.symbolic.x;var r=i.symbolic.y;var n=g.symbolic.x;var l=g.symbolic.y;var o="("+j+")*("+n+")-("+j+")*("+q+")+("+l+")*("+q+")-("+k+")*("+l+")+("+k+")*("+p+")-("+n+")*("+p+")";var m="("+r+")*("+j+")-("+r+")*("+p+")-("+l+")*("+j+")+("+l+")*("+p+")+("+s+")*("+k+")-("+s+")*("+q+")-("+n+")*("+k+")+("+n+")*("+q+")";return[o,m]};return g};JXG.createPerpendicular=function(j,h,g){var k,e,f,i,d;h[0]=JXG.getReference(j,h[0]);h[1]=JXG.getReference(j,h[1]);if(JXG.isPoint(h[0])&&h[1].elementClass==JXG.OBJECT_CLASS_LINE){e=h[1];k=h[0]}else{if(JXG.isPoint(h[1])&&h[0].elementClass==JXG.OBJECT_CLASS_LINE){e=h[0];k=h[1]}else{throw new Error("JSXGraph: Can't create perpendicular with parent types '"+(typeof h[0])+"' and '"+(typeof h[1])+"'.\nPossible parent types: [line,point]")}}d=JXG.copyAttributes(g,j.options,"perpendicular","point");i=JXG.createPerpendicularPoint(j,[e,k],d);if(!JXG.exists(g.layer)){g.layer=j.options.layer.line}d=JXG.copyAttributes(g,j.options,"perpendicular");f=JXG.createLine(j,[function(){return(JXG.Math.Geometry.perpendicular(e,k,j)[1]?[i,k]:[k,i])}],d);f.perpendicularpoint=i;return f};JXG.createMidpoint=function(i,g,f){var e,d,h;if(g.length==2&&JXG.isPoint(g[0])&&JXG.isPoint(g[1])){e=g[0];d=g[1]}else{if(g.length==1&&g[0].elementClass==JXG.OBJECT_CLASS_LINE){e=g[0].point1;d=g[0].point2}else{throw new Error("JSXGraph: Can't create midpoint.\nPossible parent types: [point,point], [line]")}}h=i.create("point",[function(){return(e.coords.usrCoords[1]+d.coords.usrCoords[1])/2},function(){return(e.coords.usrCoords[2]+d.coords.usrCoords[2])/2}],f);e.addChild(h);d.addChild(h);h.prepareUpdate().update();h.generatePolynomial=function(){var l=e.symbolic.x;var k=e.symbolic.y;var n=d.symbolic.x;var m=d.symbolic.y;var p=h.symbolic.x;var o=h.symbolic.y;var j="("+k+")*("+p+")-("+k+")*("+n+")+("+o+")*("+n+")-("+l+")*("+o+")+("+l+")*("+m+")-("+p+")*("+m+")";var q="("+l+")^2 - 2*("+l+")*("+p+")+("+k+")^2-2*("+k+")*("+o+")-("+n+")^2+2*("+n+")*("+p+")-("+m+")^2+2*("+m+")*("+o+")";return[j,q]};return h};JXG.createParallelPoint=function(h,g,f){var e,d,j,i;if(g.length==3&&g[0].elementClass==JXG.OBJECT_CLASS_POINT&&g[1].elementClass==JXG.OBJECT_CLASS_POINT&&g[2].elementClass==JXG.OBJECT_CLASS_POINT){e=g[0];d=g[1];j=g[2]}else{if(g[0].elementClass==JXG.OBJECT_CLASS_POINT&&g[1].elementClass==JXG.OBJECT_CLASS_LINE){j=g[0];e=g[1].point1;d=g[1].point2}else{if(g[1].elementClass==JXG.OBJECT_CLASS_POINT&&g[0].elementClass==JXG.OBJECT_CLASS_LINE){j=g[1];e=g[0].point1;d=g[0].point2}else{throw new Error("JSXGraph: Can't create parallel point with parent types '"+(typeof g[0])+"', '"+(typeof g[1])+"' and '"+(typeof g[2])+"'.\nPossible parent types: [line,point], [point,point,point]")}}}i=h.create("point",[function(){return j.coords.usrCoords[1]+d.coords.usrCoords[1]-e.coords.usrCoords[1]},function(){return j.coords.usrCoords[2]+d.coords.usrCoords[2]-e.coords.usrCoords[2]}],f);e.addChild(i);d.addChild(i);j.addChild(i);i.prepareUpdate().update();i.generatePolynomial=function(){var l=e.symbolic.x;var k=e.symbolic.y;var t=d.symbolic.x;var s=d.symbolic.y;var n=j.symbolic.x;var m=j.symbolic.y;var q=i.symbolic.x;var o=i.symbolic.y;var r="("+s+")*("+q+")-("+s+")*("+n+")-("+k+")*("+q+")+("+k+")*("+n+")-("+o+")*("+t+")+("+o+")*("+l+")+("+m+")*("+t+")-("+m+")*("+l+")";var p="("+o+")*("+l+")-("+o+")*("+n+")-("+s+")*("+l+")+("+s+")*("+n+")-("+q+")*("+k+")+("+q+")*("+m+")+("+t+")*("+k+")-("+t+")*("+m+")";return[r,p]};return i};JXG.createParallel=function(j,h,g){var l,f,i,d;try{d=JXG.copyAttributes(g,j.options,"parallel","point");f=JXG.createParallelPoint(j,h,d)}catch(k){throw new Error("JSXGraph: Can't create parallel with parent types '"+(typeof h[0])+"' and '"+(typeof h[1])+"'.\nPossible parent types: [line,point], [point,point,point]")}l=null;if(h.length==3){l=h[2]}else{if(h[0].elementClass==JXG.OBJECT_CLASS_POINT){l=h[0]}else{if(h[1].elementClass==JXG.OBJECT_CLASS_POINT){l=h[1]}}}if(!JXG.exists(g.layer)){g.layer=j.options.layer.line}d=JXG.copyAttributes(g,j.options,"parallel");i=j.create("line",[l,f],d);i.parallelpoint=f;return i};JXG.createArrowParallel=function(g,f,d){try{return JXG.createParallel(g,f,d).setStraight(false,false).setArrow(false,true)}catch(h){throw new Error("JSXGraph: Can't create arrowparallel with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [line,point], [point,point,point]")}};JXG.createNormal=function(h,e,d){var k;var l;if(e.length==1){k=e[0];l=k.slideObject}else{if(e.length==2){if(JXG.isPoint(e[0])){k=e[0];l=e[1]}else{if(JXG.isPoint(e[1])){l=e[0];k=e[1]}else{throw new Error("JSXGraph: Can't create normal with parent types '"+(typeof e[0])+"' and '"+(typeof e[1])+"'.\nPossible parent types: [point,line], [point,circle], [glider]")}}}else{throw new Error("JSXGraph: Can't create normal with parent types '"+(typeof e[0])+"' and '"+(typeof e[1])+"'.\nPossible parent types: [point,line], [point,circle], [glider]")}}if(l.elementClass==JXG.OBJECT_CLASS_LINE){return h.create("line",[function(){return l.stdform[1]*k.Y()-l.stdform[2]*k.X()},function(){return l.stdform[2]*k.Z()},function(){return -l.stdform[1]*k.Z()}],d)}else{if(l.elementClass==JXG.OBJECT_CLASS_CIRCLE){return h.create("line",[l.midpoint,k],d)}else{if(l.elementClass==JXG.OBJECT_CLASS_CURVE){if(l.visProp.curvetype!="plot"){var i=l.X;var j=l.Y;return h.create("line",[function(){return -k.X()*h.D(i)(k.position)-k.Y()*h.D(j)(k.position)},function(){return h.D(i)(k.position)},function(){return h.D(j)(k.position)}],d)}else{return h.create("line",[function(){var g=Math.floor(k.position);var f=k.position-g;if(g==l.numberPoints-1){g--;f=1}if(g<0){return 1}return(l.Y(g)+f*(l.Y(g+1)-l.Y(g)))*(l.Y(g)-l.Y(g+1))-(l.X(g)+f*(l.X(g+1)-l.X(g)))*(l.X(g+1)-l.X(g))},function(){var f=Math.floor(k.position);if(f==l.numberPoints-1){f--}if(f<0){return 0}return l.X(f+1)-l.X(f)},function(){var f=Math.floor(k.position);if(f==l.numberPoints-1){f--}if(f<0){return 0}return l.Y(f+1)-l.Y(f)}],d)}}else{if(l.type==JXG.OBJECT_TYPE_TURTLE){return h.create("line",[function(){var m=Math.floor(k.position);var f=k.position-m;var n,g;for(g=0;g<l.objects.length;g++){n=l.objects[g];if(n.type==JXG.OBJECT_TYPE_CURVE){if(m<n.numberPoints){break}m-=n.numberPoints}}if(m==n.numberPoints-1){m--;f=1}if(m<0){return 1}return(n.Y(m)+f*(n.Y(m+1)-n.Y(m)))*(n.Y(m)-n.Y(m+1))-(n.X(m)+f*(n.X(m+1)-n.X(m)))*(n.X(m+1)-n.X(m))},function(){var g=Math.floor(k.position);var m,f;for(f=0;f<l.objects.length;f++){m=l.objects[f];if(m.type==JXG.OBJECT_TYPE_CURVE){if(g<m.numberPoints){break}g-=m.numberPoints}}if(g==m.numberPoints-1){g--}if(g<0){return 0}return m.X(g+1)-m.X(g)},function(){var g=Math.floor(k.position);var m,f;for(f=0;f<l.objects.length;f++){m=l.objects[f];if(m.type==JXG.OBJECT_TYPE_CURVE){if(g<m.numberPoints){break}g-=m.numberPoints}}if(g==m.numberPoints-1){g--}if(g<0){return 0}return m.Y(g+1)-m.Y(g)}],d)}else{throw new Error("JSXGraph: Can't create normal with parent types '"+(typeof e[0])+"' and '"+(typeof e[1])+"'.\nPossible parent types: [point,line], [point,circle], [glider]")}}}}};JXG.createBisector=function(j,g,f){var k,e,h,d;if(g[0].elementClass==JXG.OBJECT_CLASS_POINT&&g[1].elementClass==JXG.OBJECT_CLASS_POINT&&g[2].elementClass==JXG.OBJECT_CLASS_POINT){d=JXG.copyAttributes(f,j.options,"bisector","point");k=j.create("point",[function(){return JXG.Math.Geometry.angleBisector(g[0],g[1],g[2],j)}],d);for(h=0;h<3;h++){g[h].addChild(k)}if(!JXG.exists(f.layer)){f.layer=j.options.layer.line}d=JXG.copyAttributes(f,j.options,"bisector");e=JXG.createLine(j,[g[1],k],d);return e}else{throw new Error("JSXGraph: Can't create angle bisector with parent types '"+(typeof g[0])+"' and '"+(typeof g[1])+"'.\nPossible parent types: [point,point,point]")}};JXG.createAngularBisectorsOfTwoLines=function(i,k,g){var f=JXG.getReference(i,k[0]),e=JXG.getReference(i,k[1]),d,l,j,h;if(f.elementClass!=JXG.OBJECT_CLASS_LINE||e.elementClass!=JXG.OBJECT_CLASS_LINE){throw new Error("JSXGraph: Can't create angle bisectors of two lines with parent types '"+(typeof k[0])+"' and '"+(typeof k[1])+"'.\nPossible parent types: [line,line]")}if(!JXG.exists(g.layer)){g.layer=i.options.layer.line}j=JXG.copyAttributes(g,i.options,"bisectorlines","line1");d=i.create("line",[function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[0]/n-e.stdform[0]/m},function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[1]/n-e.stdform[1]/m},function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[2]/n-e.stdform[2]/m}],j);if(!JXG.exists(g.layer)){g.layer=i.options.layer.line}j=JXG.copyAttributes(g,i.options,"bisectorlines","line2");l=i.create("line",[function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[0]/n+e.stdform[0]/m},function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[1]/n+e.stdform[1]/m},function(){var n=Math.sqrt(f.stdform[1]*f.stdform[1]+f.stdform[2]*f.stdform[2]);var m=Math.sqrt(e.stdform[1]*e.stdform[1]+e.stdform[2]*e.stdform[2]);return f.stdform[2]/n+e.stdform[2]/m}],j);h=new JXG.Composition({line1:d,line2:l});return h};JXG.createCircumcircleMidpoint=function(g,e,d){var h,f;if(e[0].elementClass==JXG.OBJECT_CLASS_POINT&&e[1].elementClass==JXG.OBJECT_CLASS_POINT&&e[2].elementClass==JXG.OBJECT_CLASS_POINT){h=JXG.createPoint(g,[function(){return JXG.Math.Geometry.circumcenterMidpoint(e[0],e[1],e[2],g)}],d);for(f=0;f<3;f++){e[f].addChild(h)}h.generatePolynomial=function(){var j=a.symbolic.x;var i=a.symbolic.y;var r=b.symbolic.x;var q=b.symbolic.y;var l=c.symbolic.x;var k=c.symbolic.y;var o=h.symbolic.x;var m=h.symbolic.y;var p=["((",o,")-(",j,"))^2+((",m,")-(",i,"))^2-((",o,")-(",r,"))^2-((",m,")-(",q,"))^2"].join("");var n=["((",o,")-(",j,"))^2+((",m,")-(",i,"))^2-((",o,")-(",l,"))^2-((",m,")-(",k,"))^2"].join("");return[p,n]};return h}else{throw new Error("JSXGraph: Can't create circumcircle midpoint with parent types '"+(typeof e[0])+"', '"+(typeof e[1])+"' and '"+(typeof e[2])+"'.\nPossible parent types: [point,point,point]")}};JXG.createIncenter=function(i,l,h){var f,k,j,g,e,d;if(l.length>=3&&JXG.isPoint(l[0])&&JXG.isPoint(l[1])&&JXG.isPoint(l[2])){g=l[0];e=l[1];d=l[2];f=i.create("point",[function(){var n,m,o;n=Math.sqrt((e.X()-d.X())*(e.X()-d.X())+(e.Y()-d.Y())*(e.Y()-d.Y()));m=Math.sqrt((g.X()-d.X())*(g.X()-d.X())+(g.Y()-d.Y())*(g.Y()-d.Y()));o=Math.sqrt((e.X()-g.X())*(e.X()-g.X())+(e.Y()-g.Y())*(e.Y()-g.Y()));return new JXG.Coords(JXG.COORDS_BY_USER,[(n*g.X()+m*e.X()+o*d.X())/(n+m+o),(n*g.Y()+m*e.Y()+o*d.Y())/(n+m+o)],i)}],h)}else{throw new Error("JSXGraph: Can't create incenter with parent types '"+(typeof l[0])+"', '"+(typeof l[1])+"' and '"+(typeof l[2])+"'.\nPossible parent types: [point,point,point]")}return f};JXG.createCircumcircle=function(i,h,f){var k,l,d,g;try{d=JXG.copyAttributes(f,i.options,"circumcircle","point");k=JXG.createCircumcircleMidpoint(i,h,d);if(!JXG.exists(f.layer)){f.layer=i.options.layer.circle}d=JXG.copyAttributes(f,i.options,"circumcircle");l=JXG.createCircle(i,[k,h[0]],d)}catch(j){throw new Error("JSXGraph: Can't create circumcircle with parent types '"+(typeof h[0])+"', '"+(typeof h[1])+"' and '"+(typeof h[2])+"'.\nPossible parent types: [point,point,point]")}return l};JXG.createIncircle=function(i,h,f){var k,l,d,g;try{d=JXG.copyAttributes(f,i.options,"incircle","point");k=JXG.createIncenter(i,h,d);if(!JXG.exists(f.layer)){f.layer=i.options.layer.circle}d=JXG.copyAttributes(f,i.options,"incircle");l=JXG.createCircle(i,[k,function(){var m=Math.sqrt((h[1].X()-h[2].X())*(h[1].X()-h[2].X())+(h[1].Y()-h[2].Y())*(h[1].Y()-h[2].Y())),e=Math.sqrt((h[0].X()-h[2].X())*(h[0].X()-h[2].X())+(h[0].Y()-h[2].Y())*(h[0].Y()-h[2].Y())),o=Math.sqrt((h[1].X()-h[0].X())*(h[1].X()-h[0].X())+(h[1].Y()-h[0].Y())*(h[1].Y()-h[0].Y())),n=(m+e+o)/2;return Math.sqrt(((n-m)*(n-e)*(n-o))/n)}],d)}catch(j){throw new Error("JSXGraph: Can't create circumcircle with parent types '"+(typeof h[0])+"', '"+(typeof h[1])+"' and '"+(typeof h[2])+"'.\nPossible parent types: [point,point,point]")}return l};JXG.createReflection=function(g,f,e){var d,i,h;if(f[0].elementClass==JXG.OBJECT_CLASS_POINT&&f[1].elementClass==JXG.OBJECT_CLASS_LINE){i=f[0];d=f[1]}else{if(f[1].elementClass==JXG.OBJECT_CLASS_POINT&&f[0].elementClass==JXG.OBJECT_CLASS_LINE){i=f[1];d=f[0]}else{throw new Error("JSXGraph: Can't create reflection point with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.\nPossible parent types: [line,point]")}}h=JXG.createPoint(g,[function(){return JXG.Math.Geometry.reflection(d,i,g)}],e);i.addChild(h);d.addChild(h);h.prepareUpdate().update();h.generatePolynomial=function(){var k=d.point1.symbolic.x;var j=d.point1.symbolic.y;var q=d.point2.symbolic.x;var p=d.point2.symbolic.y;var s=i.symbolic.x;var r=i.symbolic.y;var m=h.symbolic.x;var l=h.symbolic.y;var o=["((",l,")-(",r,"))*((",j,")-(",p,"))+((",k,")-(",q,"))*((",m,")-(",s,"))"].join("");var n=["((",m,")-(",k,"))^2+((",l,")-(",j,"))^2-((",s,")-(",k,"))^2-((",r,")-(",j,"))^2"].join("");return[o,n]};return h};JXG.createMirrorPoint=function(f,h,d){var g,e;if(JXG.isPoint(h[0])&&JXG.isPoint(h[1])){g=JXG.createPoint(f,[function(){return JXG.Math.Geometry.rotation(h[0],h[1],Math.PI,f)}],d);for(e=0;e<2;e++){h[e].addChild(g)}}else{throw new Error("JSXGraph: Can't create mirror point with parent types '"+(typeof h[0])+"' and '"+(typeof h[1])+"'.\nPossible parent types: [point,point]")}g.prepareUpdate().update();return g};JXG.createIntegral=function(i,x,m){var w,r,u,g=0,f=0,e,d,l,k,q=1,v,n,h,y,j,o,s;if(JXG.isArray(x[0])&&x[1].elementClass==JXG.OBJECT_CLASS_CURVE){w=x[0];r=x[1]}else{if(JXG.isArray(x[1])&&x[0].elementClass==JXG.OBJECT_CLASS_CURVE){w=x[1];r=x[0]}else{throw new Error("JSXGraph: Can't create integral with parent types '"+(typeof x[0])+"' and '"+(typeof x[1])+"'.\nPossible parent types: [[number|function,number|function],curve]")}}g=w[0];f=w[1];if(JXG.isFunction(g)){e=g;d=function(){return r.yterm(e())};g=e()}else{e=g;d=r.yterm(g)}if(JXG.isFunction(g)){l=f;k=function(){return r.yterm(l())};f=l()}else{l=f;k=r.yterm(f)}if(f<g){q=-1}u=JXG.copyAttributes(m,i.options,"integral","start");v=i.create("glider",[e,d,r],u);if(JXG.isFunction(e)){v.hideElement()}u=JXG.copyAttributes(m,i.options,"integral","startproject");n=i.create("point",[function(){return v.X()},0],u);u=JXG.copyAttributes(m,i.options,"integral","end");h=i.create("glider",[l,k,r],u);if(JXG.isFunction(l)){h.hideElement()}u=JXG.copyAttributes(m,i.options,"integral","endproject");y=i.create("point",[function(){return h.X()},0],u);u=JXG.copyAttributes(m,i.options,"integral");if(u.withLabel!==false){u=JXG.copyAttributes(m,i.options,"integral","text");j=JXG.Math.Numerics.I([g,f],r.yterm);o=i.create("text",[function(){return h.X()+0.2},function(){return h.Y()-0.8},function(){var p=JXG.Math.Numerics.I([n.X(),y.X()],r.yterm);return""}],u);v.addChild(o);h.addChild(o)}u=JXG.copyAttributes(m,i.options,"integral");s=i.create("curve",[[0],[0]],u);s.updateDataArray=function(){var p,B,z,A,t;if(n.X()<y.X()){A=n.X();t=y.X()}else{A=y.X();t=n.X()}p=[A,A];B=[0,r.yterm(A)];for(z=0;z<r.numberPoints;z++){if((A<=r.points[z].usrCoords[1])&&(r.points[z].usrCoords[1]<=t)){p.push(r.points[z].usrCoords[1]);B.push(r.points[z].usrCoords[2])}}p.push(t);B.push(r.yterm(t));p.push(t);B.push(0);p.push(A);B.push(0);this.dataX=p;this.dataY=B};v.addChild(s);h.addChild(s);s.baseLeft=n;s.baseRight=y;s.curveLeft=v;s.curveRight=h;s.label={content:o};return s};JXG.createLocus=function(f,e,d){var h,g;if(JXG.isArray(e)&&e.length==1&&e[0].elementClass==JXG.OBJECT_CLASS_POINT){g=e[0]}else{throw new Error("JSXGraph: Can't create locus with parent of type other than point.\nPossible parent types: [point]")}h=f.create("curve",[[null],[null]],d);h.dontCallServer=false;h.updateDataArray=function(){if(h.board.mode>0){return}var j=JXG.Math.Symbolic.generatePolynomials(f,g,true).join("|");if(j===h.spe){return}h.spe=j;var i=function(m,o,l,n){h.dataX=m;h.dataY=o;h.eq=l;h.ctime=n;h.generatePolynomial=(function(p){return function(r){var q="("+r.symbolic.x+")",u="("+r.symbolic.y+")",t=[],s;for(s=0;s<p.length;s++){t[s]=p[s].replace(/\*\*/g,"^").replace(/x/g,q).replace(/y/g,u)}return t}})(l)},k=JXG.Math.Symbolic.geometricLocusByGroebnerBase(f,g,i);i(k.datax,k.datay,k.polynomial,k.exectime)};return h};JXG.createGrid=function(g,f,e){var h,d;d=JXG.copyAttributes(e,g.options,"grid");h=g.create("curve",[[null],[null]],d);if(g.options.grid.dash){h.setProperty({dash:2})}h.updateDataArray=function(){var j=g.options.grid.gridX,n=g.options.grid.gridY,m=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],g),l=new JXG.Coords(JXG.COORDS_BY_SCREEN,[g.canvasWidth,g.canvasHeight],g),k;g.options.grid.hasGrid=true;m.setCoordinates(JXG.COORDS_BY_USER,[Math.floor(m.usrCoords[1]/j)*j,Math.ceil(m.usrCoords[2]/n)*n]);l.setCoordinates(JXG.COORDS_BY_USER,[Math.ceil(l.usrCoords[1]/j)*j,Math.floor(l.usrCoords[2]/n)*n]);h.dataX=[];h.dataY=[];for(k=m.usrCoords[2];k>l.usrCoords[2]-n;k-=n){h.dataX.push(m.usrCoords[1],l.usrCoords[1],NaN);h.dataY.push(k,k,NaN)}for(k=m.usrCoords[1];k<l.usrCoords[1]+j;k+=j){h.dataX.push(k,k,NaN);h.dataY.push(m.usrCoords[2],l.usrCoords[2],NaN)}};h.hasPoint=function(){return false};g.grids.push(h);return h};JXG.JSXGraph.registerElement("arrowparallel",JXG.createArrowParallel);JXG.JSXGraph.registerElement("bisector",JXG.createBisector);JXG.JSXGraph.registerElement("bisectorlines",JXG.createAngularBisectorsOfTwoLines);JXG.JSXGraph.registerElement("circumcircle",JXG.createCircumcircle);JXG.JSXGraph.registerElement("circumcirclemidpoint",JXG.createCircumcircleMidpoint);JXG.JSXGraph.registerElement("circumcenter",JXG.createCircumcircleMidpoint);JXG.JSXGraph.registerElement("incenter",JXG.createIncenter);JXG.JSXGraph.registerElement("incircle",JXG.createIncircle);JXG.JSXGraph.registerElement("integral",JXG.createIntegral);JXG.JSXGraph.registerElement("midpoint",JXG.createMidpoint);JXG.JSXGraph.registerElement("mirrorpoint",JXG.createMirrorPoint);JXG.JSXGraph.registerElement("normal",JXG.createNormal);JXG.JSXGraph.registerElement("parallel",JXG.createParallel);JXG.JSXGraph.registerElement("parallelpoint",JXG.createParallelPoint);JXG.JSXGraph.registerElement("perpendicular",JXG.createPerpendicular);JXG.JSXGraph.registerElement("perpendicularpoint",JXG.createPerpendicularPoint);JXG.JSXGraph.registerElement("reflection",JXG.createReflection);JXG.JSXGraph.registerElement("locus",JXG.createLocus);JXG.JSXGraph.registerElement("grid",JXG.createGrid);JXG.Text=function(g,h,i,e){this.constructor(g,e,JXG.OBJECT_TYPE_TEXT,JXG.OBJECT_CLASS_OTHER);this.content=h;this.plaintext="";if((this.element=JXG.getRef(this.board,e.anchor))){var f;if(this.visProp.islabel){f=this.element.getLabelAnchor();this.relativeCoords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[parseFloat(i[0]),parseFloat(i[1])],this.board)}else{f=this.element.getTextAnchor();this.relativeCoords=new JXG.Coords(JXG.COORDS_BY_USER,[parseFloat(i[0]),parseFloat(i[1])],this.board)}this.element.addChild(this);this.coords=new JXG.Coords(JXG.COORDS_BY_SCREEN,[this.relativeCoords.scrCoords[1]+f.scrCoords[1],this.relativeCoords.scrCoords[2]+f.scrCoords[2]],this.board);this.isDraggable=true}else{if(!JXG.isFunction(i[0])&&!JXG.isFunction(i[1])){this.isDraggable=true}this.X=JXG.createFunction(i[0],this.board,"");this.Y=JXG.createFunction(i[1],this.board,"");this.coords=new JXG.Coords(JXG.COORDS_BY_USER,[this.X(),this.Y()],this.board);var d="this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.X(),this.Y()]);";this.updateCoords=new Function("",d)}if(typeof this.content==="function"){this.updateText=function(){this.plaintext=this.content()}}else{if(JXG.isNumber(this.content)){this.content=(this.content).toFixed(this.visProp.digits)}else{if(this.visProp.useasciimathml){this.content="'`"+this.content+"`'"}else{this.content=this.generateTerm(this.content)}}this.updateText=new Function("this.plaintext = "+this.content+";")}this.updateText();this.id=this.board.setId(this,"T");this.board.renderer.drawText(this);if(!this.visProp.visible){this.board.renderer.hide(this)}if(typeof this.content==="string"){this.notifyParents(this.content)}this.size=[1,1];return this};JXG.Text.prototype=new JXG.GeometryElement();JXG.extend(JXG.Text.prototype,{hasPoint:function(d,h){var f=d-this.coords.scrCoords[1],e=this.coords.scrCoords[2]-h,g=this.board.options.precision.hasPoint;if(f>=-g&&f<=2*g&&e>=-g&&e<=2*g){return true}else{return false}},setText:function(d){if(typeof d==="function"){this.updateText=function(){this.plaintext=d()}}else{if(JXG.isNumber(d)){this.content=(d).toFixed(this.visProp.digits)}else{if(this.visProp.useasciimathml){this.content="'`"+d+"`'"}else{this.content=this.generateTerm(d)}}this.updateText=new Function("this.plaintext = "+this.content+";")}this.updateText();this.updateSize();return this},updateSize:function(){if(this.display=="html"&&this.board.renderer.type!="vml"){this.size=[this.rendNode.offsetWidth,this.rendNode.offsetHeight]}else{if(this.display=="internal"&&this.board.renderer.type=="svg"){this.size=[this.rendNode.getBBox().width,this.rendNode.getBBox().height]}else{if(this.board.renderer.type=="vml"||(this.display=="internal"&&this.board.renderer.type=="canvas")){this.size=[parseFloat(this.visProp.fontsize)*this.plaintext.length*0.45,parseFloat(this.visProp.fontsize)*0.9]}}}},getSize:function(){return this.size},setCoords:function(d,e){this.X=function(){return d};this.Y=function(){return e};this.coords=new JXG.Coords(JXG.COORDS_BY_USER,[d,e],this.board);return this},update:function(){var d;if(this.needsUpdate){if(this.relativeCoords){if(this.visProp.islabel){d=this.element.getLabelAnchor();this.coords.setCoordinates(JXG.COORDS_BY_SCREEN,[this.relativeCoords.scrCoords[1]+d.scrCoords[1],this.relativeCoords.scrCoords[2]+d.scrCoords[2]])}else{d=this.element.getTextAnchor();this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.relativeCoords.usrCoords[1]+d.usrCoords[1],this.relativeCoords.usrCoords[2]+d.usrCoords[2]])}}else{this.updateCoords()}this.updateText();this.updateSize();this.updateTransform()}return this},updateRenderer:function(){if(this.needsUpdate){this.board.renderer.updateText(this);this.needsUpdate=false}return this},updateTransform:function(){if(this.transformations.length==0){return}for(var d=0;d<this.transformations.length;d++){this.transformations[d].update()}},generateTerm:function(h){var g,k='""',f;h=h||"";h=h.replace(/\r/g,"");h=h.replace(/\n/g,"");h=h.replace(/\"/g,'\\"');h=h.replace(/\'/g,"\\'");h=h.replace(/&arc;/g,"&ang;");h=h.replace(/<arc\s*\/>/g,"&ang;");h=h.replace(/<sqrt\s*\/>/g,"&radic;");var e;e=h.indexOf("<value>");var d=h.indexOf("</value>");if(e>=0){while(e>=0){k+=' + "'+JXG.GeonextParser.replaceSub(JXG.GeonextParser.replaceSup(h.slice(0,e)))+'"';f=h.slice(e+7,d);g=JXG.GeonextParser.geonext2JS(f,this.board);g=g.replace(/\\"/g,'"');g=g.replace(/\\'/g,"'");if(g.indexOf("toFixed")<0){if(JXG.isNumber((JXG.bind(new Function("return "+g+";"),this))())){k+="+("+g+").toFixed("+(this.visProp.digits)+")"}else{k+="+("+g+")"}}else{k+="+("+g+")"}h=h.slice(d+8);e=h.indexOf("<value>");d=h.indexOf("</value>")}}k+=' + "'+JXG.GeonextParser.replaceSub(JXG.GeonextParser.replaceSup(h))+'"';k=k.replace(/<overline>/g,"<span style=text-decoration:overline>");k=k.replace(/<\/overline>/g,"</span>");k=k.replace(/<arrow>/g,"<span style=text-decoration:overline>");k=k.replace(/<\/arrow>/g,"</span>");k=k.replace(/&/g,"&");return k},notifyParents:function(f){var e=null;do{var d=/<value>([\w\s\*\/\^\-\+\(\)\[\],<>=!]+)<\/value>/;e=d.exec(f);if(e!=null){JXG.GeonextParser.findDependencies(this,e[1],this.board);f=f.substr(e.index);f=f.replace(d,"")}}while(e!=null);return this},bounds:function(){var d=this.coords.usrCoords;return this.visProp.islabel?[0,0,0,0]:[d[1],d[2]+this.size[1],d[1]+this.size[0],d[2]]},setPositionDirectly:function(d,k,h,g,f){var e,n,m,l,j;if(this.relativeCoords){if(this.visProp.islabel){if(d==JXG.COORDS_BY_USER){j=new JXG.Coords(JXG.COORDS_BY_USER,[g,f],this.board);l=new JXG.Coords(JXG.COORDS_BY_USER,[k,h],this.board);n=l.scrCoords[1]-j.scrCoords[1];m=l.scrCoords[2]-j.scrCoords[2]}else{n=k-g;m=h-f}this.relativeCoords.scrCoords[1]+=n;this.relativeCoords.scrCoords[2]+=m}else{if(d==JXG.COORDS_BY_SCREEN){j=new JXG.Coords(JXG.COORDS_BY_SCREEN,[g,f],this.board);l=new JXG.Coords(JXG.COORDS_BY_SCREEN,[k,h],this.board);n=l.usrCoords[1]-j.usrCoords[1];m=l.usrCoords[2]-j.usrCoords[2]}else{n=k-g;m=h-f}this.relativeCoords.usrCoords[1]+=n;this.relativeCoords.usrCoords[2]+=m}}else{if(d==JXG.COORDS_BY_SCREEN){l=new JXG.Coords(JXG.COORDS_BY_SCREEN,[k,h],this.board);k=l.usrCoords[1];h=l.usrCoords[2]}this.X=JXG.createFunction(k,this.board,"");this.Y=JXG.createFunction(h,this.board,"")}return this}});JXG.createText=function(g,f,e){var d;d=JXG.copyAttributes(e,g.options,"text");d.anchor=d.parent||d.anchor;return new JXG.Text(g,f[f.length-1],f,d)};JXG.JSXGraph.registerElement("text",JXG.createText);JXG.Image=function(g,e,h,f,d){this.constructor(g,d,JXG.OBJECT_TYPE_IMAGE,JXG.OBJECT_CLASS_OTHER);this.initialCoords=new JXG.Coords(JXG.COORDS_BY_USER,h,this.board);if(!JXG.isFunction(h[0])&&!JXG.isFunction(h[1])){this.isDraggable=true}this.X=JXG.createFunction(h[0],this.board,"");this.Y=JXG.createFunction(h[1],this.board,"");this.W=JXG.createFunction(f[0],this.board,"");this.H=JXG.createFunction(f[1],this.board,"");this.coords=new JXG.Coords(JXG.COORDS_BY_USER,[this.X(),this.Y()],this.board);this.updateCoords=new Function("","this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.X(),this.Y()]);");this.updateSize=new Function("","this.coords.setCoordinates(JXG.COORDS_BY_USER,[this.W(),this.H()]);");this.usrSize=[this.W(),this.H()];this.size=[this.usrSize[0]*g.unitX,this.usrSize[1]*g.unitY];this.url=e;this.parent=JXG.getRef(d.anchor);this.id=this.board.setId(this,"Im");this.board.renderer.drawImage(this);if(!this.visProp.visible){this.board.renderer.hide(this)}};JXG.Image.prototype=new JXG.GeometryElement;JXG.extend(JXG.Image.prototype,{hasPoint:function(d,h){var f=d-this.coords.scrCoords[1],e=this.coords.scrCoords[2]-h,g=this.board.options.precision.hasPoint;if(f>=-g&&f<=2*g&&e>=-g&&e<=g){return true}else{return false}},update:function(){if(this.needsUpdate){this.updateCoords();this.usrSize=[this.W(),this.H()];this.size=[this.usrSize[0]*this.board.unitX,this.usrSize[1]*this.board.unitY];this.updateTransform()}return this},updateRenderer:function(){if(this.needsUpdate){this.board.renderer.updateImage(this);this.needsUpdate=false}return this},updateTransform:function(){if(this.transformations.length==0){return}for(var d=0;d<this.transformations.length;d++){this.transformations[d].update()}},addTransform:function(d){if(JXG.isArray(d)){for(var e=0;e<d.length;e++){this.transformations.push(d[e])}}else{this.transformations.push(d)}},setPositionDirectly:function(k,d,j,h,g){var i,f,e;if(k==JXG.COORDS_BY_SCREEN){i=new JXG.Coords(JXG.COORDS_BY_SCREEN,[d,j],this.board);d=i.usrCoords[1];j=i.usrCoords[2]}this.X=JXG.createFunction(d,this.board,"");this.Y=JXG.createFunction(j,this.board,"");return this}});JXG.createImage=function(h,g,e){var f,d;d=JXG.copyAttributes(e,h.options,"image");return new JXG.Image(h,g[0],g[1],g[2],d)};JXG.JSXGraph.registerElement("image",JXG.createImage);JXG.createSlider=function(o,A,p){var j,i,z,k,B,q,f,e,y,C,l,h,g,d,x,v,r,m,u,s,w;j=A[0];i=A[1];z=A[2][0];k=A[2][1];B=A[2][2];q=B-z;w=JXG.copyAttributes(p,o.options,"slider");u=w.withticks;m=w.withlabel;s=w.snapwidth;precision=w.precision;w=JXG.copyAttributes(p,o.options,"slider","point1");f=o.create("point",j,w);w=JXG.copyAttributes(p,o.options,"slider","point2");e=o.create("point",i,w);o.create("group",[f,e]);w=JXG.copyAttributes(p,o.options,"slider","segment1");y=o.create("segment",[f,e],w);y.updateStdform();if(u){w=JXG.copyAttributes(p,o.options,"slider","ticks");C=2;l=o.create("ticks",[y,e.Dist(f)/C],w)}h=j[0]+(i[0]-j[0])*(k-z)/(B-z);g=j[1]+(i[1]-j[1])*(k-z)/(B-z);w=JXG.copyAttributes(p,o.options,"slider","glider");if(p.name&&p.name!=""){w.name=p.name}d=o.create("glider",[h,g,y],w);d.setProperty({snapwidth:s});w=JXG.copyAttributes(p,o.options,"slider","segment2");x=o.create("segment",[f,d],w);d.Value=function(){return this.position*q+z};d._smax=B;d._smin=z;if(m){if(p.name&&p.name!=""){v=p.name+" = "}else{v=""}w=JXG.copyAttributes(p,o.options,"slider","text");r=o.create("text",[function(){return(e.X()-f.X())*0.05+e.X()},function(){return(e.Y()-f.Y())*0.05+e.Y()},function(){return v+(d.Value()).toFixed(precision)}],w);d.text=r}d.point1=f;d.point2=e;d.baseline=y;d.highline=x;if(u){d.ticks=l}d.remove=function(){if(m){o.removeObject(r)}o.removeObject(x);if(u){y.removeTicks(l)}o.removeObject(y);o.removeObject(e);o.removeObject(f);JXG.Point.prototype.remove.call(d)};return d};JXG.JSXGraph.registerElement("slider",JXG.createSlider);JXG.Chart=function(h,l,e){this.constructor(h,e);var m,k,f,j,d,g;if(!JXG.isArray(l)||l.length===0){throw new Error("JSXGraph: Can't create a chart without data")}this.elements=[];if(JXG.isNumber(l[0])){k=l;m=[];for(f=0;f<k.length;f++){m[f]=f+1}}else{if(l.length===1&&JXG.isArray(l[0])){k=l[0];m=[];g=JXG.evaluate(k).length;for(f=0;f<g;f++){m[f]=f+1}}else{if(l.length===2){g=Math.min(l[0].length,l[1].length);m=l[0].slice(0,g);k=l[1].slice(0,g)}}}if(JXG.isArray(k)&&k.length===0){throw new Error("JSXGraph: Can't create charts without data.")}d=e.chartstyle.replace(/ /g,"").split(",");for(f=0;f<d.length;f++){switch(d[f]){case"bar":j=this.drawBar(h,m,k,e);break;case"line":j=this.drawLine(h,m,k,e);break;case"fit":j=this.drawFit(h,m,k,e);break;case"spline":j=this.drawSpline(h,m,k,e);break;case"pie":j=this.drawPie(h,k,e);break;case"point":j=this.drawPoints(h,m,k,e);break;case"radar":j=this.drawRadar(h,l,e);break}this.elements.push(j)}this.id=this.board.setId(this,"Chart");return this.elements};JXG.Chart.prototype=new JXG.GeometryElement;JXG.extend(JXG.Chart.prototype,{drawLine:function(f,d,g,e){e.fillcolor="none";e.highlightfillcolor="none";return f.create("curve",[d,g],e)},drawSpline:function(f,d,g,e){e.fillColor="none";e.highlightfillcolor="none";return f.create("spline",[d,g],e)},drawFit:function(f,d,h,e){var g=e.degree;g=(!JXG.exists(g)||parseInt(g)==NaN||parseInt(g)<1)?1:parseInt(g),e.fillcolor="none";e.highlightfillcolor="none";return f.create("functiongraph",[JXG.Math.Numerics.regressionPolynomial(g,d,h)],e)},drawBar:function(e,l,h,f){var u,g=[],r,t,d,q,n,o,m,k,v,j,s=[],z={fixed:true,withLabel:false,visible:false,name:""};if(!JXG.exists(f.fillopacity)){f.fillopacity=0.6}if(f&&f.width){n=f.width}else{if(l.length<=1){n=1}else{n=l[1]-l[0];for(u=1;u<l.length-1;u++){n=(l[u+1]-l[u]<n)?l[u+1]-l[u]:n}}n*=0.8}t=f.fillcolor;d=parseFloat(e.options.text.fontSize);for(u=0;u<l.length;u++){if(isNaN(JXG.evaluate(l[u]))||isNaN(h[u])){}if(JXG.isFunction(l[u])){o=function(){return l[u]()-n*0.5};m=function(){return l[u]()};k=function(){return l[u]()+n*0.5}}else{o=l[u]-n*0.5;m=l[u];k=l[u]+n*0.5}v=h[u];if(f.dir=="horizontal"){s[0]=e.create("point",[0,o],z);s[1]=e.create("point",[v,o],z);s[2]=e.create("point",[v,k],z);s[3]=e.create("point",[0,k],z);if(JXG.exists(f.labels)&&JXG.exists(f.labels[u])){r=f.labels[u].toString().length;r=2*r*d/e.unitX;if(v>=0){v+=d*0.5/e.unitX}else{v-=d*r/e.unitX}m-=d*0.2/e.unitY;q=e.create("text",[v,m,f.labels[u]],f)}}else{s[0]=e.create("point",[o,0],z);s[1]=e.create("point",[o,v],z);s[2]=e.create("point",[k,v],z);s[3]=e.create("point",[k,0],z);if(JXG.exists(f.labels)&&JXG.exists(f.labels[u])){r=f.labels[u].toString().length;r=0.6*r*d/e.unitX;if(v>=0){v+=d*0.5/e.unitY}else{v-=d*1/e.unitY}q=e.create("text",[m-r*0.5,v,f.labels[u]],f)}}f.withlines=false;if(JXG.exists(f.colors)&&JXG.isArray(f.colors)){j=f.colors;f.fillcolor=j[u%j.length]}g[u]=e.create("polygon",s,f);if(JXG.exists(f.labels)&&JXG.exists(f.labels[u])){g[u].text=q}}return g},drawPoints:function(j,d,k,f){var g,h=[],e=f.infoboxarray;f.fixed=true;f.name="";for(g=0;g<d.length;g++){f.infoboxtext=e?e[g%e.length]:false;h[g]=j.create("point",[d[g],k[g]],f)}return h},drawPie:function(q,t,k){var l,g=[],h=[],x=JXG.Math.Statistics.sum(t),v=k.colors,m=k.highlightcolors,f=k.labels,e=k.radius||4,n=e,u=k.center||[0,0],w=u[0],o=u[1],d,j={fixed:true,withLabel:false,visible:false,name:""};if(!JXG.isArray(f)){f=[];for(l=0;l<t.length;l++){f[l]=""}}if(!JXG.isFunction(e)){n=function(){return e}}k.highlightonsector=k.highlightonsector||false;k.straightfirst=false;k.straightlast=false;d=q.create("point",[w,o],j);g[0]=q.create("point",[function(){return n()+w},function(){return o}],j);for(l=0;l<t.length;l++){g[l+1]=q.create("point",[(function(i){return function(){var z,y=0,r,p;for(r=0;r<=i;r++){y+=parseFloat(JXG.evaluate(t[r]))}z=y;for(r=i+1;r<t.length;r++){z+=parseFloat(JXG.evaluate(t[r]))}p=(z!=0)?(2*Math.PI*y/z):0;return n()*Math.cos(p)+w}})(l),(function(i){return function(){var z,y=0,r,p;for(r=0;r<=i;r++){y+=parseFloat(JXG.evaluate(t[r]))}z=y;for(r=i+1;r<t.length;r++){z+=parseFloat(JXG.evaluate(t[r]))}p=(z!=0)?(2*Math.PI*y/z):0;return n()*Math.sin(p)+o}})(l)],j);k.name=f[l];k.withlabel=k.name!="";k.fillcolor=v&&v[l%v.length];k.labelcolor=v&&v[l%v.length];k.highlightfillcolor=m&&m[l%m.length];h[l]=q.create("sector",[d,g[l],g[l+1]],k);if(k.highlightonsector){h[l].hasPoint=h[l].hasPointSector}if(k.highlightbysize){h[l].highlight=function(){this.board.renderer.highlight(this);var p=-this.point1.coords.usrCoords[1]+this.point2.coords.usrCoords[1],i=-this.point1.coords.usrCoords[2]+this.point2.coords.usrCoords[2];if(this.label.content!=null){this.label.content.rendNode.style.fontSize=(2*this.board.options.text.fontSize)+"px"}this.point2.coords=new JXG.Coords(JXG.COORDS_BY_USER,[this.point1.coords.usrCoords[1]+p*1.1,this.point1.coords.usrCoords[2]+i*1.1],this.board);this.prepareUpdate().update().updateRenderer()};h[l].noHighlight=function(){this.board.renderer.noHighlight(this);var p=-this.point1.coords.usrCoords[1]+this.point2.coords.usrCoords[1],i=-this.point1.coords.usrCoords[2]+this.point2.coords.usrCoords[2];if(this.label.content!=null){this.label.content.rendNode.style.fontSize=(this.board.options.text.fontSize)+"px"}this.point2.coords=new JXG.Coords(JXG.COORDS_BY_USER,[this.point1.coords.usrCoords[1]+p/1.1,this.point1.coords.usrCoords[2]+i/1.1],this.board);this.prepareUpdate().update().updateRenderer()}}}return{sectors:h,points:g,midpoint:d}},drawRadar:function(n,P,K){var Y,W,Z,M,ab,F,B=P.length,J,s,f,L,C,y,D,A,g,X,u,r,v,O,w,U,Q,E,d,m,e,T,l,N,q,S,ae,x,k,o,H,R,ad,z,h;if(B<=0){JXG.debug("No data");return}Z=K.paramarray;if(!JXG.exists(Z)){JXG.debug("Need paramArray attribute");return}M=Z.length;if(M<=1){JXG.debug("Need more than 1 param");return}for(Y=0;Y<B;Y++){if(M!=P[Y].length){JXG.debug("Use data length equal to number of params ("+P[Y].length+" != "+M+")");return}}ab=new Array(M);F=new Array(M);for(W=0;W<M;W++){ab[W]=P[0][W];F[W]=ab[W]}for(Y=1;Y<B;Y++){for(W=0;W<M;W++){if(P[Y][W]>ab[W]){ab[W]=P[Y][W]}if(P[Y][W]<F[W]){F[W]=P[Y][W]}}}J=new Array(B);s=new Array(B);for(Y=0;Y<B;Y++){J[Y]="";s[Y]=[]}f=new Array(M);L=new Array(M);C=K.startshiftratio||0;y=K.endshiftratio||0;for(Y=0;Y<M;Y++){f[Y]=(ab[Y]-F[Y])*C;L[Y]=(ab[Y]-F[Y])*y}D=K.startshiftarray||f;A=K.endshiftarray||L;g=K.startarray||F;if(JXG.exists(K.start)){for(Y=0;Y<M;Y++){g[Y]=K.start}}X=K.endarray||ab;if(JXG.exists(K.end)){for(Y=0;Y<M;Y++){X[Y]=K.end}}if(D.length!=M){JXG.debug("Start shifts length is not equal to number of parameters");return}if(A.length!=M){JXG.debug("End shifts length is not equal to number of parameters");return}if(g.length!=M){JXG.debug("Starts length is not equal to number of parameters");return}if(X.length!=M){JXG.debug("Ends length is not equal to number of parameters");return}u=K.labelarray||J;r=K.colors;v=K.highlightcolors;O=K.radius||10;w={};if(!JXG.exists(K.highlightonsector)){K.highlightonsector=false}w.name=K.name;w.id=K.id;w.strokewidth=K.strokewidth||1;w.polystrokewidth=K.polystrokewidth||2*w.strokewidth;w.strokecolor=K.strokecolor||"black";w.straightfirst=false;w.straightlast=false;w.fillcolor=K.fillcolor||"#FFFF88";w.fillopacity=K.fillopacity||0.4;w.highlightfillcolor=K.highlightfillcolor||"#FF7400";w.highlightstrokecolor=K.highlightstrokecolor||"black";w.gradient=K.gradient||"none";U=K.center||[0,0];Q=U[0];E=U[1];d=n.create("point",[Q,E],{name:"",fixed:true,withlabel:false,visible:false});m=Math.PI/2-Math.PI/M;if(K.startangle||K.startangle===0){m=K.startangle}e=m;T=[];l=[];var V=function(){var j,i,t,p,af=[].concat(this.labelOffsets);j=this.point1.X();i=this.point2.X();t=this.point1.Y();p=this.point2.Y();if(i<j){af[0]=-af[0]}if(p<t){af[1]=-af[1]}this.setLabelRelativeCoords(af);return new JXG.Coords(JXG.COORDS_BY_USER,[this.point2.X(),this.point2.Y()],this.board)};var I=function(ah,p){var j;var ag;var af;j=n.create("transform",[-(g[p]-D[p]),0],{type:"translate"});ag=n.create("transform",[O/((X[p]+A[p])-(g[p]-D[p])),1],{type:"scale"});j.melt(ag);af=n.create("transform",[ah],{type:"rotate"});j.melt(af);return j};for(Y=0;Y<M;Y++){e+=2*Math.PI/M;q=O*Math.cos(e)+Q;S=O*Math.sin(e)+E;T[Y]=n.create("point",[q,S],{name:"",fixed:true,withlabel:false,visible:false});l[Y]=n.create("line",[d,T[Y]],{name:Z[Y],strokeColor:w.strokecolor,strokeWidth:w.strokewidth,strokeOpacity:1,straightFirst:false,straightLast:false,withLabel:true,highlightStrokeColor:w.highlightstrokecolor});l[Y].getLabelAnchor=V;N=I(e,Y);for(W=0;W<P.length;W++){var ac=P[W][Y];s[W][Y]=n.create("point",[ac,0],{name:"",fixed:true,withlabel:false,visible:false});s[W][Y].addTransform(s[W][Y],N)}}ae=new Array(B);for(Y=0;Y<B;Y++){w.labelcolor=r&&r[Y%r.length];w.strokecolor=r&&r[Y%r.length];w.fillcolor=r&&r[Y%r.length];ae[Y]=n.create("polygon",s[Y],{withLines:true,withLabel:false,fillColor:w.fillcolor,fillOpacity:w.fillopacity});for(W=0;W<M;W++){ae[Y].borders[W].setProperty("strokecolor:"+r[Y%r.length]);ae[Y].borders[W].setProperty("strokewidth:"+w.polystrokewidth)}}x=K.legendposition||"none";switch(x){case"right":var G=K.legendleftoffset||2;var aa=K.legendtopoffset||1;this.legend=n.create("legend",[Q+O+G,E+O-aa],{labelArray:u,colorArray:r});break;case"none":break;default:JXG.debug("Unknown legend position")}k=[];if(K.showcircles!=false){o=[];for(Y=0;Y<6;Y++){o[Y]=20*Y}o[0]="0";H=K.circlelabelarray||o;R=H.length;if(R<2){alert("Too less circles");return}ad=[];z=m+Math.PI/M;N=I(z,0);w.fillcolor="none";w.highlightfillcolor="none";w.strokecolor=K.strokecolor||"black";w.strokewidth=K.circlestrokewidth||0.5;h=(X[0]-g[0])/(R-1);for(Y=0;Y<R;Y++){ad[Y]=n.create("point",[g[0]+Y*h,0],{name:H[Y],size:0,withLabel:true,visible:true});ad[Y].addTransform(ad[Y],N);k[Y]=n.create("circle",[d,ad[Y]],w)}}this.rendNode=ae[0].rendNode;return{circles:k,lines:l,points:s,midpoint:d,polygons:ae}},updateRenderer:function(){return this},update:function(){if(this.needsUpdate){this.updateDataArray()}return this},updateDataArray:function(){}});JXG.createChart=function(g,u,h){if((u.length==1)&&(typeof u[0]=="string")){var t=document.getElementById(u[0]),A,f,q,p,e,s=[],l,k,z,y,B,n,d,o,v,r,m;if(JXG.exists(t)){m=JXG.copyAttributes(h,g.options,"chart");t=(new JXG.DataSource()).loadFromTable(u[0],m.withheaders,m.withheaders);A=t.data;e=t.columnHeaders;f=t.rowHeaders;y=m.width;B=m.name;n=m.strokecolor;d=m.fillcolor;o=m.highlightstrokecolor;v=m.highlightfillcolor;g.suspendUpdate();r=A.length;z=[];if(m.rows&&JXG.isArray(m.rows)){for(q=0;q<r;q++){for(p=0;p<m.rows.length;p++){if((m.rows[p]==q)||(m.withheaders&&m.rows[p]==f[q])){z.push(A[q]);break}}}}else{z=A}r=z.length;for(q=0;q<r;q++){k=[];if(m.chartstyle&&m.chartstyle.indexOf("bar")!=-1){if(y){l=y}else{l=0.8}k.push(1-l/2+(q+0.5)*l/(1*r));for(p=1;p<z[q].length;p++){k.push(k[p-1]+1)}m.width=l/(1*r)}if(B&&B.length==r){m.name=B[q]}else{if(m.withheaders){m.name=e[q]}}if(n&&n.length==r){m.strokecolor=n[q]}else{m.strokecolor=JXG.hsv2rgb(((q+1)/(1*r))*360,0.9,0.6)}if(d&&d.length==r){m.fillcolor=d[q]}else{m.fillcolor=JXG.hsv2rgb(((q+1)/(1*r))*360,0.9,1)}if(o&&o.length==r){m.highlightstrokecolor=o[q]}else{m.highlightstrokecolor=JXG.hsv2rgb(((q+1)/(1*r))*360,0.9,1)}if(v&&v.length==r){m.highlightfillcolor=v[q]}else{m.highlightfillcolor=JXG.hsv2rgb(((q+1)/(1*r))*360,0.9,0.6)}if(m.chartstyle&&m.chartstyle.indexOf("bar")!=-1){s.push(new JXG.Chart(g,[k,z[q]],m))}else{s.push(new JXG.Chart(g,[z[q]],m))}}g.unsuspendUpdate()}return s}else{m=JXG.copyAttributes(h,g.options,"chart");return new JXG.Chart(g,u,m)}};JXG.JSXGraph.registerElement("chart",JXG.createChart);JXG.Legend=function(f,g,e){var d;this.constructor();d=JXG.copyAttributes(e,f.options,"legend");this.board=f;this.coords=new JXG.Coords(JXG.COORDS_BY_USER,g,this.board);this.myAtts={};this.label_array=d.labelarray||d.labels;this.color_array=d.colorarray||d.colors;this.lines=[];this.myAtts.strokewidth=d.strokewidth||5;this.myAtts.straightfirst=false;this.myAtts.straightlast=false;this.myAtts.withlabel=true;this.style=d.legendstyle||d.style;switch(this.style){case"vertical":this.drawVerticalLegend(f,d);break;default:throw new Error("JSXGraph: Unknown legend style: "+this.style);break}};JXG.Legend.prototype=new JXG.GeometryElement;JXG.Legend.prototype.drawVerticalLegend=function(h,f){var e=f.linelength||1,d=(f.rowheight||20)/this.board.unitY,g;for(g=0;g<this.label_array.length;g++){this.myAtts.strokecolor=this.color_array[g];this.myAtts.highlightstrokecolor=this.color_array[g];this.myAtts.name=this.label_array[g];this.myAtts.labeloffsets=[10,0];this.lines[g]=h.create("line",[[this.coords.usrCoords[1],this.coords.usrCoords[2]-g*d],[this.coords.usrCoords[1]+e,this.coords.usrCoords[2]-g*d]],this.myAtts);this.lines[g].getLabelAnchor=function(){this.setLabelRelativeCoords(this.labelOffsets);return new JXG.Coords(JXG.COORDS_BY_USER,[this.point2.X(),this.point2.Y()],this.board)}}};JXG.createLegend=function(f,e,d){var g=[0,0];if(JXG.exists(e)){if(e.length==2){g=e}}return new JXG.Legend(f,g,d)};JXG.JSXGraph.registerElement("legend",JXG.createLegend);JXG.Transformation=function(e,d,f){this.elementClass=JXG.OBJECT_CLASS_OTHER;this.matrix=[[1,0,0],[0,1,0],[0,0,1]];this.board=e;this.isNumericMatrix=false;this.setMatrix(e,d,f)};JXG.Transformation.prototype={};JXG.extend(JXG.Transformation.prototype,{update:function(){return this},setMatrix:function(f,e,g){var d;this.isNumericMatrix=true;for(d=0;d<g.length;d++){if(typeof g[d]!="number"){this.isNumericMatrix=false;break}}if(e=="translate"){this.evalParam=JXG.createEvalFunction(f,g,2);this.update=function(){this.matrix[1][0]=this.evalParam(0);this.matrix[2][0]=this.evalParam(1)}}else{if(e=="scale"){this.evalParam=JXG.createEvalFunction(f,g,2);this.update=function(){this.matrix[1][1]=this.evalParam(0);this.matrix[2][2]=this.evalParam(1)}}else{if(e=="reflect"){if(g.length<4){g[0]=JXG.getReference(f,g[0])}if(g.length==2){g[1]=JXG.getReference(f,g[1])}if(g.length==4){this.evalParam=JXG.createEvalFunction(f,g,4)}this.update=function(){var h,l,i,k,j;if(g.length==1){h=g[0].point2.X()-g[0].point1.X();l=g[0].point2.Y()-g[0].point1.Y();i=g[0].point1.X();k=g[0].point1.Y()}else{if(g.length==2){h=g[1].X()-g[0].X();l=g[1].Y()-g[0].Y();i=g[0].X();k=g[0].Y()}else{if(g.length==4){h=this.evalParam(2)-this.evalParam(0);l=this.evalParam(3)-this.evalParam(1);i=this.evalParam(0);k=this.evalParam(1)}}}j=h*h+l*l;this.matrix[1][1]=(h*h-l*l)/j;this.matrix[1][2]=2*h*l/j;this.matrix[2][1]=2*h*l/j;this.matrix[2][2]=(-h*h+l*l)/j;this.matrix[1][0]=i*(1-this.matrix[1][1])-k*this.matrix[1][2];this.matrix[2][0]=k*(1-this.matrix[2][2])-i*this.matrix[2][1]}}else{if(e=="rotate"){if(g.length==3){this.evalParam=JXG.createEvalFunction(f,g,3)}else{if(g.length<=2){this.evalParam=JXG.createEvalFunction(f,g,1);if(g.length==2){g[1]=JXG.getReference(f,g[1])}}}this.update=function(){var j=this.evalParam(0),h,l,k=Math.cos(j),i=Math.sin(j);this.matrix[1][1]=k;this.matrix[1][2]=-i;this.matrix[2][1]=i;this.matrix[2][2]=k;if(g.length>1){if(g.length==3){h=this.evalParam(1);l=this.evalParam(2)}else{h=g[1].X();l=g[1].Y()}this.matrix[1][0]=h*(1-k)+l*i;this.matrix[2][0]=l*(1-k)-h*i}}}else{if(e=="shear"){this.evalParam=JXG.createEvalFunction(f,g,1);this.update=function(){var h=this.evalParam(0);this.matrix[1][1]=Math.tan(h)}}else{if(e=="generic"){this.evalParam=JXG.createEvalFunction(f,g,9);this.update=function(){this.matrix[0][0]=this.evalParam(0);this.matrix[0][1]=this.evalParam(1);this.matrix[0][2]=this.evalParam(2);this.matrix[1][0]=this.evalParam(3);this.matrix[1][1]=this.evalParam(4);this.matrix[1][2]=this.evalParam(5);this.matrix[2][0]=this.evalParam(6);this.matrix[2][1]=this.evalParam(7);this.matrix[2][2]=this.evalParam(8)}}}}}}}},apply:function(d){this.update();if(arguments[1]!=null){return JXG.Math.matVecMult(this.matrix,d.initialCoords.usrCoords)}else{return JXG.Math.matVecMult(this.matrix,d.coords.usrCoords)}},applyOnce:function(f){var g,d,e;if(!JXG.isArray(f)){this.update();g=JXG.Math.matVecMult(this.matrix,f.coords.usrCoords);f.coords.setCoordinates(JXG.COORDS_BY_USER,[g[1],g[2]])}else{d=f.length;for(e=0;e<d;e++){this.update();g=JXG.Math.matVecMult(this.matrix,f[e].coords.usrCoords);f[e].coords.setCoordinates(JXG.COORDS_BY_USER,[g[1],g[2]])}}},bindTo:function(f){var e,d;if(JXG.isArray(f)){d=f.length;for(e=0;e<d;e++){f[e].transformations.push(this)}}else{f.transformations.push(this)}},setProperty:function(d){},melt:function(m){var l=[],h,d,g,e,n,f;d=m.matrix.length;g=this.matrix[0].length;for(h=0;h<d;h++){l[h]=[]}this.update();m.update();for(h=0;h<d;h++){for(f=0;f<g;f++){n=0;for(e=0;e<d;e++){n+=m.matrix[h][e]*this.matrix[e][f]}l[h][f]=n}}this.update=function(){var i=this.matrix.length,j=this.matrix[0].length;for(h=0;h<i;h++){for(f=0;f<j;f++){this.matrix[h][f]=l[h][f]}}};return true}});JXG.createTransform=function(d,f,e){return new JXG.Transformation(d,e.type,f)};JXG.JSXGraph.registerElement("transform",JXG.createTransform);JXG.Turtle=function(h,g,e){this.constructor(h,e,JXG.OBJECT_TYPE_TURTLE,JXG.OBJECT_CLASS_OTHER);var d,i,f;this.turtleIsHidden=false;this.board=h;this.attributes=JXG.checkAttributes(e,{withLabel:false,layer:null});this.attributes.straightFirst=false;this.attributes.straightLast=false;d=0;i=0;f=90;if(g.length!=0){if(g.length==3){d=g[0];i=g[1];f=g[2]}else{if(g.length==2){if(JXG.isArray(g[0])){d=g[0][0];i=g[0][1];f=g[1]}else{d=g[0];i=g[1]}}else{d=g[0][0];i=g[0][1]}}}this.init(d,i,f);return this};JXG.Turtle.prototype=new JXG.GeometryElement;JXG.extend(JXG.Turtle.prototype,{init:function(d,g,f){this.arrowLen=20/Math.sqrt(this.board.unitX*this.board.unitX+this.board.unitY*this.board.unitY);this.pos=[d,g];this.isPenDown=true;this.dir=90;this.stack=[];this.objects=[];this.attributes.curveType="plot";this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);this.turtle=this.board.create("point",this.pos,{fixed:true,name:" ",visible:false,withLabel:false});this.objects.push(this.turtle);this.turtle2=this.board.create("point",[this.pos[0],this.pos[1]+this.arrowLen],{fixed:true,name:" ",visible:false,withLabel:false});this.objects.push(this.turtle2);var e=this.attributes.strokeWidth||this.attributes.strokewidth||2;this.arrow=this.board.create("line",[this.turtle,this.turtle2],{strokeColor:"#ff0000",straightFirst:false,straightLast:false,strokeWidth:e,withLabel:false,lastArrow:true});this.objects.push(this.arrow);this.right(90-f);this.board.update()},forward:function(d){if(d===0){return this}var f=d*Math.cos(this.dir*Math.PI/180),e=d*Math.sin(this.dir*Math.PI/180);if(!this.turtleIsHidden){var g=this.board.create("transform",[f,e],{type:"translate"});g.applyOnce(this.turtle);g.applyOnce(this.turtle2)}if(this.isPenDown){if(this.curve.dataX.length>=8192){this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve)}}this.pos[0]+=f;this.pos[1]+=e;if(this.isPenDown){this.curve.dataX.push(this.pos[0]);this.curve.dataY.push(this.pos[1])}this.board.update();return this},back:function(d){return this.forward(-d)},right:function(e){this.dir-=e;this.dir%=360;if(!this.turtleIsHidden){var d=this.board.create("transform",[-e*Math.PI/180,this.turtle],{type:"rotate"});d.applyOnce(this.turtle2)}this.board.update();return this},left:function(d){return this.right(-d)},penUp:function(){this.isPenDown=false;return this},penDown:function(){this.isPenDown=true;this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);return this},clean:function(){for(var d=0;d<this.objects.length;d++){var e=this.objects[d];if(e.type==JXG.OBJECT_TYPE_CURVE){this.board.removeObject(e.id);this.objects.splice(d,1)}}this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);this.board.update();return this},clearScreen:function(){for(var d=0;d<this.objects.length;d++){var e=this.objects[d];this.board.removeObject(e.id)}this.init(0,0,90);return this},setPos:function(d,f){if(JXG.isArray(d)){this.pos=d}else{this.pos=[d,f]}if(!this.turtleIsHidden){this.turtle.setPositionDirectly(JXG.COORDS_BY_USER,d,f);this.turtle2.setPositionDirectly(JXG.COORDS_BY_USER,d,f+this.arrowLen);var e=this.board.create("transform",[-(this.dir-90)*Math.PI/180,this.turtle],{type:"rotate"});e.applyOnce(this.turtle2)}this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);this.board.update();return this},setPenSize:function(d){this.attributes.strokeWidth=d;this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);return this},setPenColor:function(d){this.attributes.strokeColor=d;this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);return this},setHighlightPenColor:function(d){this.attributes.highlightStrokeColor=d;this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve);return this},setProperty:function(){var h;var d;var f,g;var e;for(f=0;f<arguments.length;f++){d=arguments[f];if(typeof d=="string"){h=d.split(":")}else{if(!JXG.isArray(d)){for(var e in d){this.setProperty([e,d[e]])}return this}else{h=d}}this.attributes[h[0]]=h[1]}for(f=0;f<this.objects.length;f++){g=this.objects[f];if(g.type==JXG.OBJECT_TYPE_CURVE){g.setProperty(this.attributes)}}return this},showTurtle:function(){this.turtleIsHidden=false;this.arrow.setProperty("visible:true");this.setPos(this.pos[0],this.pos[1]);this.board.update();return this},hideTurtle:function(){this.turtleIsHidden=true;this.arrow.setProperty("visible:false");this.setPos(this.pos[0],this.pos[1]);this.board.update();return this},home:function(){this.pos=[0,0];this.setPos(this.pos[0],this.pos[1]);return this},pushTurtle:function(){this.stack.push([this.pos[0],this.pos[1],this.dir]);return this},popTurtle:function(){var d=this.stack.pop();this.pos[0]=d[0];this.pos[1]=d[1];this.dir=d[2];this.setPos(this.pos[0],this.pos[1]);return this},lookTo:function(h){if(JXG.isArray(h)){var e=this.pos[0];var d=this.pos[1];var i=h[0];var g=h[1];var f;f=Math.atan2(g-d,i-e);this.right(this.dir-(f*180/Math.PI))}else{if(JXG.isNumber(h)){this.right(this.dir-(h))}}return this},moveTo:function(g){if(JXG.isArray(g)){var e=g[0]-this.pos[0];var d=g[1]-this.pos[1];if(!this.turtleIsHidden){var f=this.board.create("transform",[e,d],{type:"translate"});f.applyOnce(this.turtle);f.applyOnce(this.turtle2)}if(this.isPenDown){if(this.curve.dataX.length>=8192){this.curve=this.board.create("curve",[[this.pos[0]],[this.pos[1]]],this.attributes);this.objects.push(this.curve)}}this.pos[0]=g[0];this.pos[1]=g[1];if(this.isPenDown){this.curve.dataX.push(this.pos[0]);this.curve.dataY.push(this.pos[1])}this.board.update()}return this},fd:function(d){return this.forward(d)},bk:function(d){return this.back(d)},lt:function(d){return this.left(d)},rt:function(d){return this.right(d)},pu:function(){return this.penUp()},pd:function(){return this.penDown()},ht:function(){return this.hideTurtle()},st:function(){return this.showTurtle()},cs:function(){return this.clearScreen()},push:function(){return this.pushTurtle()},pop:function(){return this.popTurtle()},X:function(d){return this.pos[0]},Y:function(d){return this.pos[1]},hasPoint:function(d,g){var e,f;for(e=0;e<this.objects.length;e++){f=this.objects[e];if(f.type==JXG.OBJECT_TYPE_CURVE){if(f.hasPoint(d,g)){return true}}}return false}});JXG.createTurtle=function(f,e,d){e=e||[];return new JXG.Turtle(f,e,d)};JXG.JSXGraph.registerElement("turtle",JXG.createTurtle);JXG.rgbParser=function(){if(arguments.length==0){return[0,0,0]}if(arguments.length>=3){arguments[0]=[arguments[0],arguments[1],arguments[2]];arguments.length=1}var n=arguments[0];if(JXG.isArray(n)){var e=false,j;for(j=0;j<3;j++){e|=/\./.test(arguments[0][j].toString())}for(j=0;j<3;j++){e&=(arguments[0][j]>=0)&(arguments[0][j]<=1)}if(e){return[Math.ceil(arguments[0][0]*255),Math.ceil(arguments[0][1]*255),Math.ceil(arguments[0][2]*255)]}else{arguments[0].length=3;return arguments[0]}}else{if(typeof arguments[0]=="string"){n=arguments[0]}}var d,l,o;if(n.charAt(0)=="#"){n=n.substr(1,6)}n=n.replace(/ /g,"");n=n.toLowerCase();var h={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var p in h){if(n==p){n=h[p]}}var m=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(g){return[parseInt(g[1]),parseInt(g[2]),parseInt(g[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(g){return[parseInt(g[1],16),parseInt(g[2],16),parseInt(g[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(g){return[parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16),parseInt(g[3]+g[3],16)]}}];for(var j=0;j<m.length;j++){var s=m[j].re,f=m[j].process,q=s.exec(n),k;if(q){k=f(q);d=k[0];l=k[1];o=k[2]}}d=(d<0||isNaN(d))?0:((d>255)?255:d);l=(l<0||isNaN(l))?0:((l>255)?255:l);o=(o<0||isNaN(o))?0:((o>255)?255:o);return[d,l,o]};JXG.rgb2css=function(){var f,e,d;f=JXG.rgbParser.apply(JXG.rgbParser,arguments);e=f[1];d=f[2];f=f[0];return"rgb("+f+", "+e+", "+d+")"};JXG.rgb2hex=function(){var f,e,d;f=JXG.rgbParser.apply(JXG.rgbParser,arguments);e=f[1];d=f[2];f=f[0];f=f.toString(16);e=e.toString(16);d=d.toString(16);if(f.length==1){f="0"+f}if(e.length==1){e="0"+e}if(d.length==1){d="0"+d}return"#"+f+e+d};JXG.hsv2rgb=function(o,k,j){var l,r,g,n,m,h,e,d,s;o=((o%360)+360)%360;if(k==0){if(isNaN(o)||o<JXG.Math.eps){l=j;r=j;g=j}else{return"#ffffff"}}else{if(o>=360){h=0}else{h=o}h=h/60;m=Math.floor(h);n=h-m;e=j*(1-k);d=j*(1-(k*n));s=j*(1-(k*(1-n)));switch(m){case 0:l=j;r=s;g=e;break;case 1:l=d;r=j;g=e;break;case 2:l=e;r=j;g=s;break;case 3:l=e;r=d;g=j;break;case 4:l=s;r=e;g=j;break;case 5:l=j;r=e;g=d;break}}l=Math.round(l*255).toString(16);l=(l.length==2)?l:((l.length==1)?"0"+l:"00");r=Math.round(r*255).toString(16);r=(r.length==2)?r:((r.length==1)?"0"+r:"00");g=Math.round(g*255).toString(16);g=(g.length==2)?g:((g.length==1)?"0"+g:"00");return["#",l,r,g].join("")};JXG.rgb2hsv=function(){var d,m,p,n,e,i,f,q,l,u,t,o,j,k;d=JXG.rgbParser.apply(JXG.rgbParser,arguments);m=d[1];p=d[2];d=d[0];k=JXG.Math.Statistics;n=d/255;e=m/255;i=p/255;o=k.max([d,m,p]);j=k.min([d,m,p]);f=o/255;q=j/255;t=f;u=0;if(t>0){u=(t-q)/(t*1)}l=1/(f-q);if(u>0){if(o==d){l=(e-i)*l}else{if(o==m){l=2+(i-n)*l}else{l=4+(n-e)*l}}}l*=60;if(l<0){l+=360}if(o==j){l=0}return[l,u,t]};JXG.rgb2LMS=function(){var n,k,e,f,d,j,i,h=[[0.05059983,0.08585369,0.0095242],[0.01893033,0.08925308,0.01370054],[0.00292202,0.00975732,0.07145979]];n=JXG.rgbParser.apply(JXG.rgbParser,arguments);k=n[1];e=n[2];n=n[0];n=Math.pow(n,0.476190476);k=Math.pow(k,0.476190476);e=Math.pow(e,0.476190476);f=n*h[0][0]+k*h[0][1]+e*h[0][2];d=n*h[1][0]+k*h[1][1]+e*h[1][2];j=n*h[2][0]+k*h[2][1]+e*h[2][2];i=[f,d,j];i.l=f;i.m=d;i.s=j;return i};JXG.LMS2rgb=function(f,e,o){var d,h,j,i,k=[[30.830854,-29.832659,1.610474],[-6.481468,17.715578,-2.532642],[-0.37569,-1.199062,14.273846]];d=f*k[0][0]+e*k[0][1]+o*k[0][2];h=f*k[1][0]+e*k[1][1]+o*k[1][2];j=f*k[2][0]+e*k[2][1]+o*k[2][2];var n=function(l){var m=127,g=64;while(g>0){if(Math.pow(m,0.476190476)>l){m-=g}else{if(Math.pow(m+1,0.476190476)>l){return m}m+=g}g/=2}if(m==254&&13.994955247<l){return 255}return m};d=n(d);h=n(h);j=n(j);i=[d,h,j];i.r=d;i.g=h;i.b=j;return i};JXG.rgba2rgbo=function(e){var d;if(e.length==9&&e.charAt(0)=="#"){d=parseInt(e.substr(7,2).toUpperCase(),16)/255;e=e.substr(0,7)}else{d=1}return[e,d]};JXG.rgb2bw=function(f){if(f=="none"){return f}var e,h="0123456789ABCDEF",g,d;d=JXG.rgbParser(f);e=0.3*d[0]+0.59*d[1]+0.11*d[2];g=h.charAt((e>>4)&15)+h.charAt(e&15);f="#"+g+""+g+""+g;return f};JXG.rgb2cb=function(i,p){if(i=="none"){return i}var r,h,g,v,q,n,f,u,k,e,t,j,o;q=JXG.rgb2LMS(i);h=q.l;g=q.m;v=q.s;p=p.toLowerCase();switch(p){case"protanopia":f=-0.06150039994295001;u=0.08277001656812001;k=-0.013200141220000003;e=0.05858939668799999;t=-0.07934519995360001;j=0.013289415272000003;o=0.6903216543277437;n=v/g;if(n<o){h=-(u*g+k*v)/f}else{h=-(t*g+j*v)/e}break;case"tritanopia":f=-0.00058973116217;u=0.007690316482;k=-0.01011703519052;e=0.025495080838999994;t=-0.0422740347;j=0.017005316784;o=0.8349489908460004;n=g/h;if(n<o){v=-(f*h+u*g)/k}else{v=-(e*h+t*g)/j}break;default:f=-0.06150039994295001;u=0.08277001656812001;k=-0.013200141220000003;e=0.05858939668799999;t=-0.07934519995360001;j=0.013289415272000003;o=0.5763833686400911;n=v/h;if(n<o){g=-(f*h+k*v)/u}else{g=-(e*h+j*v)/t}break}r=JXG.LMS2rgb(h,g,v);var d="0123456789ABCDEF";n=d.charAt((r.r>>4)&15)+d.charAt(r.r&15);i="#"+n;n=d.charAt((r.g>>4)&15)+d.charAt(r.g&15);i+=n;n=d.charAt((r.b>>4)&15)+d.charAt(r.b&15);i+=n;return i};JXG.extend(JXG.Board.prototype,{angle:function(d,f,e){return JXG.Math.Geometry.angle(d,f,e)},rad:function(d,f,e){return JXG.Math.Geometry.rad(d,f,e)},distance:function(e,d){return JXG.Math.Geometry.distance(e,d)},pow:function(e,d){return JXG.Math.pow(e,d)},round:function(d,e){return(d).toFixed(e)},cosh:function(d){return JXG.Math.cosh(d)},sinh:function(d){return JXG.Math.sinh(d)},sgn:function(d){return(d==0?0:d/(Math.abs(d)))},D:function(d,e){return JXG.Math.Numerics.D(d,e)},I:function(d,e){return JXG.Math.Numerics.I(d,e)},root:function(e,d,g){return JXG.Math.Numerics.root(e,d,g)},lagrangePolynomial:function(d){return JXG.Math.Numerics.lagrangePolynomial(d)},neville:function(d){return JXG.Math.Numerics.Neville(d)},riemannsum:function(g,i,e,h,d){return JXG.Math.Numerics.riemannsum(g,i,e,h,d)},abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,random:Math.random,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,trunc:Math.ceil,factorial:function(d){return JXG.Math.factorial(d)},binomial:function(e,d){return JXG.Math.binomial(e,d)},getElement:function(d){return JXG.getReference(this,d)},intersectionOptions:["point",[[JXG.OBJECT_CLASS_LINE,JXG.OBJECT_CLASS_LINE],[JXG.OBJECT_CLASS_LINE,JXG.OBJECT_CLASS_CIRCLE],[JXG.OBJECT_CLASS_CIRCLE,JXG.OBJECT_CLASS_CIRCLE]]],intersection:function(g,e,f,d){g=JXG.getReference(this,g);e=JXG.getReference(this,e);if(g.elementClass==JXG.OBJECT_CLASS_CURVE&&e.elementClass==JXG.OBJECT_CLASS_CURVE){return function(){return JXG.Math.Geometry.meetCurveCurve(g,e,f,d,g.board)}}else{if((g.type==JXG.OBJECT_TYPE_ARC&&e.elementClass==JXG.OBJECT_CLASS_LINE)||(e.type==JXG.OBJECT_TYPE_ARC&&g.elementClass==JXG.OBJECT_CLASS_LINE)){return function(){return JXG.Math.Geometry.meet(g.stdform,e.stdform,f,g.board)}}else{if((g.elementClass==JXG.OBJECT_CLASS_CURVE&&e.elementClass==JXG.OBJECT_CLASS_LINE)||(e.elementClass==JXG.OBJECT_CLASS_CURVE&&g.elementClass==JXG.OBJECT_CLASS_LINE)){return function(){return JXG.Math.Geometry.meetCurveLine(g,e,f,g.board)}}else{return function(){return JXG.Math.Geometry.meet(g.stdform,e.stdform,f,g.board)}}}}},intersectionFunc:function(g,e,f,d){return this.intersection(g,e,f,d)},otherIntersection:function(e,d,f){e=JXG.getReference(this,e);d=JXG.getReference(this,d);return function(){var g=JXG.Math.Geometry.meet(e.stdform,d.stdform,0,e.board);if(Math.abs(f.X()-g.usrCoords[1])>JXG.Math.eps||Math.abs(f.Y()-g.usrCoords[2])>JXG.Math.eps||Math.abs(f.Z()-g.usrCoords[0])>JXG.Math.eps){return g}else{return JXG.Math.Geometry.meet(e.stdform,d.stdform,1,e.board)}}},pointFunc:function(){return[null]},pointOptions:["point",[[JXG.OBJECT_CLASS_POINT]]],lineFunc:function(){return arguments},lineOptions:["line",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],linesegmentFunc:function(){return arguments},linesegmentOptions:["line",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],linesegmentAtts:{straightFirst:false,straightLast:false},arrowFunc:function(){return arguments},arrowOptions:["arrow",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],circleFunc:function(){return arguments},circleOptions:["circle",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT],[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE],[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_CIRCLE]]],arrowparallelOptions:["arrowparallel",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],arrowparallelFunc:function(){return arguments},bisectorOptions:["bisector",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],bisectorFunc:function(){return arguments},circumcircleOptions:["circumcircle",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],circumcircleFunc:function(){return arguments},circumcirclemidpointOptions:["circumcirclemidpoint",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],circumcirclemidpointFunc:function(){return arguments},integralOptions:["integral",[[]]],integralFunc:function(){return arguments},midpointOptions:["midpoint",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT],[JXG.OBJECT_CLASS_LINE]]],midpointFunc:function(){return arguments},mirrorpointOptions:["mirrorpoint",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],mirrorpointFunc:function(){return arguments},normalOptions:["normal",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],normalFunc:function(){return arguments},parallelOptions:["parallel",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],parallelFunc:function(){return arguments},parallelpointOptions:["parallelpoint",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_POINT]]],parallelpointFunc:function(){return arguments},perpendicularOptions:["perpendicular",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],perpendicularFunc:function(){return arguments},perpendicularpointOptions:["perpendicularpoint",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],perpendicularpointFunc:function(){return arguments},reflectionOptions:["reflection",[[JXG.OBJECT_CLASS_POINT,JXG.OBJECT_CLASS_LINE]]],reflectionFunc:function(){return arguments}});JXG.Point.prototype.setPositionX=function(f,d){var e=(f==JXG.COORDS_BY_USER)?this.coords.usrCoords[2]:this.coords.scrCoords[2];this.setPosition(f,d,e)};JXG.Point.prototype.setPositionY=function(f,e){var d=(f==JXG.COORDS_BY_USER)?this.coords.usrCoords[1]:this.coords.scrCoords[1];this.setPosition(f,d,e)};JXG.Ticks=function(d,f,e){this.constructor(d.board,e,JXG.OBJECT_TYPE_TICKS,JXG.OBJECT_CLASS_OTHER);this.line=d;this.board=this.line.board;this.ticksFunction=null;this.fixedTicks=null;this.equidistant=false;if(JXG.isFunction(f)){this.ticksFunction=f;throw new Error("Function arguments are no longer supported.")}else{if(JXG.isArray(f)){this.fixedTicks=f}else{if(Math.abs(f)<JXG.Math.eps){f=e.defaultdistance}this.ticksFunction=function(g){return f};this.equidistant=true}}this.minTicksDistance=e.minticksdistance;this.maxTicksDistance=e.maxticksdistance;this.labels=[];this.id=this.line.addTicks(this);this.board.setId(this,"Ti")};JXG.Ticks.prototype=new JXG.GeometryElement();JXG.extend(JXG.Ticks.prototype,{hasPoint:function(d,e){return false},calculateTicksCoordinates:function(){if(this.visProp.minorheight<0){this.visProp.minorheight=2*(this.board.canvasWidth+this.board.canvasHeight)}if(this.visProp.majorheight<0){this.visProp.majorheight=2*(this.board.canvasWidth+this.board.canvasHeight)}var h=this.line.point1,e=this.line.point2,x=h.coords.distance(JXG.COORDS_BY_USER,e.coords),K=(e.coords.usrCoords[1]-h.coords.usrCoords[1])/x,I=(e.coords.usrCoords[2]-h.coords.usrCoords[2])/x,p=h.coords.distance(JXG.COORDS_BY_SCREEN,new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+K,h.coords.usrCoords[2]+I],this.board)),E=(this.equidistant?this.ticksFunction(1):1),A=5,q,n,H,k,B,d,D,w,u=function(R,i,O,N,Q){var P,M;if(!N){return null}P=R.toString();if(Math.abs(R)<JXG.Math.eps){P="0"}if(P.length>5||P.indexOf("e")!=-1){P=R.toPrecision(3).toString()}if(P.indexOf(".")>-1){P=P.replace(/0+$/,"");P=P.replace(/\.$/,"")}M=JXG.createText(O,[i.usrCoords[1],i.usrCoords[2],P],{id:Q+D+"Label",isLabel:true,layer:O.options.layer.line,highlightStrokeColor:O.options.text.strokeColor,highlightStrokeWidth:O.options.text.strokeWidth,highlightStrokeOpacity:O.options.text.strokeOpacity});M.isDraggable=false;M.distanceX=4;M.distanceY=-parseInt(M.visProp.fontsize)+3;M.setCoords(i.usrCoords[1]+M.distanceX/(O.unitX),i.usrCoords[2]+M.distanceY/(O.unitY));M.visProp.visible=N;M.prepareUpdate().update().updateRenderer();return M},l=function(i){return Math.ceil(i/E)*E},y=JXG.Math.eps,t=-this.line.getSlope(),v=this.visProp.majorheight/2,j=this.visProp.minorheight/2,J=0,g=0,z=0,C=0;if(Math.abs(t)<y){J=0;g=v;z=0;C=j}else{if((Math.abs(t)>1/y)||(isNaN(t))){J=v;g=0;z=j;C=0}else{J=-v/Math.sqrt(1/(t*t)+1);g=J/t;z=-j/Math.sqrt(1/(t*t)+1);C=z/t}}this.removeTickLabels();this.ticks=new Array();this.labels=new Array();q=new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1],h.coords.usrCoords[2]],this.board);n=new JXG.Coords(JXG.COORDS_BY_USER,[e.coords.usrCoords[1],e.coords.usrCoords[2]],this.board);JXG.Math.Geometry.calcStraight(this.line,q,n);if(!this.equidistant){var s=h.coords.usrCoords[1]-q.usrCoords[1],o=h.coords.usrCoords[2]-q.usrCoords[2],L=Math.sqrt(s*s+o*o),m=h.coords.usrCoords[1]-n.usrCoords[1],r=h.coords.usrCoords[2]-n.usrCoords[2],f=Math.sqrt(m*m+r*r),G=0,F=0;for(D=0;D<this.fixedTicks.length;D++){if((-L<=this.fixedTicks[D])&&(this.fixedTicks[D]<=f)){if(this.fixedTicks[D]<0){G=Math.abs(s)*this.fixedTicks[D]/L;F=Math.abs(o)*this.fixedTicks[D]/L}else{G=Math.abs(m)*this.fixedTicks[D]/f;F=Math.abs(r)*this.fixedTicks[D]/f}B=new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+G,h.coords.usrCoords[2]+F],this.board);this.ticks.push(B);this.ticks[this.ticks.length-1].major=true;this.labels.push(u(this.fixedTicks[D],B,this.board,this.visProp.drawlabels,this.id))}}this.dxMaj=J;this.dyMaj=g;this.dxMin=z;this.dyMin=C;return}if(this.visProp.insertticks&&this.minTicksDistance>JXG.Math.eps){while(p>4*this.minTicksDistance){E/=10;p=h.coords.distance(JXG.COORDS_BY_SCREEN,new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+K*E,h.coords.usrCoords[2]+I*E],this.board))}while(p<this.minTicksDistance){E*=A;A=(A==5?2:5);p=h.coords.distance(JXG.COORDS_BY_SCREEN,new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+K*E,h.coords.usrCoords[2]+I*E],this.board))}}if(JXG.Math.Geometry.isSameDirection(h.coords,q,n)){H=h.coords.distance(JXG.COORDS_BY_USER,q);k=h.coords.distance(JXG.COORDS_BY_USER,n);if(JXG.Math.Geometry.isSameDirection(h.coords,e.coords,q)){if(this.line.visProp.straightfirst){H-=2*E}}else{k=-1*k;H=-1*H;if(this.line.visProp.straightfirst){H-=2*E}}if(H>k){D=H;H=k;k=D}H=l(H);if(this.line.visProp.straightlast){k+=2*E}}else{if(!this.line.visProp.straightfirst){H=0}else{H=-l(h.coords.distance(JXG.COORDS_BY_USER,q))}if(!this.line.visProp.straightlast){k=x}else{k=h.coords.distance(JXG.COORDS_BY_USER,n)}}d=new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+H*K,h.coords.usrCoords[2]+H*I],this.board);B=new JXG.Coords(JXG.COORDS_BY_USER,[h.coords.usrCoords[1]+H*K,h.coords.usrCoords[2]+H*I],this.board);K/=this.visProp.minorticks+1;I/=this.visProp.minorticks+1;D=0;w=H;while(d.distance(JXG.COORDS_BY_USER,B)<Math.abs(k-H)+JXG.Math.eps){if(D%(this.visProp.minorticks+1)===0){B.major=true;this.labels.push(u(w,B,this.board,this.visProp.drawlabels,this.id));w+=E}else{B.major=false;this.labels.push(null)}D++;this.ticks.push(B);B=new JXG.Coords(JXG.COORDS_BY_USER,[B.usrCoords[1]+K*E,B.usrCoords[2]+I*E],this.board);if(!this.visProp.drawzero&&B.distance(JXG.COORDS_BY_USER,h.coords)<=JXG.Math.eps){D++;w+=E;B=new JXG.Coords(JXG.COORDS_BY_USER,[B.usrCoords[1]+K*E,B.usrCoords[2]+I*E],this.board)}}this.dxMaj=J;this.dyMaj=g;this.dxMin=z;this.dyMin=C},removeTickLabels:function(){var d;if(this.ticks!=null){if((this.board.needsFullUpdate||this.needsRegularUpdate)&&!(this.board.options.renderer=="canvas"&&this.board.options.text.display=="internal")){for(d=0;d<this.ticks.length;d++){if(this.labels[d]!=null&&this.labels[d].visProp.visible){this.board.removeObject(this.labels[d])}}}}},update:function(){if(this.needsUpdate){this.calculateTicksCoordinates()}return this},updateRenderer:function(){if(this.needsUpdate){if(this.ticks){this.board.renderer.updateTicks(this,this.dxMaj,this.dyMaj,this.dxMin,this.dyMin)}this.needsUpdate=false}return this},hideElement:function(){var d;this.visProp.visible=false;this.board.renderer.hide(this);for(d=0;d<this.labels.length;d++){if(JXG.exists(this.labels[d])){this.labels[d].hideElement()}}return this},showElement:function(){var d;this.visProp.visible=true;this.board.renderer.show(this);for(d=0;d<this.labels.length;d++){if(JXG.exists(this.labels[d])){this.labels[d].showElement()}}return this}});JXG.createTicks=function(h,f,e){var g,i,d=JXG.copyAttributes(e,h.options,"ticks");if(f.length<2){i=e.ticksDistance}else{i=f[1]}if((f[0].elementClass==JXG.OBJECT_CLASS_LINE)&&(JXG.isFunction(f[1])||JXG.isArray(f[1])||JXG.isNumber(f[1]))){g=new JXG.Ticks(f[0],i,d)}else{throw new Error("JSXGraph: Can't create Ticks with parent types '"+(typeof f[0])+"' and '"+(typeof f[1])+"'.")}return g};JXG.JSXGraph.registerElement("ticks",JXG.createTicks);JXG.Util={};JXG.Util.Unzip=function(T){var p=[],G="",E=false,B,H=0,Q=[],t,k=new Array(32768),Y=0,L=false,V,I,X=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],ab=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],S=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],x=T,e=0,j=0,ac=1,d=0,aa=256,i=[],m;function g(){d+=8;if(e<x.length){return x[e++]}else{return -1}}function r(){ac=1}function W(){var ae;d++;ae=(ac&1);ac>>=1;if(ac==0){ac=g();ae=(ac&1);ac=(ac>>1)|128}return ae}function U(ae){var ag=0,af=ae;while(af--){ag=(ag<<1)|W()}if(ae){ag=X[ag]>>(8-ae)}return ag}function f(){Y=0}function y(ae){I++;k[Y++]=ae;p.push(String.fromCharCode(ae));if(Y==32768){Y=0}}function o(){this.b0=0;this.b1=0;this.jump=null;this.jumppos=-1}var h=288;var w=new Array(h);var O=new Array(32);var J=0;var Z=null;var s=null;var N=new Array(64);var K=new Array(64);var z=0;var D=new Array(17);D[0]=0;var P;var v;function l(){while(1){if(D[z]>=v){return -1}if(P[D[z]]==z){return D[z]++}D[z]++}}function F(){var af=Z[J];var ae;if(E){document.write("<br>len:"+z+" treepos:"+J)}if(z==17){return -1}J++;z++;ae=l();if(E){document.write("<br>IsPat "+ae)}if(ae>=0){af.b0=ae;if(E){document.write("<br>b0 "+af.b0)}}else{af.b0=32768;if(E){document.write("<br>b0 "+af.b0)}if(F()){return -1}}ae=l();if(ae>=0){af.b1=ae;if(E){document.write("<br>b1 "+af.b1)}af.jump=null}else{af.b1=32768;if(E){document.write("<br>b1 "+af.b1)}af.jump=Z[J];af.jumppos=J;if(F()){return -1}}z--;return 0}function n(ai,ag,aj,af){var ah;if(E){document.write("currentTree "+ai+" numval "+ag+" lengths "+aj+" show "+af)}Z=ai;J=0;P=aj;v=ag;for(ah=0;ah<17;ah++){D[ah]=0}z=0;if(F()){if(E){alert("invalid huffman tree\n")}return -1}if(E){document.write("<br>Tree: "+Z.length);for(var ae=0;ae<32;ae++){document.write("Places["+ae+"].b0="+Z[ae].b0+"<br>");document.write("Places["+ae+"].b1="+Z[ae].b1+"<br>")}}return 0}function C(ah){var af,ag,aj=0,ai=ah[aj],ae;while(1){ae=W();if(E){document.write("b="+ae)}if(ae){if(!(ai.b1&32768)){if(E){document.write("ret1")}return ai.b1}ai=ai.jump;af=ah.length;for(ag=0;ag<af;ag++){if(ah[ag]===ai){aj=ag;break}}}else{if(!(ai.b0&32768)){if(E){document.write("ret2")}return ai.b0}aj++;ai=ah[aj]}}if(E){document.write("ret3")}return -1}function ad(){var ai,av,af,at,au;do{ai=W();af=U(2);switch(af){case 0:if(E){alert("Stored\n")}break;case 1:if(E){alert("Fixed Huffman codes\n")}break;case 2:if(E){alert("Dynamic Huffman codes\n")}break;case 3:if(E){alert("Reserved block type!!\n")}break;default:if(E){alert("Unexpected value %d!\n",af)}break}if(af==0){var aq,ae;r();aq=g();aq|=(g()<<8);ae=g();ae|=(g()<<8);if(((aq^~ae)&65535)){document.write("BlockLen checksum mismatch\n")}while(aq--){av=g();y(av)}}else{if(af==1){var ar;while(1){ar=(X[U(7)]>>1);if(ar>23){ar=(ar<<1)|W();if(ar>199){ar-=128;ar=(ar<<1)|W()}else{ar-=48;if(ar>143){ar=ar+136}}}else{ar+=256}if(ar<256){y(ar)}else{if(ar==256){break}else{var au,an;ar-=256+1;au=U(S[ar])+ab[ar];ar=X[U(5)]>>3;if(A[ar]>8){an=U(8);an|=(U(A[ar]-8)<<8)}else{an=U(A[ar])}an+=M[ar];for(ar=0;ar<au;ar++){var av=k[(Y-an)&32767];y(av)}}}}}else{if(af==2){var ar,ao,ag,al,am;var ak=new Array(288+32);ag=257+U(5);al=1+U(5);am=4+U(4);for(ar=0;ar<19;ar++){ak[ar]=0}for(ar=0;ar<am;ar++){ak[q[ar]]=U(3)}au=O.length;for(at=0;at<au;at++){O[at]=new o()}if(n(O,19,ak,0)){f();return 1}if(E){document.write("<br>distanceTree");for(var aw=0;aw<O.length;aw++){document.write("<br>"+O[aw].b0+" "+O[aw].b1+" "+O[aw].jump+" "+O[aw].jumppos)}}ao=ag+al;at=0;var ah=-1;if(E){document.write("<br>n="+ao+" bits: "+d+"<br>")}while(at<ao){ah++;ar=C(O);if(E){document.write("<br>"+ah+" i:"+at+" decode: "+ar+"    bits "+d+"<br>")}if(ar<16){ak[at++]=ar}else{if(ar==16){var ap;ar=3+U(2);if(at+ar>ao){f();return 1}ap=at?ak[at-1]:0;while(ar--){ak[at++]=ap}}else{if(ar==17){ar=3+U(3)}else{ar=11+U(7)}if(at+ar>ao){f();return 1}while(ar--){ak[at++]=0}}}}au=w.length;for(at=0;at<au;at++){w[at]=new o()}if(n(w,ag,ak,0)){f();return 1}au=w.length;for(at=0;at<au;at++){O[at]=new o()}var aj=new Array();for(at=ag;at<ak.length;at++){aj[at-ag]=ak[at]}if(n(O,al,aj,0)){f();return 1}if(E){document.write("<br>literalTree")}while(1){ar=C(w);if(ar>=256){var au,an;ar-=256;if(ar==0){break}ar--;au=U(S[ar])+ab[ar];ar=C(O);if(A[ar]>8){an=U(8);an|=(U(A[ar]-8)<<8)}else{an=U(A[ar])}an+=M[ar];while(au--){var av=k[(Y-an)&32767];y(av)}}else{y(ar)}}}}}}while(!ai);f();r();return 0}JXG.Util.Unzip.prototype.unzipFile=function(ae){var af;this.unzip();for(af=0;af<Q.length;af++){if(Q[af][1]==ae){return Q[af][0]}}};JXG.Util.Unzip.prototype.unzip=function(){if(E){alert(x)}u();return Q};function u(){if(E){alert("NEXTFILE")}p=[];var ai=[];L=false;ai[0]=g();ai[1]=g();if(E){alert("type: "+ai[0]+" "+ai[1])}if(ai[0]==parseInt("78",16)&&ai[1]==parseInt("da",16)){if(E){alert("GEONExT-GZIP")}ad();if(E){alert(p.join(""))}Q[H]=new Array(2);Q[H][0]=p.join("");Q[H][1]="geonext.gxt";H++}if(ai[0]==parseInt("1f",16)&&ai[1]==parseInt("8b",16)){if(E){alert("GZIP")}R();if(E){alert(p.join(""))}Q[H]=new Array(2);Q[H][0]=p.join("");Q[H][1]="file";H++}if(ai[0]==parseInt("50",16)&&ai[1]==parseInt("4b",16)){L=true;ai[2]=g();ai[3]=g();if(ai[2]==parseInt("3",16)&&ai[3]==parseInt("4",16)){ai[0]=g();ai[1]=g();if(E){alert("ZIP-Version: "+ai[1]+" "+ai[0]/10+"."+ai[0]%10)}B=g();B|=(g()<<8);if(E){alert("gpflags: "+B)}var ae=g();ae|=(g()<<8);if(E){alert("method: "+ae)}g();g();g();g();var aj=g();aj|=(g()<<8);aj|=(g()<<16);aj|=(g()<<24);var ah=g();ah|=(g()<<8);ah|=(g()<<16);ah|=(g()<<24);var am=g();am|=(g()<<8);am|=(g()<<16);am|=(g()<<24);if(E){alert("local CRC: "+aj+"\nlocal Size: "+am+"\nlocal CompSize: "+ah)}var af=g();af|=(g()<<8);var al=g();al|=(g()<<8);if(E){alert("filelen "+af)}ag=0;i=[];while(af--){var ak=g();if(ak=="/"|ak==":"){ag=0}else{if(ag<aa-1){i[ag++]=String.fromCharCode(ak)}}}if(E){alert("nameBuf: "+i)}if(!m){m=i}var ag=0;while(ag<al){ak=g();ag++}V=4294967295;I=0;if(am=0&&fileOut.charAt(m.length-1)=="/"){if(E){alert("skipdir")}}if(ae==8){ad();if(E){alert(p.join(""))}Q[H]=new Array(2);Q[H][0]=p.join("");Q[H][1]=i.join("");H++}R()}}}function R(){var aj,ag=[],ah,af,ai,ae,ak;if((B&8)){ag[0]=g();ag[1]=g();ag[2]=g();ag[3]=g();if(ag[0]==parseInt("50",16)&&ag[1]==parseInt("4b",16)&&ag[2]==parseInt("07",16)&&ag[3]==parseInt("08",16)){aj=g();aj|=(g()<<8);aj|=(g()<<16);aj|=(g()<<24)}else{aj=ag[0]|(ag[1]<<8)|(ag[2]<<16)|(ag[3]<<24)}ah=g();ah|=(g()<<8);ah|=(g()<<16);ah|=(g()<<24);af=g();af|=(g()<<8);af|=(g()<<16);af|=(g()<<24);if(E){alert("CRC:")}}if(L){u()}ag[0]=g();if(ag[0]!=8){if(E){alert("Unknown compression method!")}return 0}B=g();if(E){if((B&~(parseInt("1f",16)))){alert("Unknown flags set!")}}g();g();g();g();g();ai=g();if((B&4)){ag[0]=g();ag[2]=g();z=ag[0]+256*ag[1];if(E){alert("Extra field size: "+z)}for(ae=0;ae<z;ae++){g()}}if((B&8)){ae=0;i=[];while(ak=g()){if(ak=="7"||ak==":"){ae=0}if(ae<aa-1){i[ae++]=ak}}if(E){alert("original file name: "+i)}}if((B&16)){while(ak=g()){}}if((B&2)){g();g()}ad();aj=g();aj|=(g()<<8);aj|=(g()<<16);aj|=(g()<<24);af=g();af|=(g()<<8);af|=(g()<<16);af|=(g()<<24);if(L){u()}}};JXG.Util.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(f){var d=[],n,l,j,m,k,h,g,e=0;f=JXG.Util.Base64._utf8_encode(f);while(e<f.length){n=f.charCodeAt(e++);l=f.charCodeAt(e++);j=f.charCodeAt(e++);m=n>>2;k=((n&3)<<4)|(l>>4);h=((l&15)<<2)|(j>>6);g=j&63;if(isNaN(l)){h=g=64}else{if(isNaN(j)){g=64}}d.push([this._keyStr.charAt(m),this._keyStr.charAt(k),this._keyStr.charAt(h),this._keyStr.charAt(g)].join(""))}return d.join("")},decode:function(g,f){var d=[],o,m,k,n,l,j,h,e=0;g=g.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(e<g.length){n=this._keyStr.indexOf(g.charAt(e++));l=this._keyStr.indexOf(g.charAt(e++));j=this._keyStr.indexOf(g.charAt(e++));h=this._keyStr.indexOf(g.charAt(e++));o=(n<<2)|(l>>4);m=((l&15)<<4)|(j>>2);k=((j&3)<<6)|h;d.push(String.fromCharCode(o));if(j!=64){d.push(String.fromCharCode(m))}if(h!=64){d.push(String.fromCharCode(k))}}d=d.join("");if(f){d=JXG.Util.Base64._utf8_decode(d)}return d},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g<e.length;g++){var f=e.charCodeAt(g);if(f<128){d+=String.fromCharCode(f)}else{if((f>127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},_utf8_decode:function(d){var f=[],h=0,j=0,g=0,e=0;while(h<d.length){j=d.charCodeAt(h);if(j<128){f.push(String.fromCharCode(j));h++}else{if((j>191)&&(j<224)){g=d.charCodeAt(h+1);f.push(String.fromCharCode(((j&31)<<6)|(g&63)));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f.push(String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63)));h+=3}}}return f.join("")},_destrip:function(j,g){var e=[],h,f,d=[];if(g==null){g=76}j.replace(/ /g,"");h=j.length/g;for(f=0;f<h;f++){e[f]=j.substr(f*g,g)}if(h!=j.length/g){e[e.length]=j.substr(h*g,j.length-(h*g))}for(f=0;f<e.length;f++){d.push(e[f])}return d.join("\n")},decodeAsArray:function(e){var g=this.decode(e),d=[],f;for(f=0;f<g.length;f++){d[f]=g.charCodeAt(f)}return d},decodeGEONExT:function(d){return decodeAsArray(destrip(d),false)}};JXG.Util.asciiCharCodeAt=function(e,d){var f=e.charCodeAt(d);if(f>255){switch(f){case 8364:f=128;break;case 8218:f=130;break;case 402:f=131;break;case 8222:f=132;break;case 8230:f=133;break;case 8224:f=134;break;case 8225:f=135;break;case 710:f=136;break;case 8240:f=137;break;case 352:f=138;break;case 8249:f=139;break;case 338:f=140;break;case 381:f=142;break;case 8216:f=145;break;case 8217:f=146;break;case 8220:f=147;break;case 8221:f=148;break;case 8226:f=149;break;case 8211:f=150;break;case 8212:f=151;break;case 732:f=152;break;case 8482:f=153;break;case 353:f=154;break;case 8250:f=155;break;case 339:f=156;break;case 382:f=158;break;case 376:f=159;break;default:break}}return f};JXG.Util.utf8Decode=function(d){var f=[];var h=0;var k=0,j=0,g=0,e;if(!JXG.exists(d)){return""}while(h<d.length){k=d.charCodeAt(h);if(k<128){f.push(String.fromCharCode(k));h++}else{if((k>191)&&(k<224)){g=d.charCodeAt(h+1);f.push(String.fromCharCode(((k&31)<<6)|(g&63)));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f.push(String.fromCharCode(((k&15)<<12)|((g&63)<<6)|(e&63)));h+=3}}}return f.join("")};JXG.Util.genUUID=function(){var h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),f=new Array(36),e=0,g;for(var d=0;d<36;d++){if(d==8||d==13||d==18||d==23){f[d]="-"}else{if(d==14){f[d]="4"}else{if(e<=2){e=33554432+(Math.random()*16777216)|0}g=e&15;e=e>>4;f[d]=h[(d==19)?(g&3)|8:g]}}}return f.join("")};JXG.PsTricks={convert:function(g){var h=new JXG.Coords(JXG.COORDS_BY_SCREEN,[0,0],g),j=new JXG.Coords(JXG.COORDS_BY_SCREEN,[g.canvasWidth,g.canvasHeight],g),e,f,d=[];d.push("\\begin{pspicture*}("+h.usrCoords[1]+","+j.usrCoords[2]+")("+j.usrCoords[1]+","+h.usrCoords[2]+")\n");for(e in g.objects){f=g.objects[e];if(f.visProp.visible){switch(f.elementClass){case JXG.OBJECT_CLASS_CIRCLE:d.push(this.addCircle(f));break;case JXG.OBJECT_CLASS_LINE:d.push(this.addLine(f));break;case JXG.OBJECT_CLASS_POINT:d.push(this.addPoint(f));break;default:switch(f.type){case JXG.OBJECT_TYPE_ARC:d.push(this.addArc(f));break;case JXG.OBJECT_TYPE_SECTOR:d.push(this.addArc(f));d.push(this.addSector(f));break;case JXG.OBJECT_TYPE_POLYGON:d.push(this.addPolygon(f));break;case JXG.OBJECT_TYPE_ANGLE:d.push(this.addAngle(f));break}break}}}d.push("\\end{pspicture*}");return d.join("\n")},setArrows:function(e){var d="";if(e.visProp.firstarrow&&e.visProp.lastarrow){d="{<->}"}else{if(e.visProp.firstarrow){d="{<-}"}else{if(e.visProp.lastarrow){d="{->}"}}}return d},drawWedge:function(f,g,h,e,j,i){var d="";if(f!="none"&&g>0){d+="\\pswedge[linestyle=none, fillstyle=solid, fillcolor="+this.parseColor(f)+", opacity="+g.toFixed(5)+"]";d+="("+h.join(",")+"){"+e+"}{"+j+"}{"+i+"}\n"}return d},addPoint:function(f){var d="\\psdot[linecolor="+this.parseColor(f.visProp.strokecolor)+",dotstyle=",g=f.normalizeFace(f.visProp.face)||"o",e=f.visProp.size>4?4:f.visProp.size,h=[0,0,"2pt 2","5pt 2","5pt 3"];if(g=="x"){d+="x, dotsize="+h[e]}else{if(g=="o"){d+="*, dotsize=";if(e==1){d+="2pt 2"}else{if(e==2){d+="4pt 2"}else{if(e==3){d+="6pt 2"}else{if(e==4){d+="6pt 3"}}}}}else{if(g=="[]"){d+="square*, dotsize="+h[e]}else{if(g=="+"){d+="+, dotsize="+h[e]}}}}d+="]("+f.coords.usrCoords.slice(1).join(",")+")\n";d+="\\rput("+(f.coords.usrCoords[1]+15/f.board.unitY)+","+(f.coords.usrCoords[2]+15/f.board.unitY)+"){\\small $"+f.name+"$}\n";return d},addLine:function(g){var f=new JXG.Coords(JXG.COORDS_BY_USER,g.point1.coords.usrCoords,g.board),e=new JXG.Coords(JXG.COORDS_BY_USER,g.point2.coords.usrCoords,g.board),d="\\psline[linecolor="+this.parseColor(g.visProp.strokecolor)+", linewidth="+g.visProp.strokewidth+"px]";if(g.visProp.straightfirst||g.visProp.straightlast){JXG.Math.Geometry.calcStraight(g,f,e)}d+=this.setArrows(g);d+="("+f.usrCoords.slice(1).join(",")+")("+e.usrCoords.slice(2).join(",")+")\n";return d},addCircle:function(f){var e=f.Radius(),d="\\pscircle[linecolor="+this.parseColor(f.visProp.strokecolor)+", linewidth="+f.visProp.strokewidth+"px";if(f.visProp.fillcolor!="none"&&f.visProp.fillopacity!=0){d+=", fillstyle=solid, fillcolor="+this.parseColor(f.visProp.fillcolor)+", opacity="+f.visProp.fillopacity.toFixed(5)}d+="]("+f.midpoint.coords.usrCoords.slice(1).join("1")+"){"+e+"}\n";return d},addPolygon:function(f){var d="\\pspolygon[linestyle=none, fillstyle=solid, fillcolor="+this.parseColor(f.visProp.fillcolor)+", opacity="+f.visProp.fillopacity.toFixed(5)+"]",e;for(e=0;e<f.vertices.length;e++){d+="("+f.vertices[e].coords.usrCoords.slice(1).join(",")+")"}d+="\n";return d},addArc:function(f){var e=f.Radius(),h={coords:new JXG.Coords(JXG.COORDS_BY_USER,[f.board.canvasWidth/(f.board.unitY),f.midpoint.coords.usrCoords[2]],f.board)},g=JXG.Math.Geometry.trueAngle(h,f.midpoint,f.point2).toFixed(4),i=JXG.Math.Geometry.trueAngle(h,f.midpoint,f.point3).toFixed(4),d="\\psarc[linecolor="+this.parseColor(f.visProp.strokecolor)+", linewidth="+f.visProp.strokewidth+"px]";d+=this.setArrows(f);d+="("+f.midpoint.coords.usrCoords.slice(1).join(",")+"){"+e+"}{"+g+"}{"+i+"}\n";return d},addSector:function(e){var d=e.Radius(),g={coords:new JXG.Coords(JXG.COORDS_BY_USER,[e.board.canvasWidth/(e.board.unitY),e.midpoint.coords.usrCoords[2]],e.board)},f=JXG.Math.Geometry.trueAngle(g,e.midpoint,e.point2).toFixed(4),h=JXG.Math.Geometry.trueAngle(g,e.midpoint,e.point3).toFixed(4);return this.drawWedge(e.visProp.fillcolor,e.visProp.fillopacity,e.midpoint.coords.usrCoords.slice(1),d,f,h)},addAngle:function(f){var e=f.radius,h={coords:new JXG.Coords(JXG.COORDS_BY_USER,[f.board.canvasWidth/(f.board.unitY),f.point2.coords.usrCoords[2]],f.board)},g=JXG.Math.Geometry.trueAngle(h,f.point2,f.point1).toFixed(4),i=JXG.Math.Geometry.trueAngle(h,f.point2,f.point3).toFixed(4),d;d=this.drawWedge(f.visProp.fillcolor,f.visProp.fillopacity,f.point2.coords.usrCoords.slice(1),e,g,i);d+="\\psarc[linecolor="+this.parseColor(f.visProp.strokecolor)+", linewidth="+f.visProp.strokewidth+"px]";d+="("+f.point2.coords.usrCoords.slice(1).join(",")+"){"+e+"}{"+g+"}{"+i+"}\n";return d},parseColor:function(e){var d=JXG.rgbParser(e);return"{[rgb]{"+d[0]/255+","+d[1]/255+","+d[2]/255+"}}"}};JXG.Server=function(){};JXG.Server.modules=function(){};JXG.Server.runningCalls={};JXG.Server.handleError=function(d){alert("error occured, server says: "+d.message)};JXG.Server.callServer=function(h,o,i,m){var n,e,l,g,d,j,f;m=m||false;g="";for(f in i){g+="&"+escape(f)+"="+escape(i[f])}j=JXG.toJSON(i);do{d=h+Math.floor(Math.random()*4096)}while(typeof this.runningCalls[d]!="undefined");this.runningCalls[d]={action:h};if(typeof i.module!="undefined"){this.runningCalls[d].module=i.module}n=JXG.serverBase+"JXGServer.py";e="action="+escape(h)+"&id="+d+"&dataJSON="+escape(JXG.Util.Base64.encode(j));this.cbp=function(u){var w,q,r,t,v,k,s,p;w=(new JXG.Util.Unzip(JXG.Util.Base64.decodeAsArray(u))).unzip();if(JXG.isArray(w)&&w.length>0){w=w[0][0]}if(typeof w!="string"){return}q=window.JSON&&window.JSON.parse?window.JSON.parse(w):(new Function("return "+w))();if(q.type=="error"){this.handleError(q)}else{if(q.type=="response"){k=q.id;for(s=0;s<q.fields.length;s++){r=q.fields[s];t=r.namespace+(typeof((new Function("return "+r.namespace))())=="object"?".":".prototype.")+r.name+" = "+r.value;(new Function(t))()}for(s=0;s<q.handler.length;s++){r=q.handler[s];v=[];for(p=0;p<r.parameters.length;p++){v[p]='"'+r.parameters[p]+'": '+r.parameters[p]}t="if(typeof JXG.Server.modules."+this.runningCalls[k].module+' == "undefined")JXG.Server.modules.'+this.runningCalls[k].module+" = {};";t+="JXG.Server.modules."+this.runningCalls[k].module+"."+r.name+"_cb = "+r.callback+";";t+="JXG.Server.modules."+this.runningCalls[k].module+"."+r.name+" = function ("+r.parameters.join(",")+', __JXGSERVER_CB__, __JXGSERVER_SYNC) {if(typeof __JXGSERVER_CB__ == "undefined") __JXGSERVER_CB__ = JXG.Server.modules.'+this.runningCalls[k].module+"."+r.name+"_cb;var __JXGSERVER_PAR__ = {"+v.join(",")+', "module": "'+this.runningCalls[k].module+'", "handler": "'+r.name+'" };JXG.Server.callServer("exec", __JXGSERVER_CB__, __JXGSERVER_PAR__, __JXGSERVER_SYNC);};';(new Function(t))()}delete this.runningCalls[k];o(q.data)}}};this.cb=JXG.bind(this.cbp,this);if(window.XMLHttpRequest){l=new XMLHttpRequest();l.overrideMimeType("text/plain; charset=iso-8859-1")}else{l=new ActiveXObject("Microsoft.XMLHTTP")}if(l){l.open("POST",n,!m);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(!m){l.onreadystatechange=(function(k){return function(){switch(l.readyState){case 4:if(l.status!=200){}else{k(l.responseText)}break;default:return false;break}}})(this.cb)}l.send(e);if(m){this.cb(l.responseText)}}else{return false}};JXG.Server.loadModule_cb=function(e){var d;for(d=0;d<e.length;d++){alert(e[d].name+": "+e[d].value)}};JXG.Server.loadModule=function(d){return JXG.Server.callServer("load",JXG.Server.loadModule_cb,{module:d},true)};JXG.Server.load=JXG.Server.loadModule;JXG.DataSource=function(){this.data=[];this.columnHeaders=[];this.rowHeaders=[];return this};JXG.extend(JXG.DataSource.prototype,{loadFromArray:function(h,k,g){var f,e,d;if(typeof k=="undefined"){k=false}if(typeof g=="undefined"){g=false}if(JXG.isArray(k)){this.columnHeaders=k;k=false}if(JXG.isArray(g)){this.rowHeaders=g;g=false}this.data=[];if(k){this.columnHeaders=[]}if(g){this.rowHeaders=[]}if(typeof h!="undefined"){this.data=new Array(h.length);for(f=0;f<h.length;f++){this.data[f]=new Array(h[f].length);for(e=0;e<h[f].length;e++){d=h[f][e];if(""+parseFloat(d)==d){this.data[f][e]=parseFloat(d)}else{if(d!="-"){this.data[f][e]=d}else{this.data[f][e]=NaN}}}}if(k){this.columnHeaders=this.data[0].slice(1);this.data=this.data.slice(1)}if(g){this.rowHeaders=new Array();for(f=0;f<this.data.length;f++){this.rowHeaders.push(this.data[f][0]);this.data[f]=this.data[f].slice(1)}}}return this},loadFromTable:function(m,f,k){var n,h,g,e,l,d;if(typeof f=="undefined"){f=false}if(typeof k=="undefined"){k=false}if(JXG.isArray(f)){this.columnHeaders=f;f=false}if(JXG.isArray(k)){this.rowHeaders=k;k=false}this.data=[];if(f){this.columnHeaders=[]}if(k){this.rowHeaders=[]}m=document.getElementById(m);if(typeof m!="undefined"){n=m.getElementsByTagName("tr");this.data=new Array(n.length);for(h=0;h<n.length;h++){e=n[h].getElementsByTagName("td");this.data[h]=new Array(e.length);for(g=0;g<e.length;g++){l=e[g].innerHTML;if(""+parseFloat(l)==l){this.data[h][g]=parseFloat(l)}else{if(l!="-"){this.data[h][g]=l}else{this.data[h][g]=NaN}}}}if(f){this.columnHeaders=this.data[0].slice(1);this.data=this.data.slice(1)}if(k){this.rowHeaders=new Array();for(h=0;h<this.data.length;h++){this.rowHeaders.push(this.data[h][0]);this.data[h]=this.data[h].slice(1)}}}return this},addColumn:function(d,f,e){},addRow:function(d,f,e){},getColumn:function(e){var d=new Array(this.data.length),f;if(typeof e=="string"){for(f=0;f<this.columnHeaders.length;f++){if(e==this.columnHeaders[f]){e=f;break}}}for(f=0;f<this.data.length;f++){if(this.data[f].length>e){d[f]=parseFloat(this.data[f][e])}}return d},getRow:function(f){var d,e;if(typeof f=="string"){for(e=0;e<this.rowHeaders.length;e++){if(f==this.rowHeaders[e]){f=e;break}}}d=new Array(this.data[f].length);for(e=0;e<this.data[f].length;e++){d[e]=this.data[f][e]}return d}});JXG.Board.prototype.construct=function(d,x,G,B,m){var r,C,A,s={},t,g,v,h,e,F,o,z,y,E,D,u,n,f,w,p,q;if(!JXG.exists(x)){x="normal"}else{D=[]}s.lines=[];s.circles=[];s.points=[];s.intersections=[];s.angles=[];s.macros=[];s.functions=[];s.texts=[];s.polygons=[];if(d.search(/\{/)!=-1){F=d.match(/\{/);F=F.length;y=0;for(A=0;A<F;A++){z=d.slice(y).search(/\{/);n=d.slice(z);n=n.slice(0,n.search(/\}/)+1);n=n.replace(/;/g,"?");d=d.slice(0,z)+n+d.slice(z+n.length);y=z+1}}r=d.split(";");for(C=0;C<r.length;C++){r[C]=r[C].replace(/^\s+/,"").replace(/\s+$/,"");if(r[C].search(/\{/)!=-1){r[C]=r[C].replace(/\?/g,";")}if(r[C].search(/Macro/)!=-1){this.addMacro(r[C])}else{if(r[C].length>0){f=false;if(r[C].search(/=/)!=-1){t=r[C].split("=");p=t[1];p=p.replace(/^\s+/,"").replace(/\s+$/,"");if(t[0].search(/\./)!=-1){f=true;t=t[0].split(".");w=t[t.length-1];w=w.replace(/^\s+/,"").replace(/\s+$/,"");t.pop();t=t.join(".");if(x=="macro"){for(A=0;A<G.length;A++){if(t==G[A]){t=B[A]}}}JXG.getReference(this,t).setProperty(w+":"+p)}}if(!f){if(r[C].search(/=/)!=-1){t=r[C].split("=");r[C]=t[1].replace(/^\s+/,"");t=t[0].replace(/\s+$/,"")}else{t=""}q={};u=true;while(u){if(r[C].search(/(.*)draft$/)!=-1){q.draft=true;r[C]=RegExp.$1;r[C]=r[C].replace(/\s+$/,"")}if(r[C].search(/(.*)invisible$/)!=-1){q.visible=false;r[C]=RegExp.$1;r[C]=r[C].replace(/\s+$/,"")}if(r[C].search(/(.*)nolabel$/)!=-1){q.withLabel=false;r[C]=RegExp.$1;r[C]=r[C].replace(/\s+$/,"")}if(r[C].search(/nolabel|invisible|draft/)==-1){u=false}}o=true;if(this.definedMacros){for(A=0;A<this.definedMacros.macros.length;A++){E=new RegExp("^"+this.definedMacros.macros[A][0]+"\\s*\\(");if(r[C].search(E)!=-1){o=false;r[C].match(/\((.*)\)/);F=RegExp.$1;F=F.split(",");for(z=0;z<F.length;z++){F[z].match(/\s*(\S*)\s*/);F[z]=RegExp.$1}s[t]=this.construct(this.definedMacros.macros[A][2],"macro",this.definedMacros.macros[A][1],F,t);s.macros.push(s[t]);break}}}if(o){if(r[C].search(/^[\[\]].*[\[\]]$/)!=-1){r[C].match(/([\[\]])(.*)([\[\]])/);q.straightFirst=(RegExp.$1!="[");q.straightLast=(RegExp.$3=="[");g=(RegExp.$2).replace(/^\s+/,"").replace(/\s+$/,"");if(g.search(/ /)!=-1){g.match(/(\S*) +(\S*)/);g=[];g[0]=RegExp.$1;g[1]=RegExp.$2}if(t!=""){if(!JXG.exists(q.withLabel)){q.withLabel=true}q.name=t;if(x=="macro"){D.push(t)}}if(x=="macro"){if(m!=""){for(A=0;A<D.length;A++){if(g[0]==D[A]){g[0]=m+"."+g[0]}if(g[1]==D[A]){g[1]=m+"."+g[1]}}}for(A=0;A<G.length;A++){if(g[0]==G[A]){g=[B[A],g[1]]}if(g[1]==G[A]){g=[g[0],B[A]]}}if(m!=""){q.id=m+"."+t}}if(typeof g=="string"){g=[JXG.getReference(this,g.charAt(0)),JXG.getReference(this,g.charAt(1))]}else{g=[JXG.getReference(this,g[0]),JXG.getReference(this,g[1])]}s.lines.push(this.create("line",g,q));if(t!=""){s[t]=s.lines[s.lines.length-1]}}else{if(r[C].search(/k\s*\(.*/)!=-1){r[C].match(/k\s*\(\s*(\S.*\S|\S)\s*,\s*(\S.*\S|\S)\s*\)/);g=[];g[0]=RegExp.$1;g[1]=RegExp.$2;for(A=0;A<=1;A++){if(g[A].search(/[\[\]]/)!=-1){g[A].match(/^[\[\]]\s*(\S.*\S)\s*[\[\]]$/);g[A]=RegExp.$1;if(g[A].search(/ /)!=-1){g[A].match(/(\S*) +(\S*)/);g[A]=[];g[A][0]=RegExp.$1;g[A][1]=RegExp.$2}if(x=="macro"){if(m!=""){for(z=0;z<D.length;z++){if(g[A][0]==D[z]){g[A][0]=m+"."+g[A][0]}if(g[A][1]==D[z]){g[A][1]=m+"."+g[A][1]}}}for(z=0;z<G.length;z++){if(g[A][0]==G[z]){g[A]=[B[z],g[A][1]]}if(g[A][1]==G[z]){g[A]=[g[A][0],B[z]]}}}if(typeof g[A]=="string"){g[A]=(function(j,i){return function(){return JXG.getReference(i,j.charAt(0)).Dist(JXG.getReference(i,j.charAt(1)))}})(g[A],this)}else{g[A]=(function(j,i){return function(){return JXG.getReference(i,j[0]).Dist(JXG.getReference(i,j[1]))}})(g[A],this)}}else{if(g[A].search(/[0-9\.\s]+/)!=-1){g[A]=1*g[A]}else{if(x=="macro"){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}g[A]=JXG.getReference(this,g[A])}}}if(t!=""){if(!JXG.exists(q.withLabel)){q.withLabel=true}q.name=t;if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}}s.circles.push(this.create("circle",g,q));if(t!=""){s[t]=s.circles[s.circles.length-1]}}else{if(r[C].search(/^[A-Z]+.*\(\s*[0-9\.\-]+\s*[,\|]\s*[0-9\.\-]+\s*\)/)!=-1&&r[C].search(/Macro\((.*)\)/)==-1){r[C].match(/^([A-Z]+\S*)\s*\(\s*(.*)\s*[,\|]\s*(.*)\s*\)$/);t=RegExp.$1;q.name=t;if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}s.points.push(this.create("point",[1*RegExp.$2,1*RegExp.$3],q));s[t]=s.points[s.points.length-1]}else{if(r[C].search(/^[A-Z]+.*\(.+(([,\|]\s*[0-9\.\-]+\s*){2})?/)!=-1&&r[C].search(/Macro\((.*)\)/)==-1){r[C].match(/([A-Z]+.*)\((.*)\)/);t=RegExp.$1;g=RegExp.$2;t=t.replace(/^\s+/,"").replace(/\s+$/,"");g=g.replace(/^\s+/,"").replace(/\s+$/,"");if(g.search(/[,\|]/)!=-1){g.match(/(\S*)\s*[,\|]\s*([0-9\.]+)\s*[,\|]\s*([0-9\.]+)\s*/);g=[];g[0]=RegExp.$1;g[1]=1*RegExp.$2;g[2]=1*RegExp.$3}else{v=g;g=[];g[0]=v;g[1]=0;g[2]=0}q.name=t;if(x=="macro"){if(m!=""){for(z=0;z<D.length;z++){if(g[0]==D[z]){g[0]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[0]==G[z]){g[0]=B[z]}}if(m!=""){q.id=m+"."+t}D.push(t)}s.points.push(this.create("glider",[g[1],g[2],JXG.getReference(this,g[0])],q));s[t]=s.points[s.points.length-1]}else{if(r[C].search(/&/)!=-1){r[C].match(/(.*)&(.*)/);g=[];g[0]=RegExp.$1;g[1]=RegExp.$2;g[0]=g[0].replace(/\s+$/,"");g[1]=g[1].replace(/^\s+/,"");if(x=="macro"){for(A=0;A<=1;A++){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}}g[0]=JXG.getReference(this,g[0]);g[1]=JXG.getReference(this,g[1]);if((g[0].elementClass==JXG.OBJECT_CLASS_LINE||g[0].elementClass==JXG.OBJECT_CLASS_CURVE)&&(g[1].elementClass==JXG.OBJECT_CLASS_LINE||g[1].elementClass==JXG.OBJECT_CLASS_CURVE)){if(t!=""){q.name=t;if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}}v=this.create("intersection",[g[0],g[1],0],q);s.intersections.push(v);if(t!=""){s[q.name]=v}}else{if(t!=""){q.name=t+"_1";if(x=="macro"){if(m!=""){q.id=m+"."+t+"_1"}D.push(t+"_1")}}v=this.create("intersection",[g[0],g[1],0],q);s.intersections.push(v);if(t!=""){s[q.name]=v}if(t!=""){q.name=t+"_2";if(x=="macro"){if(m!=""){q.id=m+"."+t+"_2"}D.push(t+"_2")}}v=this.create("intersection",[g[0],g[1],1],q);s.intersections.push(v);if(t!=""){s[q.name]=v}}}else{if(r[C].search(/\|[\|_]\s*\(/)!=-1){r[C].match(/\|([\|_])\s*\(\s*(\S*)\s*,\s*(\S*)\s*\)/);h=RegExp.$1;if(h=="|"){h="parallel"}else{h="normal"}g=[];g[0]=RegExp.$2;g[1]=RegExp.$3;if(x=="macro"){for(A=0;A<=1;A++){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}}if(t!=""){q.name=t;if(!JXG.exists(q.withLabel)){q.withLabel=true}if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}}s.lines.push(this.create(h,[JXG.getReference(this,g[0]),JXG.getReference(this,g[1])],q));if(t!=""){s[t]=s.lines[s.lines.length-1]}}else{if(r[C].search(/^</)!=-1){r[C].match(/<\s*\(\s*(\S*)\s*,\s*(\S*)\s*,\s*(\S*)\s*\)/);g=[];g[0]=RegExp.$1;g[1]=RegExp.$2;g[2]=RegExp.$3;if(x=="macro"){for(A=0;A<=2;A++){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}}if(t==""){s.lines.push(this.create("angle",[JXG.getReference(this,g[0]),JXG.getReference(this,g[1]),JXG.getReference(this,g[2])],q))}else{e=["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega"];h="";for(A=0;A<e.length;A++){if(t==e[A]){q.text="&"+t+";";q.name="&"+t+";";h="greek";break}else{if(A==e.length-1){q.text=t;q.name=t}}}if(!JXG.exists(q.withLabel)){q.withLabel=true}if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}s.angles.push(this.create("angle",[JXG.getReference(this,g[0]),JXG.getReference(this,g[1]),JXG.getReference(this,g[2])],q));s[t]=s.angles[s.angles.length-1]}}else{if(r[C].search(/([0-9]+)\/([0-9]+)\(\s*(\S*)\s*,\s*(\S*)\s*\)/)!=-1){g=[];g[0]=1*(RegExp.$1)/(1*(RegExp.$2));g[1]=RegExp.$3;g[2]=RegExp.$4;if(x=="macro"){for(A=1;A<=2;A++){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}}g[1]=JXG.getReference(this,RegExp.$3);g[2]=JXG.getReference(this,RegExp.$4);v=[];v[0]=(function(j,i){return function(){return(1-j[0])*j[1].coords.usrCoords[1]+j[0]*j[2].coords.usrCoords[1]}})(g,this);v[1]=(function(j,i){return function(){return(1-j[0])*j[1].coords.usrCoords[2]+j[0]*j[2].coords.usrCoords[2]}})(g,this);if(t!=""){q.name=t;if(x=="macro"){if(m!=""){q.id=m+"."+t}D.push(t)}}s.points.push(this.create("point",[v[0],v[1]],q));if(t!=""){s[t]=s.points[s.points.length-1]}}else{if(r[C].search(/(\S*)\s*:\s*(.*)/)!=-1){t=RegExp.$1;F=JXG.GeonextParser.geonext2JS(RegExp.$2,this);g=[new Function("x","var y = "+F+"; return y;")];q.name=t;s.functions.push(this.create("functiongraph",g,q));s[t]=s.functions[s.functions.length-1]}else{if(r[C].search(/#(.*)\(\s*([0-9])\s*[,|]\s*([0-9])\s*\)/)!=-1){g=[];g[0]=RegExp.$1;g[1]=1*RegExp.$2;g[2]=1*RegExp.$3;g[0]=g[0].replace(/^\s+/,"").replace(/\s+$/,"");s.texts.push(this.create("text",[g[1],g[2],g[0]],q))}else{if(r[C].search(/(\S*)\s*\[(.*)\]/)!=-1){q.name=RegExp.$1;if(!JXG.exists(q.withLabel)){q.withLabel=true}g=RegExp.$2;g=g.split(",");for(A=0;A<g.length;A++){g[A]=g[A].replace(/^\s+/,"").replace(/\s+$/,"");if(x=="macro"){if(m!=""){for(z=0;z<D.length;z++){if(g[A]==D[z]){g[A]=m+"."+D[z]}}}for(z=0;z<G.length;z++){if(g[A]==G[z]){g[A]=B[z]}}}g[A]=JXG.getReference(this,g[A])}s.polygons.push(this.create("polygon",g,q));s[q.name]=s.polygons[s.polygons.length-1]}}}}}}}}}}}}}}}}this.update();return s};JXG.Board.prototype.addMacro=function(f){var h,d,e="",g;f.match(/(.*)\{(.*)\}/);h=RegExp.$1;d=RegExp.$2;if(h.search(/=/)!=-1){h.match(/\s*(\S*)\s*=.*/);e=RegExp.$1;h=(h.split("="))[1]}h.match(/Macro\((.*)\)/);h=RegExp.$1;h=h.split(",");for(g=0;g<h.length;g++){h[g].match(/\s*(\S*)\s*/);h[g]=RegExp.$1}if(this.definedMacros==null){this.definedMacros={};this.definedMacros.macros=[]}this.definedMacros.macros.push([e,h,d]);if(e!=""){this.definedMacros.defName=this.definedMacros.macros[this.definedMacros.macros.length-1]}};JXG.SVGRenderer=function(d){var e;this.type="svg";this.svgRoot=null;this.svgNamespace="http://www.w3.org/2000/svg";this.xlinkNamespace="http://www.w3.org/1999/xlink";this.container=d;this.container.style.MozUserSelect="none";this.container.style.overflow="hidden";if(this.container.style.position===""){this.container.style.position="relative"}this.svgRoot=this.container.ownerDocument.createElementNS(this.svgNamespace,"svg");this.svgRoot.style.overflow="hidden";this.svgRoot.style.width=this.container.style.width;this.svgRoot.style.height=this.container.style.height;this.container.appendChild(this.svgRoot);this.defs=this.container.ownerDocument.createElementNS(this.svgNamespace,"defs");this.svgRoot.appendChild(this.defs);this.filter=this.container.ownerDocument.createElementNS(this.svgNamespace,"filter");this.filter.setAttributeNS(null,"id",this.container.id+"_f1");this.filter.setAttributeNS(null,"width","300%");this.filter.setAttributeNS(null,"height","300%");this.filter.setAttributeNS(null,"filterUnits","userSpaceOnUse");this.feOffset=this.container.ownerDocument.createElementNS(this.svgNamespace,"feOffset");this.feOffset.setAttributeNS(null,"result","offOut");this.feOffset.setAttributeNS(null,"in","SourceAlpha");this.feOffset.setAttributeNS(null,"dx","5");this.feOffset.setAttributeNS(null,"dy","5");this.filter.appendChild(this.feOffset);this.feGaussianBlur=this.container.ownerDocument.createElementNS(this.svgNamespace,"feGaussianBlur");this.feGaussianBlur.setAttributeNS(null,"result","blurOut");this.feGaussianBlur.setAttributeNS(null,"in","offOut");this.feGaussianBlur.setAttributeNS(null,"stdDeviation","3");this.filter.appendChild(this.feGaussianBlur);this.feBlend=this.container.ownerDocument.createElementNS(this.svgNamespace,"feBlend");this.feBlend.setAttributeNS(null,"in","SourceGraphic");this.feBlend.setAttributeNS(null,"in2","blurOut");this.feBlend.setAttributeNS(null,"mode","normal");this.filter.appendChild(this.feBlend);this.defs.appendChild(this.filter);this.layer=[];for(e=0;e<JXG.Options.layer.numlayers;e++){this.layer[e]=this.container.ownerDocument.createElementNS(this.svgNamespace,"g");this.svgRoot.appendChild(this.layer[e])}this.dashArray=["2, 2","5, 5","10, 10","20, 20","20, 10, 10, 10","20, 5, 10, 5"]};JXG.SVGRenderer.prototype=new JXG.AbstractRenderer();JXG.extend(JXG.SVGRenderer.prototype,{_createArrowHead:function(f,h){var g=f.id+"Triangle",e,d;if(JXG.exists(h)){g+=h}e=this.createPrim("marker",g);e.setAttributeNS(null,"viewBox","0 0 10 6");e.setAttributeNS(null,"refY","3");e.setAttributeNS(null,"markerUnits","userSpaceOnUse");e.setAttributeNS(null,"markerHeight","12");e.setAttributeNS(null,"markerWidth","10");e.setAttributeNS(null,"orient","auto");e.setAttributeNS(null,"stroke",f.visProp.strokecolor);e.setAttributeNS(null,"stroke-opacity",f.visProp.strokeopacity);e.setAttributeNS(null,"fill",f.visProp.strokecolor);e.setAttributeNS(null,"fill-opacity",f.visProp.strokeopacity);d=this.container.ownerDocument.createElementNS(this.svgNamespace,"path");if(h==="End"){e.setAttributeNS(null,"refX","0");d.setAttributeNS(null,"d","M 0 3 L 10 6 L 10 0 z")}else{e.setAttributeNS(null,"refX","10");d.setAttributeNS(null,"d","M 0 0 L 10 3 L 0 6 z")}e.appendChild(d);return e},_setArrowAtts:function(f,d,e){if(f){f.setAttributeNS(null,"stroke",d);f.setAttributeNS(null,"stroke-opacity",e);f.setAttributeNS(null,"fill",d);f.setAttributeNS(null,"fill-opacity",e)}},updateTicks:function(g,h,d,k,e){var j="",l,n,f,m=g.ticks.length;for(l=0;l<m;l++){n=g.ticks[l].scrCoords;if(g.ticks[l].major){if((g.board.needsFullUpdate||g.needsRegularUpdate)&&g.labels[l]&&g.labels[l].visProp.visible){this.updateText(g.labels[l])}j+="M "+(n[1]+h)+" "+(n[2]-d)+" L "+(n[1]-h)+" "+(n[2]+d)+" "}else{j+="M "+(n[1]+k)+" "+(n[2]-e)+" L "+(n[1]-k)+" "+(n[2]+e)+" "}}f=this.getElementById(g.id);if(!JXG.exists(f)){f=this.createPrim("path",g.id);this.appendChildPrim(f,g.visProp.layer);this.appendNodesToElement(g,"path")}f.setAttributeNS(null,"stroke",g.visProp.strokecolor);f.setAttributeNS(null,"stroke-opacity",g.visProp.strokeopacity);f.setAttributeNS(null,"stroke-width",g.visProp.strokewidth);this.updatePathPrim(f,j,g.board)},displayCopyright:function(f,g){var e=this.createPrim("text","licenseText"),d;e.setAttributeNS(null,"x","20px");e.setAttributeNS(null,"y",(2+g)+"px");e.setAttributeNS(null,"style","font-family:Arial,Helvetica,sans-serif; font-size:"+g+"px; fill:#356AA0;  opacity:0.3;");d=document.createTextNode(f);e.appendChild(d);this.appendChildPrim(e,0)},drawInternalText:function(d){var e=this.createPrim("text",d.id);e.setAttributeNS(null,"class","JXGtext");d.rendNodeText=document.createTextNode("");e.appendChild(d.rendNodeText);this.appendChildPrim(e,9);return e},updateInternalText:function(d){var e=d.plaintext;if(!isNaN(d.coords.scrCoords[1]+d.coords.scrCoords[2])){d.rendNode.setAttributeNS(null,"x",d.coords.scrCoords[1]+"px");d.rendNode.setAttributeNS(null,"y",(d.coords.scrCoords[2]+this.vOffsetText*0.5)+"px")}if(d.htmlStr!==e){d.rendNodeText.data=e;d.htmlStr=e}this.transformImage(d,d.transformations)},drawImage:function(d){var e=this.createPrim("image",d.id);e.setAttributeNS(null,"preserveAspectRatio","none");this.appendChildPrim(e,d.visProp.layer);d.rendNode=e;this.updateImage(d)},transformImage:function(h,f){var i=h.rendNode,e,j="",g,d=f.length;if(d>0){e=this.joinTransforms(h,f);g=[e[1][1],e[2][1],e[1][2],e[2][2],e[1][0],e[2][0]].join(",");j+=" matrix("+g+") ";i.setAttributeNS(null,"transform",j)}},updateImageURL:function(e){var d=JXG.evaluate(e.url);e.rendNode.setAttributeNS(this.xlinkNamespace,"xlink:href",d)},appendChildPrim:function(d,e){if(!JXG.exists(e)){e=0}else{if(e>=JXG.Options.layer.numlayers){e=JXG.Options.layer.numlayers-1}}this.layer[e].appendChild(d)},appendNodesToElement:function(d){d.rendNode=this.getElementById(d.id)},createPrim:function(d,f){var e=this.container.ownerDocument.createElementNS(this.svgNamespace,d);e.setAttributeNS(null,"id",this.container.id+"_"+f);e.style.position="absolute";if(d==="path"){e.setAttributeNS(null,"stroke-linecap","butt");e.setAttributeNS(null,"stroke-linejoin","round")}return e},remove:function(d){if(JXG.exists(d)&&JXG.exists(d.parentNode)){d.parentNode.removeChild(d)}},makeArrows:function(e){var d;if(e.visPropOld.firstarrow===e.visProp.firstarrow&&e.visPropOld.lastarrow===e.visProp.lastarrow){return}if(e.visProp.firstarrow){d=e.rendNodeTriangleStart;if(!JXG.exists(d)){d=this._createArrowHead(e,"End");this.defs.appendChild(d);e.rendNodeTriangleStart=d;e.rendNode.setAttributeNS(null,"marker-start","url(#"+this.container.id+"_"+e.id+"TriangleEnd)")}}else{d=e.rendNodeTriangleStart;if(JXG.exists(d)){this.remove(d)}}if(e.visProp.lastarrow){d=e.rendNodeTriangleEnd;if(!JXG.exists(d)){d=this._createArrowHead(e,"Start");this.defs.appendChild(d);e.rendNodeTriangleEnd=d;e.rendNode.setAttributeNS(null,"marker-end","url(#"+this.container.id+"_"+e.id+"TriangleStart)")}}else{d=e.rendNodeTriangleEnd;if(JXG.exists(d)){this.remove(d)}}e.visPropOld.firstarrow=e.visProp.firstarrow;e.visPropOld.lastarrow=e.visProp.lastarrow},updateEllipsePrim:function(e,d,h,g,f){e.setAttributeNS(null,"cx",d);e.setAttributeNS(null,"cy",h);e.setAttributeNS(null,"rx",g);e.setAttributeNS(null,"ry",f)},updateLinePrim:function(h,e,d,g,f){if(!isNaN(e+d+g+f)){h.setAttributeNS(null,"x1",e);h.setAttributeNS(null,"y1",d);h.setAttributeNS(null,"x2",g);h.setAttributeNS(null,"y2",f)}},updatePathPrim:function(d,e){if(e==""){e="M 0 0"}d.setAttributeNS(null,"d",e)},updatePathStringPoint:function(h,e,g){var f="",j=h.coords.scrCoords,i=e*Math.sqrt(3)*0.5,d=e*0.5;if(g==="x"){f=" M "+(j[1]-e)+" "+(j[2]-e)+" L "+(j[1]+e)+" "+(j[2]+e)+" M "+(j[1]+e)+" "+(j[2]-e)+" L "+(j[1]-e)+" "+(j[2]+e)}else{if(g==="+"){f=" M "+(j[1]-e)+" "+(j[2])+" L "+(j[1]+e)+" "+(j[2])+" M "+(j[1])+" "+(j[2]-e)+" L "+(j[1])+" "+(j[2]+e)}else{if(g==="<>"){f=" M "+(j[1]-e)+" "+(j[2])+" L "+(j[1])+" "+(j[2]+e)+" L "+(j[1]+e)+" "+(j[2])+" L "+(j[1])+" "+(j[2]-e)+" Z "}else{if(g==="^"){f=" M "+(j[1])+" "+(j[2]-e)+" L "+(j[1]-i)+" "+(j[2]+d)+" L "+(j[1]+i)+" "+(j[2]+d)+" Z "}else{if(g==="v"){f=" M "+(j[1])+" "+(j[2]+e)+" L "+(j[1]-i)+" "+(j[2]-d)+" L "+(j[1]+i)+" "+(j[2]-d)+" Z "}else{if(g===">"){f=" M "+(j[1]+e)+" "+(j[2])+" L "+(j[1]-d)+" "+(j[2]-i)+" L "+(j[1]-d)+" "+(j[2]+i)+" Z "}else{if(g==="<"){f=" M "+(j[1]-e)+" "+(j[2])+" L "+(j[1]+d)+" "+(j[2]-i)+" L "+(j[1]+d)+" "+(j[2]+i)+" Z "}}}}}}}return f},updatePathStringPrim:function(d){var f=" M ",g=" L ",e=f,n=5000,j="",h,l,m=(d.visProp.curvetype!=="plot"),k;if(d.numberPoints<=0){return""}if(m&&d.board.options.curve.RDPsmoothing){d.points=JXG.Math.Numerics.RamerDouglasPeuker(d.points,0.5)}k=Math.min(d.points.length,d.numberPoints);for(h=0;h<k;h++){l=d.points[h].scrCoords;if(isNaN(l[1])||isNaN(l[2])){e=f}else{if(l[1]>n){l[1]=n}else{if(l[1]<-n){l[1]=-n}}if(l[2]>n){l[2]=n}else{if(l[2]<-n){l[2]=-n}}j+=[e,l[1]," ",l[2]].join("");e=g}}return j},updatePolygonPrim:function(h,g){var j="",e,f,d=g.vertices.length;h.setAttributeNS(null,"stroke","none");for(f=0;f<d-1;f++){e=g.vertices[f].coords.scrCoords;j=j+e[1]+","+e[2];if(f<d-2){j+=" "}}if(j.indexOf("NaN")==-1){h.setAttributeNS(null,"points",j)}},updateRectPrim:function(g,d,i,e,f){g.setAttributeNS(null,"x",d);g.setAttributeNS(null,"y",i);g.setAttributeNS(null,"width",e);g.setAttributeNS(null,"height",f)},setPropertyPrim:function(e,d,f){if(d==="stroked"){return}e.setAttributeNS(null,d,f)},show:function(d){var e;if(d&&d.rendNode){e=d.rendNode;e.setAttributeNS(null,"display","inline");e.style.visibility="inherit"}},hide:function(d){var e;if(d&&d.rendNode){e=d.rendNode;e.setAttributeNS(null,"display","none");e.style.visibility="hidden"}},setBuffering:function(e,d){e.rendNode.setAttribute("buffered-rendering",d)},setDashStyle:function(d){var f=d.visProp.dash,e=d.rendNode;if(d.visProp.dash>0){e.setAttributeNS(null,"stroke-dasharray",this.dashArray[f-1])}else{if(e.hasAttributeNS(null,"stroke-dasharray")){e.removeAttributeNS(null,"stroke-dasharray")}}},setGradient:function(f){var n=f.rendNode,g,i,h,m,l,e,d,k,j;i=JXG.evaluate(f.visProp.fillopacity);i=(i>0)?i:0;g=JXG.evaluate(f.visProp.fillcolor);if(f.visProp.gradient==="linear"){h=this.createPrim("linearGradient",f.id+"_gradient");e="0%";d="100%";k="0%";j="0%";h.setAttributeNS(null,"x1",e);h.setAttributeNS(null,"x2",d);h.setAttributeNS(null,"y1",k);h.setAttributeNS(null,"y2",j);m=this.createPrim("stop",f.id+"_gradient1");m.setAttributeNS(null,"offset","0%");m.setAttributeNS(null,"style","stop-color:"+g+";stop-opacity:"+i);l=this.createPrim("stop",f.id+"_gradient2");l.setAttributeNS(null,"offset","100%");l.setAttributeNS(null,"style","stop-color:"+f.visProp.gradientsecondcolor+";stop-opacity:"+f.visProp.gradientsecondopacity);h.appendChild(m);h.appendChild(l);this.defs.appendChild(h);n.setAttributeNS(null,"style","fill:url(#"+this.container.id+"_"+f.id+"_gradient)");f.gradNode1=m;f.gradNode2=l}else{if(f.visProp.gradient==="radial"){h=this.createPrim("radialGradient",f.id+"_gradient");h.setAttributeNS(null,"cx","50%");h.setAttributeNS(null,"cy","50%");h.setAttributeNS(null,"r","50%");h.setAttributeNS(null,"fx",f.visProp.gradientpositionx*100+"%");h.setAttributeNS(null,"fy",f.visProp.gradientpositiony*100+"%");m=this.createPrim("stop",f.id+"_gradient1");m.setAttributeNS(null,"offset","0%");m.setAttributeNS(null,"style","stop-color:"+f.visProp.gradientsecondcolor+";stop-opacity:"+f.visProp.gradientsecondopacity);l=this.createPrim("stop",f.id+"_gradient2");l.setAttributeNS(null,"offset","100%");l.setAttributeNS(null,"style","stop-color:"+g+";stop-opacity:"+i);h.appendChild(m);h.appendChild(l);this.defs.appendChild(h);n.setAttributeNS(null,"style","fill:url(#"+this.container.id+"_"+f.id+"_gradient)");f.gradNode1=m;f.gradNode2=l}else{n.removeAttributeNS(null,"style")}}},updateGradient:function(g){var e=g.gradNode1,d=g.gradNode2,f,h;if(!JXG.exists(e)||!JXG.exists(d)){return}h=JXG.evaluate(g.visProp.fillopacity);h=(h>0)?h:0;f=JXG.evaluate(g.visProp.fillcolor);if(g.visProp.gradient==="linear"){e.setAttributeNS(null,"style","stop-color:"+f+";stop-opacity:"+h);d.setAttributeNS(null,"style","stop-color:"+g.visProp.gradientsecondcolor+";stop-opacity:"+g.visProp.gradientsecondopacity)}else{if(g.visProp.gradient==="radial"){e.setAttributeNS(null,"style","stop-color:"+g.visProp.gradientsecondcolor+";stop-opacity:"+g.visProp.gradientsecondopacity);d.setAttributeNS(null,"style","stop-color:"+f+";stop-opacity:"+h)}}},setObjectFillColor:function(e,h,j){var f,g=JXG.evaluate(h),k,l,d=JXG.evaluate(j),i;d=(d>0)?d:0;if(e.visPropOld.fillcolor===g&&e.visPropOld.fillopacity===d){return}if(g!==false){if(g.length!=9){k=g;i=d}else{l=JXG.rgba2rgbo(g);k=l[0];i=d*l[1]}f=e.rendNode;f.setAttributeNS(null,"fill",k);if(e.type===JXG.OBJECT_TYPE_IMAGE){f.setAttributeNS(null,"opacity",i)}else{f.setAttributeNS(null,"fill-opacity",i)}if(JXG.exists(e.visProp.gradient)){this.updateGradient(e)}}e.visPropOld.fillcolor=g;e.visPropOld.fillopacity=d},setObjectStrokeColor:function(e,h,i){var g=JXG.evaluate(h),k,l,d=JXG.evaluate(i),j,f;d=(d>0)?d:0;if(e.visPropOld.strokecolor===g&&e.visPropOld.strokeopacity===d){return}if(g!==false){if(g.length!=9){k=g;j=d}else{l=JXG.rgba2rgbo(g);k=l[0];j=d*l[1]}f=e.rendNode;if(e.type===JXG.OBJECT_TYPE_TEXT){if(e.visProp.display==="html"){f.style.color=k}else{f.setAttributeNS(null,"style","fill:"+k)}f.style.opacity=j}else{f.setAttributeNS(null,"stroke",k);f.setAttributeNS(null,"stroke-opacity",j)}if(e.type===JXG.OBJECT_TYPE_ARROW){this._setArrowAtts(e.rendNodeTriangle,k,j)}else{if(e.elementClass===JXG.OBJECT_CLASS_CURVE||e.elementClass===JXG.OBJECT_CLASS_LINE){if(e.visProp.firstarrow){this._setArrowAtts(e.rendNodeTriangleStart,k,j)}if(e.visProp.lastarrow){this._setArrowAtts(e.rendNodeTriangleEnd,k,j)}}}}e.visPropOld.strokecolor=g;e.visPropOld.strokeopacity=d},setObjectStrokeWidth:function(f,e){var d=JXG.evaluate(e),g;if(f.visPropOld.strokewidth===d){return}g=f.rendNode;this.setPropertyPrim(g,"stroked","true");if(JXG.exists(d)){this.setPropertyPrim(g,"stroke-width",d+"px")}f.visPropOld.strokewidth=d},setShadow:function(d){if(d.visPropOld.shadow===d.visProp.shadow){return}if(JXG.exists(d.rendNode)){if(d.visProp.shadow){d.rendNode.setAttributeNS(null,"filter","url(#"+this.container.id+"_f1)")}else{d.rendNode.removeAttributeNS(null,"filter")}}d.visPropOld.shadow=d.visProp.shadow},suspendRedraw:function(){},unsuspendRedraw:function(){},resize:function(d,e){this.svgRoot.style.width=parseFloat(d)+"px";this.svgRoot.style.height=parseFloat(e)+"px"}});JXG.VMLRenderer=function(d){this.type="vml";this.container=d;this.container.style.overflow="hidden";this.container.onselectstart=function(){return false};this.resolution=10;if(!JXG.exists(JXG.vmlStylesheet)){d.ownerDocument.namespaces.add("jxgvml","urn:schemas-microsoft-com:vml");JXG.vmlStylesheet=this.container.ownerDocument.createStyleSheet();JXG.vmlStylesheet.addRule(".jxgvml","behavior:url(#default#VML)")}try{!d.ownerDocument.namespaces.jxgvml&&d.ownerDocument.namespaces.add("jxgvml","urn:schemas-microsoft-com:vml");this.createNode=function(e){return d.ownerDocument.createElement("<jxgvml:"+e+' class="jxgvml">')}}catch(f){this.createNode=function(e){return d.ownerDocument.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="jxgvml">')}}this.dashArray=["Solid","1 1","ShortDash","Dash","LongDash","ShortDashDot","LongDashDot"]};JXG.VMLRenderer.prototype=new JXG.AbstractRenderer();JXG.extend(JXG.VMLRenderer.prototype,{_setAttr:function(g,f,i,d){try{if(document.documentMode===8){g[f]=i}else{g.setAttribute(f,i,d)}}catch(h){JXG.debug(g.id+" "+f+" "+i+"<br>\n")}},updateTicks:function(h,j,e,k,g){var f=[],l,m,n,o,d=this.resolution;m=h.ticks.length;for(l=0;l<m;l++){n=h.ticks[l].scrCoords;if(h.ticks[l].major){if((h.board.needsFullUpdate||h.needsRegularUpdate)&&h.labels[l]&&h.labels[l].visProp.visible){this.updateText(h.labels[l])}f.push(" m "+Math.round(d*(n[1]+j))+", "+Math.round(d*(n[2]-e))+" l "+Math.round(d*(n[1]-j))+", "+Math.round(d*(n[2]+e))+" ")}else{f.push(" m "+Math.round(d*(n[1]+k))+", "+Math.round(d*(n[2]-g))+" l "+Math.round(d*(n[1]-k))+", "+Math.round(d*(n[2]+g))+" ")}}if(!JXG.exists(h)){o=this.createPrim("path",h.id);this.appendChildPrim(o,h.visProp.layer);this.appendNodesToElement(h,"path")}this._setAttr(h.rendNode,"stroked","true");this._setAttr(h.rendNode,"strokecolor",h.visProp.strokecolor,1);this._setAttr(h.rendNode,"strokeweight",h.visProp.strokewidth);this._setAttr(h.rendNodeStroke,"opacity",(h.visProp.strokeopacity*100)+"%");this.updatePathPrim(h.rendNode,f,h.board)},displayCopyright:function(f,g){var e,d;e=this.createNode("textbox");e.style.position="absolute";this._setAttr(e,"id",this.container.id+"_licenseText");e.style.left=20;e.style.top=2;e.style.fontSize=g;e.style.color="#356AA0";e.style.fontFamily="Arial,Helvetica,sans-serif";this._setAttr(e,"opacity","30%");e.style.filter="alpha(opacity = 30)";d=document.createTextNode(f);e.appendChild(d);this.appendChildPrim(e,0)},drawInternalText:function(d){var e;e=this.createNode("textbox");e.style.position="absolute";if(document.documentMode===8){e.setAttribute("class","JXGtext")}else{e.setAttribute(document.all?"className":"class","JXGtext")}d.rendNodeText=document.createTextNode("");e.appendChild(d.rendNodeText);this.appendChildPrim(e,9);return e},updateInternalText:function(d){var e=d.plaintext;if(!isNaN(d.coords.scrCoords[1]+d.coords.scrCoords[2])){d.rendNode.style.left=parseInt(d.coords.scrCoords[1])+"px";d.rendNode.style.top=parseInt(d.coords.scrCoords[2]-parseInt(d.visProp.fontsize)+this.vOffsetText)+"px"}if(d.htmlStr!==e){d.rendNodeText.data=e;d.htmlStr=e}this.transformImage(d,d.transformations)},drawImage:function(d){var e;e=this.container.ownerDocument.createElement("img");e.style.position="absolute";this._setAttr(e,"id",this.container.id+"_"+d.id);this.container.appendChild(e);this.appendChildPrim(e,d.visProp.layer);e.style.filter=e.style["-ms-filter"]="progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingMethod='auto expand')";d.rendNode=e;this.updateImage(d)},transformImage:function(g,r){var j=g.rendNode,k,f=[],u,o=r.length,e,d,l,h,n,q;if(g.type===JXG.OBJECT_TYPE_TEXT){g.updateSize()}if(o>0){q=g.rendNode.style.filter.toString();if(!q.match(/DXImageTransform/)){j.style.filter=j.style["-ms-filter"]="progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingMethod='auto expand') "+q}k=this.joinTransforms(g,r);f[0]=JXG.Math.matVecMult(k,g.coords.scrCoords);f[0][1]/=f[0][0];f[0][2]/=f[0][0];f[1]=JXG.Math.matVecMult(k,[1,g.coords.scrCoords[1]+g.size[0],g.coords.scrCoords[2]]);f[1][1]/=f[1][0];f[1][2]/=f[1][0];f[2]=JXG.Math.matVecMult(k,[1,g.coords.scrCoords[1]+g.size[0],g.coords.scrCoords[2]-g.size[1]]);f[2][1]/=f[2][0];f[2][2]/=f[2][0];f[3]=JXG.Math.matVecMult(k,[1,g.coords.scrCoords[1],g.coords.scrCoords[2]-g.size[1]]);f[3][1]/=f[3][0];f[3][2]/=f[3][0];e=f[0][1];l=f[0][1];d=f[0][2];h=f[0][2];for(n=1;n<4;n++){e=Math.max(e,f[n][1]);l=Math.min(l,f[n][1]);d=Math.max(d,f[n][2]);h=Math.min(h,f[n][2])}j.style.left=parseInt(l)+"px";j.style.top=parseInt(h)+"px";j.filters.item(0).M11=k[1][1];j.filters.item(0).M12=k[1][2];j.filters.item(0).M21=k[2][1];j.filters.item(0).M22=k[2][2]}},updateImageURL:function(e){var d=JXG.evaluate(e.url);this._setAttr(e.rendNode,"src",d)},appendChildPrim:function(d,e){if(!JXG.exists(e)){e=0}d.style.zIndex=e;this.container.appendChild(d)},appendNodesToElement:function(d,e){if(e==="shape"||e==="path"||e==="polygon"){d.rendNodePath=this.getElementById(d.id+"_path")}d.rendNodeFill=this.getElementById(d.id+"_fill");d.rendNodeStroke=this.getElementById(d.id+"_stroke");d.rendNodeShadow=this.getElementById(d.id+"_shadow");d.rendNode=this.getElementById(d.id)},createPrim:function(e,j){var f,d=this.createNode("fill"),i=this.createNode("stroke"),h=this.createNode("shadow"),g;this._setAttr(d,"id",this.container.id+"_"+j+"_fill");this._setAttr(i,"id",this.container.id+"_"+j+"_stroke");this._setAttr(h,"id",this.container.id+"_"+j+"_shadow");if(e==="circle"||e==="ellipse"){f=this.createNode("oval");f.appendChild(d);f.appendChild(i);f.appendChild(h)}else{if(e==="polygon"||e==="path"||e==="shape"||e==="line"){f=this.createNode("shape");f.appendChild(d);f.appendChild(i);f.appendChild(h);g=this.createNode("path");this._setAttr(g,"id",this.container.id+"_"+j+"_path");f.appendChild(g)}else{f=this.createNode(e);f.appendChild(d);f.appendChild(i);f.appendChild(h)}}f.style.position="absolute";f.style.left="0px";f.style.top="0px";this._setAttr(f,"id",this.container.id+"_"+j);return f},remove:function(d){if(JXG.exists(d)){d.removeNode(true)}},makeArrows:function(e){var d;if(e.visPropOld.firstarrow===e.visProp.firstarrow&&e.visPropOld.lastarrow===e.visProp.lastarrow){return}if(e.visProp.firstarrow){d=e.rendNodeStroke;this._setAttr(d,"startarrow","block");this._setAttr(d,"startarrowlength","long")}else{d=e.rendNodeStroke;if(JXG.exists(d)){this._setAttr(d,"startarrow","none")}}if(e.visProp.lastarrow){d=e.rendNodeStroke;this._setAttr(d,"id",this.container.id+"_"+e.id+"stroke");this._setAttr(d,"endarrow","block");this._setAttr(d,"endarrowlength","long")}else{d=e.rendNodeStroke;if(JXG.exists(d)){this._setAttr(d,"endarrow","none")}}e.visPropOld.firstarrow=e.visProp.firstarrow;e.visPropOld.lastarrow=e.visProp.lastarrow},updateEllipsePrim:function(e,d,h,g,f){e.style.left=parseInt(d-g)+"px";e.style.top=parseInt(h-f)+"px";e.style.width=parseInt(g*2)+"px";e.style.height=parseInt(f*2)+"px"},updateLinePrim:function(k,e,d,g,f,i){var h,j=this.resolution;if(!isNaN(e+d+g+f)){h=["m ",parseInt(j*e),", ",parseInt(j*d)," l ",parseInt(j*g),", ",parseInt(j*f)];this.updatePathPrim(k,h,i)}},updatePathPrim:function(f,g,e){var d=e.canvasWidth,h=e.canvasHeight;if(g.length<=0){g=["m 0,0"]}f.style.width=d;f.style.height=h;this._setAttr(f,"coordsize",[parseInt(this.resolution*d),parseInt(this.resolution*h)].join(","));this._setAttr(f,"path",g.join(""))},updatePathStringPoint:function(e,k,h){var j=[],f=Math.round,g=e.coords.scrCoords,i=k*Math.sqrt(3)*0.5,l=k*0.5,d=this.resolution;if(h==="x"){j.push([" m ",f(d*(g[1]-k)),", ",f(d*(g[2]-k))," l ",f(d*(g[1]+k)),", ",f(d*(g[2]+k))," m ",f(d*(g[1]+k)),", ",f(d*(g[2]-k))," l ",f(d*(g[1]-k)),", ",f(d*(g[2]+k))].join(""))}else{if(h==="+"){j.push([" m ",f(d*(g[1]-k)),", ",f(d*(g[2]))," l ",f(d*(g[1]+k)),", ",f(d*(g[2]))," m ",f(d*(g[1])),", ",f(d*(g[2]-k))," l ",f(d*(g[1])),", ",f(d*(g[2]+k))].join(""))}else{if(h==="<>"){j.push([" m ",f(d*(g[1]-k)),", ",f(d*(g[2]))," l ",f(d*(g[1])),", ",f(d*(g[2]+k))," l ",f(d*(g[1]+k)),", ",f(d*(g[2]))," l ",f(d*(g[1])),", ",f(d*(g[2]-k))," x e "].join(""))}else{if(h==="^"){j.push([" m ",f(d*(g[1])),", ",f(d*(g[2]-k))," l ",f(d*(g[1]-i)),", ",f(d*(g[2]+l))," l ",f(d*(g[1]+i)),", ",f(d*(g[2]+l))," x e "].join(""))}else{if(h==="v"){j.push([" m ",f(d*(g[1])),", ",f(d*(g[2]+k))," l ",f(d*(g[1]-i)),", ",f(d*(g[2]-l))," l ",f(d*(g[1]+i)),", ",f(d*(g[2]-l))," x e "].join(""))}else{if(h===">"){j.push([" m ",f(d*(g[1]+k)),", ",f(d*(g[2]))," l ",f(d*(g[1]-l)),", ",f(d*(g[2]-i))," l ",f(d*(g[1]-l)),", ",f(d*(g[2]+i))," l ",f(d*(g[1]+k)),", ",f(d*(g[2]))].join(""))}else{if(h==="<"){j.push([" m ",f(d*(g[1]-k)),", ",f(d*(g[2]))," l ",f(d*(g[1]+l)),", ",f(d*(g[2]-i))," l ",f(d*(g[1]+l)),", ",f(d*(g[2]+i))," x e "].join(""))}}}}}}}return j},updatePathStringPrim:function(e){var l=[],k,n,d=this.resolution,j=Math.round,g=" m ",h=" l ",f=g,o=(e.visProp.curvetype!=="plot"),m=Math.min(e.numberPoints,8192);if(e.numberPoints<=0){return""}if(o&&e.board.options.curve.RDPsmoothing){e.points=JXG.Math.Numerics.RamerDouglasPeuker(e.points,1)}m=Math.min(m,e.points.length);for(k=0;k<m;k++){n=e.points[k].scrCoords;if(isNaN(n[1])||isNaN(n[2])){f=g}else{if(n[1]>20000){n[1]=20000}else{if(n[1]<-20000){n[1]=-20000}}if(n[2]>20000){n[2]=20000}else{if(n[2]<-20000){n[2]=-20000}}l.push([f,j(d*n[1]),", ",j(d*n[2])].join(""));f=h}}l.push(" e");return l},updatePolygonPrim:function(h,f){var e,d=f.vertices.length,g=this.resolution,j,k=[];this._setAttr(h,"stroked","false");j=f.vertices[0].coords.scrCoords;if(isNaN(j[1]+j[2])){return}k.push(["m ",parseInt(g*j[1]),",",parseInt(g*j[2])," l "].join(""));for(e=1;e<d-1;e++){j=f.vertices[e].coords.scrCoords;if(isNaN(j[1]+j[2])){return}k.push(parseInt(g*j[1])+","+parseInt(g*j[2]));if(e<d-2){k.push(", ")}}k.push(" x e");this.updatePathPrim(h,k,f.board)},updateRectPrim:function(g,d,i,e,f){g.style.left=parseInt(d)+"px";g.style.top=parseInt(i)+"px";if(e>=0){g.style.width=e+"px"}if(f>=0){g.style.height=f+"px"}},setPropertyPrim:function(g,f,h){var e="",d;switch(f){case"stroke":e="strokecolor";break;case"stroke-width":e="strokeweight";break;case"stroke-dasharray":e="dashstyle";break}if(e!==""){d=JXG.evaluate(h);this._setAttr(g,e,d)}},show:function(d){if(d&&d.rendNode){d.rendNode.style.visibility="inherit"}},hide:function(d){if(d&&d.rendNode){d.rendNode.style.visibility="hidden"}},setDashStyle:function(e,d){var f;if(d.dash>=0){f=e.rendNodeStroke;this._setAttr(f,"dashstyle",this.dashArray[d.dash])}},setGradient:function(e){var d=e.rendNodeFill;if(e.visProp.gradient==="linear"){this._setAttr(d,"type","gradient");this._setAttr(d,"color2",e.visProp.gradientsecondcolor);this._setAttr(d,"opacity2",e.visProp.gradientsecondopacity);this._setAttr(d,"angle",e.visProp.gradientangle)}else{if(e.visProp.gradient==="radial"){this._setAttr(d,"type","gradientradial");this._setAttr(d,"color2",e.visProp.gradientsecondcolor);this._setAttr(d,"opacity2",e.visProp.gradientsecondopacity);this._setAttr(d,"focusposition",e.visProp.gradientpositionx*100+"%,"+e.visProp.gradientpositiony*100+"%");this._setAttr(d,"focussize","0,0")}else{this._setAttr(d,"type","solid")}}},setObjectFillColor:function(e,h,i){var g=JXG.evaluate(h),k,l,d=JXG.evaluate(i),j,f=e.rendNode,m;d=(d>0)?d:0;if(e.visPropOld.fillcolor===g&&e.visPropOld.fillopacity===d){return}if(g.length!=9){k=g;j=d}else{l=JXG.rgba2rgbo(g);k=l[0];j=d*l[1]}if(k==="none"||k===false){this._setAttr(e.rendNode,"filled","false")}else{this._setAttr(e.rendNode,"filled","true");this._setAttr(e.rendNode,"fillcolor",k);if(JXG.exists(j)&&e.rendNodeFill){this._setAttr(e.rendNodeFill,"opacity",(j*100)+"%")}}if(e.type===JXG.OBJECT_TYPE_IMAGE){m=e.rendNode.style.filter.toString();if(m.match(/alpha/)){e.rendNode.style.filter=m.replace(/alpha\(opacity *= *[0-9\.]+\)/,"alpha(opacity = "+(j*100)+")")}else{e.rendNode.style.filter+=" alpha(opacity = "+(j*100)+")"}}e.visPropOld.fillcolor=g;e.visPropOld.fillopacity=d},setObjectStrokeColor:function(f,i,j){var h=JXG.evaluate(i),l,m,e=JXG.evaluate(j),k,g=f.rendNode,d;e=(e>0)?e:0;if(f.visPropOld.strokecolor===h&&f.visPropOld.strokeopacity===e){return}if(h.length!=9){l=h;k=e}else{m=JXG.rgba2rgbo(h);l=m[0];k=e*m[1]}if(f.type===JXG.OBJECT_TYPE_TEXT){k=Math.round(k*100);g.style.filter=" alpha(opacity = "+k+")";g.style.color=l}else{if(l!==false){this._setAttr(g,"stroked","true");this._setAttr(g,"strokecolor",l)}d=f.rendNodeStroke;if(JXG.exists(k)){this._setAttr(d,"opacity",(k*100)+"%")}}f.visPropOld.strokecolor=h;f.visPropOld.strokeopacity=e},setObjectStrokeWidth:function(f,e){var d=JXG.evaluate(e),g;if(f.visPropOld.strokewidth===d){return}g=f.rendNode;this.setPropertyPrim(g,"stroked","true");if(JXG.exists(d)){this.setPropertyPrim(g,"stroke-width",d)}f.visPropOld.strokewidth=d},setShadow:function(d){var e=d.rendNodeShadow;if(!e||d.visPropOld.shadow===d.visProp.shadow){return}if(d.visProp.shadow){this._setAttr(e,"On","True");this._setAttr(e,"Offset","3pt,3pt");this._setAttr(e,"Opacity","60%");this._setAttr(e,"Color","#aaaaaa")}else{this._setAttr(e,"On","False")}d.visPropOld.shadow=d.visProp.shadow},suspendRedraw:function(){this.container.style.display="none"},unsuspendRedraw:function(){this.container.style.display=""}});JXG.CanvasRenderer=function(d){var e;this.type="canvas";this.canvasRoot=null;this.suspendHandle=null;this.canvasId=JXG.Util.genUUID();this.canvasNamespace=null;this.container=d;this.container.style.MozUserSelect="none";this.container.style.overflow="hidden";if(this.container.style.position===""){this.container.style.position="relative"}this.container.innerHTML=['<canvas id="',this.canvasId,'" width="',this.container.style.width,'" height="',this.container.style.height,'"><',"/canvas>"].join("");this.canvasRoot=document.getElementById(this.canvasId);this.context=this.canvasRoot.getContext("2d");this.dashArray=[[2,2],[5,5],[10,10],[20,20],[20,10,10,10],[20,5,10,5]]};JXG.CanvasRenderer.prototype=new JXG.AbstractRenderer();JXG.extend(JXG.CanvasRenderer.prototype,{_drawFilledPolygon:function(e){var g,d=e.length,f=this.context;if(d>0){f.beginPath();f.moveTo(e[0][0],e[0][1]);for(g=0;g<d;g++){if(g>0){f.lineTo(e[g][0],e[g][1])}}f.lineTo(e[0][0],e[0][1]);f.fill()}},_fill:function(e){var d=this.context;d.save();if(this._setColor(e,"fill")){d.fill()}d.restore()},_rotatePoint:function(e,d,f){return[(d*Math.cos(e))-(f*Math.sin(e)),(d*Math.sin(e))+(f*Math.cos(e))]},_rotateShape:function(e,g){var f,h=[],d=e.length;if(d<=0){return e}for(f=0;f<d;f++){h.push(this._rotatePoint(g,e[f][0],e[f][1]))}return h},_setColor:function(i,m,d){var j=true,g=false,p=i.visProp,e,h,n,l,f,k;m=m||"stroke";d=d||m;if(!JXG.exists(i.board)||!JXG.exists(i.board.highlightedObjects)){g=true}if(!g&&JXG.exists(i.board.highlightedObjects[i.id])){e="highlight"}else{e=""}h=JXG.evaluate(p[e+m+"color"]);if(h!=="none"&&h!==false){f=JXG.evaluate(p[e+m+"opacity"]);f=(f>0)?f:0;if(h.length!=9){l=h;k=f}else{n=JXG.rgba2rgbo(h);l=n[0];k=f*n[1]}this.context.globalAlpha=k;this.context[d+"Style"]=l}else{j=false}if(m==="stroke"){this.context.lineWidth=parseFloat(p.strokewidth)}return j},_stroke:function(e){var d=this.context;d.save();if(e.visProp.dash>0){}else{this.context.lineDashArray=[]}if(this._setColor(e,"stroke")){d.stroke()}d.restore()},_translateShape:function(f,e,j){var g,h=[],d=f.length;if(d<=0){return f}for(g=0;g<d;g++){h.push([f[g][0]+e,f[g][1]+j])}return h},drawPoint:function(i){var j=i.visProp.face,h=i.visProp.size,l=i.coords.scrCoords,k=h*Math.sqrt(3)*0.5,d=h*0.5,e=parseFloat(i.visProp.strokewidth)/2,g=this.context;if(h<=0||!i.visProp.visible){return}switch(j){case"cross":case"x":g.beginPath();g.moveTo(l[1]-h,l[2]-h);g.lineTo(l[1]+h,l[2]+h);g.moveTo(l[1]+h,l[2]-h);g.lineTo(l[1]-h,l[2]+h);g.closePath();this._stroke(i);break;case"circle":case"o":g.beginPath();g.arc(l[1],l[2],h+1+e,0,2*Math.PI,false);g.closePath();this._fill(i);this._stroke(i);break;case"square":case"[]":if(h<=0){break}g.save();if(this._setColor(i,"stroke","fill")){g.fillRect(l[1]-h-e,l[2]-h-e,h*2+3*e,h*2+3*e)}g.restore();g.save();this._setColor(i,"fill");g.fillRect(l[1]-h+e,l[2]-h+e,h*2-e,h*2-e);g.restore();break;case"plus":case"+":g.beginPath();g.moveTo(l[1]-h,l[2]);g.lineTo(l[1]+h,l[2]);g.moveTo(l[1],l[2]-h);g.lineTo(l[1],l[2]+h);g.closePath();this._stroke(i);break;case"diamond":case"<>":g.beginPath();g.moveTo(l[1]-h,l[2]);g.lineTo(l[1],l[2]+h);g.lineTo(l[1]+h,l[2]);g.lineTo(l[1],l[2]-h);g.closePath();this._fill(i);this._stroke(i);break;case"triangleup":case"a":case"^":g.beginPath();g.moveTo(l[1],l[2]-h);g.lineTo(l[1]-k,l[2]+d);g.lineTo(l[1]+k,l[2]+d);g.closePath();this._fill(i);this._stroke(i);break;case"triangledown":case"v":g.beginPath();g.moveTo(l[1],l[2]+h);g.lineTo(l[1]-k,l[2]-d);g.lineTo(l[1]+k,l[2]-d);g.closePath();this._fill(i);this._stroke(i);break;case"triangleleft":case"<":g.beginPath();g.moveTo(l[1]-h,l[2]);g.lineTo(l[1]+d,l[2]-k);g.lineTo(l[1]+d,l[2]+k);g.closePath();this.fill(i);this._stroke(i);break;case"triangleright":case">":g.beginPath();g.moveTo(l[1]+h,l[2]);g.lineTo(l[1]-d,l[2]-k);g.lineTo(l[1]-d,l[2]+k);g.closePath();this._fill(i);this._stroke(i);break}},updatePoint:function(d){this.drawPoint(d)},drawLine:function(d){var f=new JXG.Coords(JXG.COORDS_BY_USER,d.point1.coords.usrCoords,d.board),e=new JXG.Coords(JXG.COORDS_BY_USER,d.point2.coords.usrCoords,d.board);JXG.Math.Geometry.calcStraight(d,f,e);this.context.beginPath();this.context.moveTo(f.scrCoords[1],f.scrCoords[2]);this.context.lineTo(e.scrCoords[1],e.scrCoords[2]);this._stroke(d);this.makeArrows(d,f,e)},updateLine:function(d){this.drawLine(d)},drawTicks:function(){},updateTicks:function(g,h,e,j,f){var k,m,l=g.ticks.length,d=this.context;d.beginPath();for(k=0;k<l;k++){m=g.ticks[k].scrCoords;if(g.ticks[k].major){if(g.labels[k]&&(g.board.needsFullUpdate||g.needsRegularUpdate||g.labels[k].visProp.display==="internal")&&g.labels[k].visProp.visible){this.updateText(g.labels[k])}d.moveTo(m[1]+h,m[2]-e);d.lineTo(m[1]-h,m[2]+e)}else{d.moveTo(m[1]+j,m[2]-f);d.lineTo(m[1]-j,m[2]+f)}}this._stroke(g)},drawCurve:function(d){this.updatePathStringPrim(d)},updateCurve:function(d){this.drawCurve(d)},drawEllipse:function(f){var e=f.midpoint.coords.scrCoords[1],d=f.midpoint.coords.scrCoords[2],n=f.board.unitX,m=f.board.unitY,t=2*f.Radius(),s=2*f.Radius(),q=t*n,l=s*m,i=e-q/2,h=d-l/2,u=(q/2)*0.5522848,r=(l/2)*0.5522848,p=i+q,o=h+l,k=i+q/2,j=h+l/2,g=this.context;if(t>0&&s>0&&!isNaN(e+d)){g.beginPath();g.moveTo(i,j);g.bezierCurveTo(i,j-r,k-u,h,k,h);g.bezierCurveTo(k+u,h,p,j-r,p,j);g.bezierCurveTo(p,j+r,k+u,o,k,o);g.bezierCurveTo(k-u,o,i,j+r,i,j);g.closePath();this._fill(f);this._stroke(f)}},updateEllipse:function(d){return this.drawEllipse(d)},displayCopyright:function(f,e){var d=this.context;d.save();d.font=e+"px Arial";d.fillStyle="#aaa";d.lineWidth=0.5;d.fillText(f,10,2+e);d.restore()},drawInternalText:function(f){var d,e=this.context;e.save();if(this._setColor(f,"stroke","fill")&&!isNaN(f.coords.scrCoords[1]+f.coords.scrCoords[2])){if(f.visProp.fontsize){if(typeof f.visProp.fontsize==="function"){d=f.visProp.fontsize();e.font=(d>0?d:0)+"px Arial"}else{e.font=(f.visProp.fontsize)+"px Arial"}}this.transformImage(f,f.transformations);e.fillText(f.plaintext,f.coords.scrCoords[1],f.coords.scrCoords[2])}e.restore();return null},updateInternalText:function(d){this.drawInternalText(d)},setObjectStrokeColor:function(e,h,i){var g=JXG.evaluate(h),k,l,d=JXG.evaluate(i),j,f;d=(d>0)?d:0;if(e.visPropOld.strokecolor===g&&e.visPropOld.strokeopacity===d){return}if(g!==false){if(g.length!=9){k=g;j=d}else{l=JXG.rgba2rgbo(g);k=l[0];j=d*l[1]}f=e.rendNode;if(e.type===JXG.OBJECT_TYPE_TEXT&&e.visProp.display==="html"){f.style.color=k;f.style.opacity=j}}e.visPropOld.strokecolor=g;e.visPropOld.strokeopacity=d},drawImage:function(d){d.rendNode=new Image();d._src="";this.updateImage(d)},updateImage:function(e){var d=this.context,f=JXG.evaluate(e.visProp.fillopacity),g=JXG.bind(function(){e.imgIsLoaded=true;if(e.size[0]<=0||e.size[1]<=0){return}d.save();d.globalAlpha=f;this.transformImage(e,e.transformations);d.drawImage(e.rendNode,e.coords.scrCoords[1],e.coords.scrCoords[2]-e.size[1],e.size[0],e.size[1]);d.restore()},this);if(this.updateImageURL(e)){e.rendNode.onload=g}else{if(e.imgIsLoaded){g()}}},transformImage:function(h,g){var e,d=g.length,f=this.context;if(d>0){e=this.joinTransforms(h,g);if(Math.abs(JXG.Math.Numerics.det(e))>=JXG.Math.eps){f.transform(e[1][1],e[2][1],e[1][2],e[2][2],e[1][0],e[2][0])}}},updateImageURL:function(e){var d;d=JXG.evaluate(e.url);if(e._src!==d){e.imgIsLoaded=false;e.rendNode.src=d;e._src=d;return true}return false},remove:function(d){if(JXG.exists(d)&&JXG.exists(d.parentNode)){d.parentNode.removeChild(d)}},makeArrows:function(h,l,j){var f=[[2,0],[-10,-4],[-10,4]],n=[[-2,0],[10,-4],[10,4]],g,m,d,k,i,e=this.context;if(h.visProp.strokecolor!=="none"&&(h.visProp.lastarrow||h.visProp.firstarrow)){if(h.elementClass===JXG.OBJECT_CLASS_LINE){g=l.scrCoords[1];m=l.scrCoords[2];d=j.scrCoords[1];k=j.scrCoords[2]}else{return}e.save();if(this._setColor(h,"stroke","fill")){i=Math.atan2(k-m,d-g);if(h.visProp.lastarrow){this._drawFilledPolygon(this._translateShape(this._rotateShape(f,i),d,k))}if(h.visProp.firstarrow){this._drawFilledPolygon(this._translateShape(this._rotateShape(n,i),g,m))}}e.restore()}},updatePathStringPrim:function(e){var g="M",h="L",f=g,n=5000,j,l,m=(e.visProp.curvetype!=="plot"),k,d=this.context;if(e.numberPoints<=0){return}if(m&&e.board.options.curve.RDPsmoothing){e.points=JXG.Math.Numerics.RamerDouglasPeuker(e.points,0.5)}k=Math.min(e.points.length,e.numberPoints);d.beginPath();for(j=0;j<k;j++){l=e.points[j].scrCoords;if(isNaN(l[1])||isNaN(l[2])){f=g}else{if(l[1]>n){l[1]=n}else{if(l[1]<-n){l[1]=-n}}if(l[2]>n){l[2]=n}else{if(l[2]<-n){l[2]=-n}}if(f==="M"){d.moveTo(l[1],l[2])}else{d.lineTo(l[1],l[2])}f=h}}this._fill(e);this._stroke(e)},updatePolygonPrim:function(j,h){var e,g,d=h.vertices.length,f=this.context;if(d<=0){return}f.beginPath();e=h.vertices[0].coords.scrCoords;f.moveTo(e[1],e[2]);for(g=1;g<d;g++){e=h.vertices[g].coords.scrCoords;f.lineTo(e[1],e[2])}f.closePath();this._fill(h)},show:function(d){if(JXG.exists(d.rendNode)){d.rendNode.style.visibility="inherit"}},hide:function(d){if(JXG.exists(d.rendNode)){d.rendNode.style.visibility="hidden"}},setGradient:function(e){var d,f;f=JXG.evaluate(e.visProp.fillopacity);f=(f>0)?f:0;d=JXG.evaluate(e.visProp.fillcolor)},setShadow:function(d){if(d.visPropOld.shadow===d.visProp.shadow){return}d.visPropOld.shadow=d.visProp.shadow},highlight:function(d){d.board.prepareUpdate();d.board.renderer.suspendRedraw(d.board);d.board.updateRenderer();d.board.renderer.unsuspendRedraw();return this},noHighlight:function(d){d.board.prepareUpdate();d.board.renderer.suspendRedraw(d.board);d.board.updateRenderer();d.board.renderer.unsuspendRedraw();return this},suspendRedraw:function(d){this.context.save();this.context.clearRect(0,0,this.canvasRoot.width,this.canvasRoot.height);if(d&&d.showCopyright){this.displayCopyright(JXG.JSXGraph.licenseText,12)}},unsuspendRedraw:function(){this.context.restore()},resize:function(d,e){this.canvasRoot.style.width=parseFloat(d)+"px";this.canvasRoot.style.height=parseFloat(e)+"px"}});
//}}}
Source: http://en.wikipedia.org/wiki/Wave

The wave equation is a partial differential equation that describes the evolution of a wave over time in a medium where the wave propagates at the same speed independent of wavelength (no dispersion), and independent of amplitude (linear media, not nonlinear).

In particular, consider the wave equation in one dimension, for example, as applied to a string. Suppose a one-dimensional wave is traveling along the x axis with velocity v and amplitude u (which generally depends on both x and t), the wave equation is

$ \huge    \frac{1}{v^2}\frac{\partial^2 u}{\partial t^2}=\frac{\partial^2 u}{\partial x^2}. \ $

The velocity v will depend on the medium through which the wave is moving.

See also: [[Derivation of the Wave Equation|/static/files/Microscopy/derivation-wave.pdf]]

<html>
<iframe src="http://docs.google.com/gview?url=/static/files/Microscopy/derivation-wave.pdf&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe>
</html>

or watch:

<<YouTubeFragment r2GIY2ZmXPY>>
Mode
in the TEM used to view diffraction patterns. In this mode the camera
uses two exposure times 'short' and 'long' and mixes the resulting
images in one image. The short exposure time is required to visualize
the central beam and prevent it from over exposure. The long exposure
time is required to visualize more pale regions.
/***
|''Name''|TiddlyFileImporter|
|''Version''|0.3.8|
|''Author''|Ben Gillies|
|''Type''|plugin|
|''Description''|Upload a TiddlyWiki file to TiddlyWeb, and import the tiddlers.|
!Usage
Upload a TiddlyWiki file to TiddlyWeb, and import the tiddlers.
!Requires
tiddlyweb
tiddlywebplugins.reflector
!Code
***/
//{{{
(function($){
if(!version.extensions.TiddlyFileImporter)
{ //# ensure that the plugin is only installed once
	version.extensions.TiddlyFileImporter = { installed: true };
}

config.macros.fileImport = {
	reflectorURI: '/reflector?csrf_token=%0',
	incorrectTypeError: 'Incorrect File Type. You must upload a TiddlyWiki',
	uploadLabel: 'Upload',
	uploadLabelPrompt: 'Import tiddlers from this TiddlyWiki',
	step1FileText: 'File:',
	step1URLText: 'URL:',
	step1PostText: 'In the next screen you will select the tiddlers to import.',
	step1Title: 'Step 1: Pick a TiddlyWiki to import',
	step1TypeChooser: 'Import From:',
	step3Html: ['<input type="hidden" name="markList" />',
		'<input type="hidden" checked="true" name="chkSync" />',
		'<input type="hidden" name="chkSave" />',
		'<input type="hidden" name="txtSaveTiddler" />'].join(),

	handler: function(place, macroName, params, wikifier, paramString) {
		var wizard = new Wizard();
		wizard.createWizard(place, 'Import a TiddlyWiki');
		this.restart(wizard);
	},

	restart: function(wizard) {
		var me = config.macros.fileImport;
		wizard.addStep(me.step1Title, ['<input type="hidden" ',
			'name="markList" />'].join(""));
		var markList = wizard.getElement('markList');
		var uploadWrapper = document.createElement('div');
		markList.parentNode.insertBefore(uploadWrapper, markList);
		uploadWrapper.setAttribute('refresh', 'macro');
		uploadWrapper.getAttribute('macroName', 'fileImport');
		var iframeName = 'reflectorImporter' + Math.random().toString();
		me.createForm(uploadWrapper, wizard, iframeName);
		$(uploadWrapper).append('<p>' + me.step1PostText + '</p>');
		wizard.setValue('serverType', 'tiddlyweb');
		wizard.setValue('adaptor', new config.adaptors.file());
		wizard.setValue('host', config.defaultCustomFields['server.host']);
		wizard.setValue('context', {});
		var iframe = $(['<iframe name="' + iframeName + '" ',
			'style="display: none" />'].join("")).appendTo(uploadWrapper);
		var onSubmit = function(ev) {
			var uploadType = $('select[name=uploadtype]', wizard.formElem).val();
			if (uploadType == "file") {
				// set an onload ready to hijack the form
				me.setOnLoad(uploadWrapper, wizard, iframe[0]);
				wizard.importType = 'file';
				wizard.formElem.submit();
			} else {
				var csrf_token = config.extensions.tiddlyspace.getCSRFToken();
				$.ajax({
					url: "%0/reflector?csrf_token=%1".format(
						config.defaultCustomFields["server.host"], csrf_token),
					type: "POST",
					dataType: "text",
					data: {
						uri: $("input", ".importFrom", wizard.formElem).val()
					},
					success: function(data, txtStatus, xhr) {
						wizard.POSTResponse = data;
						me.importTiddlers(uploadWrapper, wizard);
					},
					error: function(xhr, txtStatus, error) {
						displayMessage(["There was an error fetching the ",
							'url: ', txtStatus].join(""));
						me.restart(wizard);
					}
				});
				return false;
			}
		};
		wizard.setButtons([{
			caption: me.uploadLabel,
			tooltip: me.uploadLabelPrompt,
			onClick: onSubmit
		}]);
		$(wizard.formElem).submit(function(ev) {
			onSubmit(ev);
			ev.preventDefault();
		});
	},

	createForm: function(place, wizard, iframeName) {
		var form = wizard.formElem;
		var me = config.macros.fileImport;
		form.action = me.reflectorURI.format(
			config.extensions.tiddlyspace.getCSRFToken());
		form.enctype = 'multipart/form-data';
		form.encoding = 'multipart/form-data';
		form.method = 'POST';
		form.target = iframeName;
		onSelectChange = function(e) {
			var changeTo = $(this).val();
			if (changeTo == "file") {
				$(".importFrom").html('%0 <input type="file" name="file" />'.
					format(me.step1FileText));
			} else {
				$(".importFrom").html('%0 <input type="text" name="uri" />'.
					format(me.step1URLText));
			}
		};
		$(place).append('<span>%0</span>'.format(me.step1TypeChooser)).
			append($(['<select name="uploadtype"><option value="file" selected="selected">file',
				'<option value="uri">url</select>'].join("")).change(onSelectChange)).
			append('<div class="importFrom">%0<input type="file" name="file" /></div>'.
					format(me.step1FileText));
	},

	setOnLoad: function(place, wizard, iframe) {
		var me = config.macros.fileImport;
		var loadHandler = function() {
			me.importTiddlers.apply(this, [place, wizard, iframe]);
		};
		iframe.onload = loadHandler;
		completeReadyStateChanges = 0;
		iframe.onreadystatechange = function() {
			if (++(completeReadyStateChanges) == 5) {
				loadHandler();
			}
		};
	},

	importTiddlers: function(place, wizard, iframe) {
		var tmpStore = new TiddlyWiki();
		var POSTedWiki = "";
		if (wizard.importType == "file") {
			try {
				POSTedWiki= iframe.contentWindow
					.document.documentElement.innerHTML;
			} catch(e) {
				displayMessage(config.macros.fileImport.incorrectTypeError);
				config.macros.fileImport.restart(wizard);
				return;
			}
			// now we are done, so remove the iframe
			$(iframe).remove();
		} else {
			POSTedWiki = wizard.POSTResponse;
		}

		tmpStore.importTiddlyWiki(POSTedWiki);
		var newTiddlers = tmpStore.getTiddlers();
		var workspace = config.defaultCustomFields['server.workspace'];
		var context = {
			status: true,
			statusText: 'OK',
			httpStatus: 200,
			adaptor: wizard.getValue('adaptor'),
			tiddlers: newTiddlers
		};
		context.adaptor.store = tmpStore;
		wizard.setValue('context', context);
		wizard.setValue('workspace', workspace);
		wizard.setValue('inFileImport', true);
		config.macros.importTiddlers.onGetTiddlerList(context, wizard);
	}
};

var _onGetTiddler = config.macros.importTiddlers.onGetTiddler;
config.macros.importTiddlers.onGetTiddler = function(context, wizard) {
	if (wizard.getValue('inFileImport')) {
		var me = config.macros.importTiddlers;
		if(!context.status)
			displayMessage("Error in importTiddlers.onGetTiddler: " + context.statusText);
		var tiddler = context.tiddler;
		var fields = tiddler.fields;
		merge(fields, config.defaultCustomFields);
		fields["server.workspace"] = wizard.getValue('workspace');
		delete fields['server.permissions'];
		delete fields['server.bag'];
		fields['server.page.revision'] = 'false';
		delete fields['server.recipe'];
		fields.changecount = 1;
		store.suspendNotifications();
		store.saveTiddler(tiddler.title, tiddler.title, tiddler.text,
			tiddler.modifier, tiddler.modified, tiddler.tags, tiddler.fields,
			false, tiddler.created);
		store.resumeNotifications();
		var remainingImports = wizard.getValue("remainingImports")-1;
		wizard.setValue("remainingImports",remainingImports);
		if(remainingImports === 0) {
			if(context.isSynchronous) {
				store.notifyAll();
				refreshDisplay();
			}
			wizard.setButtons([
					{caption: me.doneLabel, tooltip: me.donePrompt, onClick: me.onClose}
				],me.statusDoneImport);
			autoSaveChanges();
		}
	} else {
		_onGetTiddler.apply(this, arguments);
	}
};

var _onCancel = config.macros.importTiddlers.onCancel;
config.macros.importTiddlers.onCancel = function(e)
{
	var wizard = new Wizard(this);
	if (!wizard.getValue('inFileImport')) {
		return _onCancel.apply(this, arguments);
	}
	var place = wizard.clear();
	config.macros.fileImport.restart(wizard);
	return false;
};

var _step3Html = config.macros.importTiddlers.step3Html;
var _onGetTiddlerList = config.macros.importTiddlers.onGetTiddlerList;
config.macros.importTiddlers.onGetTiddlerList = function(context, wizard) {
	var fileImport = config.macros.fileImport;
	var importTiddlers = config.macros.importTiddlers;
	if (wizard.getValue('inFileImport')) {
		importTiddlers.step3Html = fileImport.step3Html;
	} else {
		importTiddlers.step3Html = _step3Html;
	}
	_onGetTiddlerList.apply(this, arguments);
};
})(jQuery);
//}}}
!URL
http://www.loci.wisc.edu/software/bio-formats

!Description
!URL
http://imagescience.de/imagic/

!Description
!URL
http://www.clemex.com/

!Description
!URL
http://www.rdmag.com/News/Feeds/2010/11/manufacturing-new-imaging-technique-accurately-finds-cancer-cell/

!Description
The long, anxious wait for biopsy results could soon be over, thanks to a tissue-imaging technique developed at the University of Illinois.

The research team demonstrated the novel microscopy technique, called nonlinear interferometric vibrational imaging (NIVI), on rat breast-cancer cells and tissues. It produced easy-to-read, color-coded images of tissue, outlining clear tumor boundaries, with more than 99 percent confidence – in less than five minutes.

Led by professor and physician Stephen A. Boppart, who holds appointments in electrical and computer engineering, bioengineering and medicine, the Illinois researchers will publish their findings on the cover of the Dec. 1 issue of the journal Cancer Research.

In addition to taking a day or more for results, current diagnostic methods are subjective, based on visual interpretations of cell shape and structure. A small sample of suspect tissue is taken from a patient, and a stain is added to make certain features of the cells easier
Highest resolution but often failed. It is banned from the Titan but one has been sold anyway.
Scattering with significant loss of energy. See also [[this animation|http://www.matter.org.uk/tem/electron_atom_interaction/inelastic_scattering.htm]]

The term inelastic scattering refers to a process by which the primary electron loses a significant amount of energy. Among these processes are:

* The excitation of a plasmon (a collective oscillation of the valence electrons).
* The excitation of one or more phonons (quanta of lattice vibration) and thus heat.        
* The ejection of an inner-shell electron (in this simulation a  K-shell or 1s electron).
* The ejection of an outer shell electron (in this simulation an L-shell electron, 2s or 2p).          
* Interaction with a single electron in the valence band.

Electron trajectories in the vicinity of the specimen electrons are determined by forces of repulsion. The closer the approach, the larger is the deviation of the electron trajectory. In the case of electrostatic interactions and collisions between the beam electrons and the electrons surrounding the atomic nucleus, the deflected electrons are likely to undergo a loss of energy (i.e. shift to longer wavelength and lower velocity). The energy loss is generally on the order of 10-20 eV for thin specimens (<100 nm) where there is generally only one scattering event as the electron passes through the specimen. The beam electrons suffering such an energy loss are deflected through very small angles (~10-4 radians), thus nearly all of them pass through the objective aperture.
The proportional energy loss due to inelastic collisions corresponds to fluctuations in the accelerating voltage of the order one part in 104-105. Thus, the change in wavelength produced by a single electron scattering event is relatively insignificant. However, multiple scattering, which can occur in relatively thick specimens, can be a serious source of chromatic aberration in the image.
!URL
http://www.azcentral.com/news/articles/2011/10/21/20111021asu-electron-microscopes-sought-by-scientists.html

!Description
Grace Shih, a doctoral student in materials science and engineering at the University of Arizona, drives from Tucson to Tempe several times a month to work on a key part of her research.

She settles into a small, sturdy, soundproof building on the campus of Arizona State University at a world-class electron microscope where she studies the composition of extremely thin chemical films.

Her work could have a global impact because she is working toward increasing the efficiency of solar cells, which is necessary before solar energy can be used widely.
/***
|''Name''|TiddlySpaceConfig|
|''Version''|0.7.7|
|''Description''|TiddlySpace configuration|
|''Status''|stable|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceConfig.js|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlyWebConfig ServerSideSavingPlugin TiddlyFileImporter|
!Code
***/
//{{{
(function($) {

var tweb = config.extensions.tiddlyweb;

var recipe = config.defaultCustomFields["server.workspace"].split("recipes/")[1];
var currentSpace; // assigned later

var disabledTabs = [];

var coreBags = ["system", "tiddlyspace"];
var systemSpaces = ["plugins", "info", "images", "theme"];
systemSpaces = $.map(systemSpaces, function(item, i) {
	return "system-%0_public".format(item);
});

// hijack search macro to add custom attributes for mobile devices
var _search = config.macros.search.handler;
config.macros.search.handler = function(place, macroName, params) {
	_search.apply(this, arguments);
	$(".searchField:input", place).
		attr({ autocapitalize: "off", autocorrect: "off" });
};

// arg is either a container name or a tiddler object
// if fuzzy is truthy, space may be inferred from workspace (for new tiddlers)
// returns space object or false
var determineSpace = function(arg, fuzzy) {
	if(typeof arg == "string") { // container name
		var space = split(arg, "_", "r");
		return ["public", "private"].contains(space.type) ? space : false;
	} else if(arg) { // tiddler
		var container = determineContainer(arg, fuzzy);
		return container ? determineSpace(container.name, fuzzy) : false;
	} else {
		return false;
	}
};

// if fuzzy is truthy, container may be inferred from workspace for new tiddlers
// returns container object or false
var determineContainer = function(tiddler, fuzzy) { // TODO: expose?
	var bag = tiddler.fields["server.bag"];
	var recipe = tiddler.fields["server.recipe"]; // XXX: unused/irrelevant/redundant!?
	if(bag) {
		return { type: "bag", name: bag };
	} else if(recipe) {
		return { type: "recipe", name: recipe };
	} else if(fuzzy) { // new tiddler
		var workspace = tiddler.fields["server.workspace"];
		if(workspace) {
			var container = split(workspace, "/", "l");
			return ["bags", "recipes"].contains(container.type) ? container : false;
		} else {
			return false;
		}
	} else {
		return false;
	}
};

// hijack removeTiddlerCallback to restore tiddler from recipe cascade -- TODO: move into TiddlyWebWiki?
var sssp = config.extensions.ServerSideSavingPlugin;
var _removeTiddlerCallback = sssp.removeTiddlerCallback;
sssp.removeTiddlerCallback = function(context, userParams) {
	var title = context.tiddler.title;
	var recipe = context.tiddler.fields["server.recipe"];
	_removeTiddlerCallback.apply(this, arguments);
	if(recipe) {
		context.workspace = "recipes/" + recipe;
		var callback = function(context, userParams) {
			if(context.status) {
				var dirty = store.isDirty();
				store.saveTiddler(context.tiddler).clearChangeCount();
				store.setDirty(dirty);
			} else {
				store.notify(title, true);
			}
		};
		context.adaptor.getTiddler(title, context, null, callback);
	}
};

// splits a string once using delimiter
// mode "l" splits at the first, "r" at the last occurrence
// returns an object with members type and name
var split = function(str, sep, mode) {
	mode = mode == "r" ? "pop" : "shift"; // TODO: use +/-1 instead of "l"/"r"?
	var arr = str.split(sep);
	var type = arr.length > 1 ? arr[mode]() : null;
	return { type: type, name: arr.join(sep) };
};

var plugin = config.extensions.tiddlyspace = {
	currentSpace: determineSpace(recipe),
	coreBags: coreBags.concat(systemSpaces),

	determineSpace: determineSpace,
	isValidSpaceName: function(name) {
		return name.match(/^[a-z][0-9a-z\-]*[0-9a-z]$/) ? true : false;
	},
	getCurrentBag: function(type) {
		return "%0_%1".format(currentSpace, type);
	},
	getCurrentWorkspace: function(type) {
		return "bags/" + this.getCurrentBag(type);
	},
	// returns the URL for a space's avatar (SiteIcon) based on a server_host
	// object and an optional space name
	// optional nocors argument prevents cross-domain URLs from being generated
	getAvatar: function(host, space, nocors) {
		if(space && typeof space != "string") { // backwards compatibility -- XXX: deprecated
			space = space.name;
		}
		var subdomain = nocors ? currentSpace : space;
		host = host ? this.getHost(host, subdomain) : "";
		var bag = space ? "%0_public".format(space) : "tiddlyspace";
		return "%0/bags/%1/tiddlers/SiteIcon".format(host, bag);
	},
	// returns the URL based on a server_host object (scheme, host, port) and an
	// optional subdomain
	getHost: function(host, subdomain) {
		if(host === undefined) { // offline
			tweb.status.server_host = {}; // prevents exceptions further down the stack -- XXX: hacky workaround, breaks encapsulation
			return null;
		}
		subdomain = subdomain ? subdomain + "." : "";
		var url = "%0://%1%2".format(host.scheme, subdomain, host.host);
		var port = host.port;
		if(port && !["80", "443"].contains(port)) {
			url += ":" + port;
		}
		return url;
	},
	disableTab: function(tabTiddler) {
		if(typeof(tabTiddler) == "string") {
			disabledTabs.push(tabTiddler);
		} else {
			for(var i = 0; i < tabTiddler.length; i++) {
				plugin.disableTab(tabTiddler[i]);
			}
		}
	},
	isDisabledTab: function(tabTitle) {
		var match = new RegExp("(?:\\[\\[([^\\]]+)\\]\\])", "mg").exec(tabTitle);
		var tabIdentifier = match ? match[1] : tabTitle;
		return disabledTabs.contains(tabIdentifier);
	},
	getCSRFToken: window.getCSRFToken || null // this may not have been processed yet
};

currentSpace = plugin.currentSpace.name;

tweb.serverPrefix = tweb.host.split("/")[3] || ""; // XXX: assumes root handler
tweb.getStatus(function(status) {
	var url = plugin.getHost(status.server_host);
	tweb.status.server_host.url = url;
	config.messages.tsVersion = status.version;
});

if(window.location.protocol == "file:") {
	// enable AutoSave by default
	config.options.chkAutoSave = config.options.chkAutoSave === undefined ?
		true : config.options.chkAutoSave;
} else {
	// set global read-only mode based on membership heuristics
	var indicator = store.getTiddler("SiteTitle") || tiddler;
	readOnly = !(recipe.split("_").pop() == "private" ||
		tweb.hasPermission("write", indicator));
	// replace TiddlyWiki's ImportTiddlers due to cross-domain restrictions
	if(config.macros.fileImport) {
		$.extend(config.macros.importTiddlers, config.macros.fileImport);
	}
}

// hijack saveChanges to ensure SystemSettings is private by default
var _saveChanges = saveChanges;
saveChanges = function(onlyIfDirty, tiddlers) {
	if(tiddlers && tiddlers.length == 1 &&
			tiddlers[0] && tiddlers[0].title == "SystemSettings") {
		var fields = tiddlers[0].fields;
		delete fields["server.recipe"];
		fields["server.bag"] = plugin.getCurrentBag("private");
		fields["server.workspace"] = plugin.getCurrentWorkspace("private");
	}
	return _saveChanges.apply(this, arguments);
};

// ensure backstage is always initialized
// required to circumvent TiddlyWiki's read-only based handling
config.macros.backstageInit = {
	init: function() {
		showBackstage = true;
	}
};

// disable evaluated macro parameters for security reasons
config.evaluateMacroParameters = "none";
var _parseParams = String.prototype.parseParams;
String.prototype.parseParams = function(defaultName, defaultValue, allowEval,
		noNames, cascadeDefaults) {
	if(config.evaluateMacroParameters == "none") {
		arguments[2] = false;
	}
	return _parseParams.apply(this, arguments);
};

var _tabsMacro = config.macros.tabs.handler;
config.macros.tabs.handler = function(place, macroName, params) {
	var newParams = [params[0]]; // keep cookie name
	for(var i = 1; i < params.length; i += 3) {
		var tabTitle = params[i + 2];
		if(!plugin.isDisabledTab(tabTitle)){
			newParams = newParams.concat(params[i], params[i + 1], tabTitle);
		}
	}
	_tabsMacro.apply(this, [place, macroName, newParams]);
};

// disable ControlView for XHRs by default
$.ajaxSetup({
	beforeSend: function(xhr) {
		xhr.setRequestHeader("X-ControlView", "false");
	}
});
// TiddlyWeb adaptor currently still uses httpReq, which needs extra magic -- XXX: obsolete this!
var _httpReq = httpReq;
httpReq = function(type, url, callback, params, headers, data, contentType,
		username, password, allowCache) {
	headers = headers || {};
	headers["X-ControlView"] = "false";
	_httpReq.apply(this, arguments);
};

// register style sheet for backstage separately (important)
store.addNotification("StyleSheetBackstage", refreshStyles);

// option for default privacy setting
config.optionsDesc.chkPrivateMode = "Set your default privacy mode to private";
config.optionsSource.chkPrivateMode = "setting";
config.options.chkPrivateMode = config.options.chkPrivateMode || false;
saveSystemSetting("chkPrivateMode", true);
config.defaultCustomFields["server.workspace"] = plugin.
	getCurrentWorkspace(config.options.chkPrivateMode ? "private" : "public");

config.paramifiers.follow = {
	onstart: function(v) {
		if(!readOnly) {
			var bag = "%0_public".format(currentSpace);
			story.displayTiddler(null, v, DEFAULT_EDIT_TEMPLATE, null, null,
				"server.bag:%0 server.workspace:bags/%0".format(bag));
			story.setTiddlerTag(v, "follow", 1);
			story.focusTiddler(v, "text");
		}
	}
};

var fImport = config.macros.fileImport;
if(fImport) {
	fImport.uploadTo = "Upload to: ";
	var _createForm = config.macros.fileImport.createForm;
	config.macros.fileImport.createForm = function(place, wizard, iframeName) {
		var container = $("<div />").text(fImport.uploadTo).appendTo(place);
		var select = $('<select name="mode" />').appendTo(container)[0];
		$('<option value="private" selected>private</a>').appendTo(select);
		$('<option value="public">public</a>').appendTo(select);
		wizard.setValue("importmode", select);
		_createForm.apply(this, [place, wizard, iframeName]);
	};

	var _onGet = config.macros.importTiddlers.onGetTiddler;
	config.macros.importTiddlers.onGetTiddler = function(context, wizard) {
		var type = $(wizard.getValue("importmode")).val();
		var ws =  plugin.getCurrentWorkspace(type);
		wizard.setValue("workspace", ws);
		_onGet.apply(this, [context, wizard]);
	};
}

})(jQuery);
//}}}
!URL
http://www.microscopy-news.com/news/announcement-of-jsm-7100f-new-fe-sem---high-performance-analytical-tool-with-improved-observation-and-analysis-functions--.html

!Description
An SEM has been used widely in a large variety of research and production fields. The JSM-7100F adopts the electron optics which has been proved to be the most powerful for high magnification observation and high precision analyses including crystal orientation analysis and cathode-luminescence as well as EDS and WDS.
!URL
http://www.microscopy-news.com/news/smart-imaging-technologies-brings-web-2-0-technology-to-microscopy-with-simagis-live-cloud-software.html

<<image http://www.microscopy-news.com/img.resize.php?path=images/ebc43696e2.jpg width=350>>

!Description
Posted: October 7, 2011 -- We live in the midst of a Web 2.0 and cloud computing revolution. Today you can store documents, images and music on the cloud and access them from any web browser; you can share data instantly and collaborate in real time. Using web applications, businesses of all sizes can access the same software products that once were only available to big companies with IT departments and data-centers. From banking and accounting to word processing and number crunching – you can get a lot done online.
!URL
http://www.sciencedaily.com/releases/2010/09/100928092841.htm

!Description
Ultra-thin solar cells can absorb sunlight more efficiently than the thicker, more expensive-to-make silicon cells used today, because light behaves differently at scales around a nanometer (a billionth of a meter), say Stanford engineers. They calculate that by properly configuring the thicknesses of several thin layers of films, an organic polymer thin film could absorb as much as 10 times more energy from sunlight than was thought possible.
The contrast transfer function (CTF) of the electron microscope specifies the relative contrast of features in the image for all spatial frequency ranges and depends both on the [[spherical aberration]] and the level of focus of the objective lens.

In the image below it is visualized how the projection image can differ from the sample depending on the contrast transfer function:

[img[http://tiddly.vanwill.com/uploads/workspace/default/ContrastTransferVisualized.JPG][EmbeddedImages]]

$\large T(H)=\sin(\pi * Cs  \lambda^3 * H^4/2+\pi \delta f * \lambda H^2)$

Cs: Spherical aberration constant.
$\large \delta f$: defocus value.
$\large \lambda$:  the electron wave length

The exit wave passes through the imaging system of the microscope where it undergoes further phase change and interferes as the image wave in the imaging plane. A recorded image is NOT a direct representation of the samples crystallographic structure. For instance, high intensity might or might not indicate the presence of an atom column in that precise location. The relationship between the exit wave and the image wave is a highly nonlinear one and is a function of the aberrations of the microscope. It is described by the contrast transfer function.

[img[http://tiddly.vanwill.com/uploads/workspace/default/contrasttransfer.JPG][EmbeddedImages]]

H denotes the spatial frequency.

T(H)<0 implies “positive” constrast: atom columns appear dark (in the print, not the negative!).
T(H)>0 implies “negative” contrast: atom columns appear bright.
• T(H) = 0 implies no transfer of the respective spatial frequency at all!


Example: hypothetical crystal with four different sets of planes parallel to the viewing direction
– plane spacing: d1 > d2 > d3 > d4
– corresponding spatial frequencies: 1/d1 < 1/d2 < 1/d3 < 1/d4.
– the planes with spacing d1 appear with positive contrast
– the planes with spacing d2 appear with negative contrast
– the planes with spacing d3 do not appear at all
– it is difficult to predict the contrast of the planes with spacing d4. We can avoid these problems by introducing an objective aperture.
Space microscopy
<html>
	<div id="jxgbox" class="jxgbox" style="height:300px; width:600px;"></div>
</html>

Each colored circle represents the phase of the wave at the point touching the semicircle:

<html>
	<div id="jxgbox2" class="jxgbox2" style="height:250px; width:600px;"></div>
</html>

<script>
  var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2*Math.PI,  2*Math.PI, 2*Math.PI, -2], keepaspectratio:true, axis:false});

  var realline = board.create ('line',[[function(){return -2},function(){return 0}],[function(){return 2},function(){return 0}]], {'dash':true, 'strokeColor':'black'});
  var circlesizeslider = board.create('slider', [[0,0],[2*Math.PI,0], [0.0,Math.PI, 2*Math.PI]], {name:'Change circe size'}, {withLabel: false});
  var s = board.create('slider', [[0,-1],[2*Math.PI,-1], [0.0,0.5,Math.PI*2]], {name:''}, {withLabel: false});
 
  var p1 = board.create('point', [function(){return -circlesizeslider.Value()}, function(){return 0.0}]);
//  var p2 = board.create('point', [function(){return 1.0}, function(){return 0.0}]);
  var p2 = board.create('point', [function(){return circlesizeslider.Value()}, function(){return 0.0}]);

  var circle = board.create('semicircle', [p1, p2]);
  var glider = board.create('glider', [0,1,circle], {'name':'Drag'});
  var arrow = board.create('arrow', [[0,0],glider], {'strokeColor':'red'});
  var rightarrow = board.create('arrow', [[function(){return s.X()},0],glider], {'strokeColor':'lightGreen', 'dash':false});
  var leftarrow = board.create('arrow', [[function(){return -s.X()},0],glider], {'strokeColor':'yellow', 'dash':false});

  var board2 = JXG.JSXGraph.initBoard('jxgbox2', {boundingbox: [-3,  2, 8, 2], keepaspectratio:true, axis:false});
  board.addChild(board2);

 var cv1 = new JXG.Complex (function(){return Math.cos(leftarrow.point1.Dist(leftarrow.point2))},function(){return Math.sin(leftarrow.point1.Dist(leftarrow.point2))});
 var cv2 = new JXG.Complex (function(){return Math.cos(rightarrow.point1.Dist(rightarrow.point2))},function(){return Math.sin(rightarrow.point1.Dist(rightarrow.point2))});

  var cv3 = new JXG.Complex (cv1);
  cv3.add (cv2);
 
  var c1 = board2.create ('circle', [[function(){return -2},function(){return 0}], [-1,0]], {'strokeColor':'yellow'});
  var c2 = board2.create ('circle', [[function(){return 1},function(){return 0}], [2,0]], {'strokeColor':'red'});
  var c3 = board2.create ('circle', [[function(){return 4},function(){return 0}], [5,0]], {'strokeColor':'lightGreen'});

  var la= board2.create('arrow', [[function(){return -2},function(){return 0}],[function(){return cv1.real()-2},function(){return cv1.imaginary()}]], {'strokeColor':'yellow'});

  var ma1= board2.create('arrow', [[function(){return 1},function(){return 0}],[function(){return cv1.real()+1},function(){return cv1.imaginary()}]], {'strokeColor':'yellow'});

  var ma2= board2.create('arrow', [[function(){return 1},function(){return 0}],[function(){return cv2.real()+ma1.point2.X()},function(){return cv2.imaginary()+ma1.point2.Y()}]], {'strokeColor':'red'});

  var ma3= board2.create('arrow', [[function(){return ma1.point2.X()},function(){return ma1.point2.Y()}],[function(){return cv2.real()+ma1.point2.X()},function(){return cv2.imaginary()+ma1.point2.Y()}]], {'strokeColor':'lightGreen'});
 
  var ra= board2.create('arrow', [[function(){return 4},function(){return 0}],[function(){return cv2.real()+4},function(){return cv2.imaginary()}]], {'strokeColor':'lightGreen'});

</script>
FRAP stands for Fluorescence recovery after photobleaching
The
GIF Tridiem is Gatan’s 3rd generation of post-column energy filters. It
combines 3rd-order spectrometer aberration correction with a
multi-port, high-speed, high-resolution CCD sensor to yield a system
that defines the new state-of-the-art in the capture of highly-detailed
EELS and EFTEM data sets with maximum throughput. This new GIF,
combined with the Gatan Microscopy Suite (GMS) software, is ideally
suited for generating and working with the rich 3-dimensional data sets
demanded by today’s analytical electron microscopists, including EFTEM
and EELS STEM spectrum images, EFTEM tilt and tomography series, and
time series. GIF Tridiem makes such tri-dimensional EM readily
accessible

* Large collection semi-angle for energy-filtered
diffraction: 120 mRad, full azimuth (on TEMs with special GIF lens
modes)
* Large field-of-view for energy-filtered TEM imaging and
mapping: 20 um, diagonal (on TEMs with special GIF lens modes)
*
Excellent isochromaticity over the entire EFTEM field-of-view: max
variation no more than ±1 eV at 200 kV
* Very large searchable
field-of-view in unfiltered TEM mode: > 200 um, diagonal (on TEMs
with special GIF lens modes)
* ''Exclusive “cinema mode” readout for
smooth, high-quality real-time viewing: > 10 frames/sec''
Rich EELS
detail with each spectrum readout: > 2000 channels (e.g. capture 600
eV range at 0.3 eV/channel)
* High spectrum readout rate for STEM
spectrum imaging: > 30 spectra/sec
* Complete system specification
sheet available upon request (Gatan document
001.01010)

http://www.gatan.com/analysis/giftridem863.php
In probability theory and statistics, the variance is used as a measure of how far a set of numbers are spread out from each other. It is one of several descriptors of a probability distribution, describing how far the numbers lie from the mean (expected value). In particular, the variance is one of the moments of a distribution. In that context, it forms part of a systematic approach to distinguishing between probability distributions. While other such approaches have been developed, those based on moments are advantageous in terms of mathematical and computational simplicity.

$\Large {Var}(X) = {E}[(X - \mu)^2]$
!URL
http://arstechnica.com/science/news/2011/03/making-a-microscope-without-a-lens.ars

!Description
To create a high resolution image, you want the largest possible diameter combined with the shortest possible focal length. The result is a lens that collects light from a large cone of angles, allowing us to construct an image with more closely spaced features. Unfortunately