|  |  D.13.6.10 conicWithTangents Procedure from librarytropical.lib(see  tropical_lib).
 
Example: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
 |  | LIB "tropical.lib";
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];
==> -x2+(t3)*xy+(t3)*y2+(t3)*x+(t3)*y+(t3)
// conic[3] is a list containing the equations of the tangents
//          through the five points
conic[3];
==> [1]:
==>    (t6+t5-2)/(t2)*x+(2t4+t3+t)*y+(-2t9-t8-2t6-t5+2)/(t4)
==> [2]:
==>    (t6+t4-2)/(t)*x+(2t5+t3+t2)*y+(-2t9-t7-2t6-t4+2)/(t2)
==> [3]:
==>    (2t3-2)*x+(4t3)*y+(-6t3+2)
==> [4]:
==>    (t3-t)*x+(t4+t3+2t)*y+(-t5-t2-2)/(t)
==> [5]:
==>    (t3-t2)*x+(t5+t3+2t2)*y+(-t5-t2-2t)
// conic[4] is an ideal representing the tropicalisation of the conic f
conic[4];
==> [1]:
==>    2*x
==> [2]:
==>    x+y+3
==> [3]:
==>    2*y+3
==> [4]:
==>    x+3
==> [5]:
==>    y+3
==> [6]:
==>    3
// conic[5] is a list containing the tropicalisation
//          of the five tangents in conic[3]
conic[5];
==> [1]:
==>    [1]:
==>       x-2
==>    [2]:
==>       y+1
==>    [3]:
==>       -4
==> [2]:
==>    [1]:
==>       x-1
==>    [2]:
==>       y+2
==>    [3]:
==>       -2
==> [3]:
==>    [1]:
==>       x
==>    [2]:
==>       y+3
==>    [3]:
==>       0
==> [4]:
==>    [1]:
==>       x+1
==>    [2]:
==>       y+1
==>    [3]:
==>       -1
==> [5]:
==>    [1]:
==>       x+2
==>    [2]:
==>       y+2
==>    [3]:
==>       1
// conic[6] is a list containing the vertices of the tropical conic
conic[6];
==> [1]:
==>    [1]:
==>       3/2
==>    [2]:
==>       0
// conic[7] is a list containing the vertices of the five tangents
conic[7];
==> [1]:
==>    [1]:
==>       [1]:
==>          -2
==>       [2]:
==>          -5
==> [2]:
==>    [1]:
==>       [1]:
==>          -1
==>       [2]:
==>          -4
==> [3]:
==>    [1]:
==>       [1]:
==>          0
==>       [2]:
==>          -3
==> [4]:
==>    [1]:
==>       [1]:
==>          -2
==>       [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+t5+t4+5t3+2t2+2t+4)*x2+(-t5-t4-t2-t+4)*xy+(t3-t2-t+1)*y2+(t3-t2-t+1)*\
   x+(t3-t2-t+1)*y+(t3-t2-t+1)
 | 
 
 |