Graphical Input: Difference between revisions

From Knot Atlas
Jump to navigationJump to search
No edit summary
No edit summary
Line 29: Line 29:
in = <nowiki>K = KnotInput[]</nowiki>}}
in = <nowiki>K = KnotInput[]</nowiki>}}
pops a blank window on which a knot or a link can be drawn with mouse clicks. At first pass all crossings are drawn as "new over old", but a further click on any given crossing will flip it.
pops a blank window on which a knot or a link can be drawn with mouse clicks. At first pass all crossings are drawn as "new over old", but a further click on any given crossing will flip it.
[[Image:KnotInput_Screenshot.png|thumb|center|304px|<tt>KnotInput</tt> in action.]]

A right click followed by selecting "quit" will then determine the Gauss code of the knot or link just drawn and return it to Mathematica:
A right click followed by selecting "quit" will then determine the Gauss code of the knot or link just drawn and return it to Mathematica:
{{Out|
{{Out|
Line 38: Line 38:
<!--$$Kh[K][q, t]$$-->
<!--$$Kh[K][q, t]$$-->
<!--Robot Land, no human edits to "END"-->
<!--Robot Land, no human edits to "END"-->
{{In|
{{InOut|
n = 2 |
n = 2 |
in = <nowiki>AppendTo[$Path, "C:/bin/LinKnot/"];</nowiki>}}
in = <nowiki>AppendTo[$Path, "C:/bin/LinKnot/"];</nowiki>}}

Revision as of 20:21, 31 March 2006


Thanks to our link with LinKnot, on Windows systems KnotTheory` accepts graphical knot input.

(For In[1] see Setup)

As in the section Using the LinKnot package, the first step is to add LinKnot to the Mathematica search path. This path will likely be different on your computer.

In[2]:= AppendTo[$Path, "C:/bin/LinKnot/"];
In[3]:= ?ConwayNotation
ConwayNotation[s] represents the knot or link whose Conway notation is the string s. ConwayNotation[K], where K is a knot or a link with up to 12 crossings, returns ConwayNotation[s], where s is a string containing the Conway notation of K.
In[4]:= ConwayNotation::about
The program ConwayNotation relies on code from the LinKnot package by Slavik Jablan and Ramila Sazdanovic.

Thus for example, the input line

In[5]:= K = KnotInput[]

pops a blank window on which a knot or a link can be drawn with mouse clicks. At first pass all crossings are drawn as "new over old", but a further click on any given crossing will flip it.

KnotInput in action.

A right click followed by selecting "quit" will then determine the Gauss code of the knot or link just drawn and return it to Mathematica:

Out[5]= GaussCode[{-1,-4,2,3},{-3,-5,4,6},{5,1,-6,-2}]

K is now perfectly usable within KnotTheory`:

In[2]:= AppendTo[$Path, "C:/bin/LinKnot/"];
Out[2]= {{{out}}}