|
D.13.6.11 conicWithTangents
Procedure from library tropical.lib (see tropical_lib).
- Usage:
- conicWithTangents(points[,#]); points list, # optional list
- Assume:
- points is a list of five points in the plane over K(t)
- Return:
- list, l[1] = the list points of the five given points
l[2] = the conic f passing through the five points
l[3] = list of equations of tangents to f in the given points
l[4] = ideal, tropicalisation of f (i.e. list of linear forms)
l[5] = a list of the tropicalisation of the tangents
l[6] = a list containing the vertices of the tropical conic f
l[7] = a list containing lists with vertices of the tangents
l[8] = a string which contains the latex-code to draw the
tropical conic and its tropicalised tangents
l[9] = if # is non-empty, this is the same data for the dual
conic and the points dual to the computed tangents
- Note:
- the points must be generic, i.e. no three on a line
Example:
| LIB "tropical.lib";
==> Welcome to polymake version
==> Copyright (c) 1997-2015
==> Ewgenij Gawrilow, Michael Joswig (TU Darmstadt)
==> http://www.polymake.org
ring r=(0,t),(x,y),dp;
// the input consists of a list of five points in the plane over Q(t)
list points=list(1/t2,t),list(1/t,t2),list(1,1),list(t,1/t2),list(t2,1/t);
list conic=conicWithTangents(points);
// conic[1] is the list of the given five points
conic[1];
==> [1]:
==> [1]:
==> 1/(t2)
==> [2]:
==> (t)
==> [2]:
==> [1]:
==> 1/(t)
==> [2]:
==> (t2)
==> [3]:
==> [1]:
==> 1
==> [2]:
==> 1
==> [4]:
==> [1]:
==> (t)
==> [2]:
==> 1/(t2)
==> [5]:
==> [1]:
==> (t2)
==> [2]:
==> 1/(t)
// conic[2] is the equation of the conic f passing through the five points
conic[2];
==> (2t3)*x2+(-t6+t5+2t4+t3+2t2+t-1)*xy+(2t3)*y2+(-t5-2t4-3t3-2t2-t)*x+(-t5-2\
t4-3t3-2t2-t)*y+(t6+t5+2t4+t3+2t2+t+1)
// conic[3] is a list containing the equations of the tangents
// through the five points
conic[3];
==> [1]:
==> (-t7+t6+t5-t4-t3-t2+2t)*x+(-t7+t6-2t5+2t2+t-1)/(t2)*y+(t7+t5-t4+t3-t2-\
1)/(t)
==> [2]:
==> (-t8+t7+2t6-2t3+t2-t)*x+(2t6-t5-t4-t3+t2+t-1)/(t)*y+(-t7-t5+t4-t3+t2+1\
)
==> [3]:
==> (-t6+2t3-1)*x+(-t6+2t3-1)*y+(2t6-4t3+2)
==> [4]:
==> (-t7+t6-2t5+2t2+t-1)/(t2)*x+(-t7+t6+t5-t4-t3-t2+2t)*y+(t7+t5-t4+t3-t2-\
1)/(t)
==> [5]:
==> (2t6-t5-t4-t3+t2+t-1)/(t)*x+(-t8+t7+2t6-2t3+t2-t)*y+(-t7-t5+t4-t3+t2+1\
)
// conic[4] is an ideal representing the tropicalisation of the conic f
conic[4];
==> [1]:
==> 2*x+3
==> [2]:
==> x+y
==> [3]:
==> 2*y+3
==> [4]:
==> x+1
==> [5]:
==> y+1
==> [6]:
==> 0
// conic[5] is a list containing the tropicalisation
// of the five tangents in conic[3]
conic[5];
==> [1]:
==> [1]:
==> x+1
==> [2]:
==> y-2
==> [3]:
==> -1
==> [2]:
==> [1]:
==> x+1
==> [2]:
==> y-1
==> [3]:
==> 0
==> [3]:
==> [1]:
==> x
==> [2]:
==> y
==> [3]:
==> 0
==> [4]:
==> [1]:
==> x-2
==> [2]:
==> y+1
==> [3]:
==> -1
==> [5]:
==> [1]:
==> x-1
==> [2]:
==> y+1
==> [3]:
==> 0
// conic[6] is a list containing the vertices of the tropical conic
conic[6];
==> [1]:
==> [1]:
==> -2
==> [2]:
==> 1
==> [2]:
==> [1]:
==> 1
==> [2]:
==> -2
==> [3]:
==> [1]:
==> -1
==> [2]:
==> 1
==> [4]:
==> [1]:
==> 1
==> [2]:
==> -1
// conic[7] is a list containing the vertices of the five tangents
conic[7];
==> [1]:
==> [1]:
==> [1]:
==> -2
==> [2]:
==> 1
==> [2]:
==> [1]:
==> [1]:
==> -1
==> [2]:
==> 1
==> [3]:
==> [1]:
==> [1]:
==> 0
==> [2]:
==> 0
==> [4]:
==> [1]:
==> [1]:
==> 1
==> [2]:
==> -2
==> [5]:
==> [1]:
==> [1]:
==> 1
==> [2]:
==> -1
// conic[8] contains the latex code to draw the tropical conic and
// its tropicalised tangents; it can written in a file, processed and
// displayed via xdg-open
write(":w /tmp/conic.tex",conic[8]);
system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o;
xdg-open conic.ps &");
==> This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded\
format=latex)
==> restricted \write18 enabled.
==> entering extended mode
==> (/tmp/conic.tex
==> LaTeX2e <2017/01/01> patch level 3
==> Babel <3.10> and hyphenation patterns for 3 language(s) loaded.
==> (/usr/share/texmf-dist/tex/latex/amscls/amsart.cls
==> Document Class: amsart 2015/03/04 v2.20.2
==> (/usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty
==> For additional information on amsmath, use the `?' option.
==> (/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
==> (/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
==> (/usr/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
==> (/usr/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
==> (/usr/share/texmf-dist/tex/latex/amsfonts/umsa.fd)
==> (/usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
==>
==> ! LaTeX Error: File `texdraw.sty' not found.
==>
==> Type X to quit or <RETURN> to proceed,
==> or enter new name. (Default extension: sty)
==>
==> Enter file name: warning: kpathsea: $.sty: Unrecognized variable construc\
t `$.'.
==>
==> ! LaTeX Error: File `$.sty' not found.
==>
==> Type X to quit or <RETURN> to proceed,
==> or enter new name. (Default extension: sty)
==>
==> Enter file name:
==> ! Emergency stop.
==> <read *>
==>
==> l.3 \begin
==> {document}^^M
==> No pages of output.
==> Transcript written on conic.log.
==> This is dvips(k) 5.997 Copyright 2017 Radical Eye Software (www.radicaley\
e.com)
==> dvips: DVI file can't be opened: /tmp/conic.dvi: No such file or director\
y
==> 0
// with an optional argument the same information for the dual conic is computed
// and saved in conic[9]
conic=conicWithTangents(points,1);
==> sh: Zeile 1: xdg-open: Kommando nicht gefunden.
conic[9][2]; // the equation of the dual conic
==> (t6-6t5+11t4-6t3+t2)*x2+(-4t8+8t7-2t6-4t5+6t4-4t3-2t2+8t-4)*xy+(t6-6t5+11\
t4-6t3+t2)*y2+(-2t7+2t6+4t5-6t4+4t3+2t2-2t)*x+(-2t7+2t6+4t5-6t4+4t3+2t2-2\
t)*y+(t8-4t7+2t6+8t5-13t4+8t3+2t2-4t+1)
|
|