Upper convex hull ("inverse" Newton polygon)

164 views
Skip to first unread message

Christophe BAL

unread,
Oct 17, 2012, 3:17:20 PM10/17/12
to sage-s...@googlegroups.com
Hello,
I would like to draw a kind of "inverse" Newton polygon for points.

How can I achieve this ?

Christophe

Dima Pasechnik

unread,
Oct 18, 2012, 12:52:13 AM10/18/12
to sage-s...@googlegroups.com
I guess you need to specify more details.

Christophe BAL

unread,
Oct 18, 2012, 2:24:42 AM10/18/12
to sage-s...@googlegroups.com
Ok, there is an applet showing on example of the Newton polygon here :


Don't focus on the definition of the Newton polygon but only on the graphic.

What I need to obtain is a similar result but from the "upper" point of viex, and the "lower" one. 

Is it more clear now ? If not, I will produce one picture by hand.

Dima Pasechnik

unread,
Oct 18, 2012, 7:53:45 PM10/18/12
to sage-s...@googlegroups.com


On Thursday, 18 October 2012 14:24:45 UTC+8, projetmbc wrote:
Ok, there is an applet showing on example of the Newton polygon here :


Don't focus on the definition of the Newton polygon but only on the graphic.

well, we can't focus on graphics, we're (mostly) mathematicians, not  graphics artists :-)
Also, that applet is apparently so old (the page says it's last modified in 1998!) that it doesn't work for me.
So better provide a definition of what you need...
 

What I need to obtain is a similar result but from the "upper" point of viex, and the "lower" one. 

Is it more clear now ? If not, I will produce one picture by hand.


OK, I'm glad that I asked, as this is not what 95% of people mean by a Newton polytope/polygon (and although I even published one paper in number theory --- funnily, with Filaseta, the author of the applet, it was a while ago, and this kind of definition didn't cross my mind).
Anyhow, you need a part of the convex hull of a bunch of points in the plane, right?
Surely, Sage can do convex hulls.


Christophe BAL

unread,
Oct 22, 2012, 3:32:58 AM10/22/12
to sage-s...@googlegroups.com
Hello.

One method could be the following one where L is a list of points. We note xMin and xMax the smallest and biggest abscissa respectively.  
  1. Add two extra points (xMin , -inf) and (xMax , -inf) to the list L. We obtain the list LL.
  2. Compute the convex hull of the list of points LL.
  3. Remove the three lines with vertex (xMin , -inf)or (xMax , -inf)
  4. Draw only the remaining lines.
A good candidiate for (-inf) could simply be (yMin - 10) for example where yMin is the smallest y-coordinate.

Christophe

Volker Braun

unread,
Oct 22, 2012, 5:09:51 AM10/22/12
to sage-s...@googlegroups.com
Just compute the points and take their convex hull together with a ray in the "up" direction:

sage: R.<x> = ZZ[]
sage: p = sum( x^i for i in range(10) )

sage: points = [ (e, randint(0,10)) for e in p.exponents() ]   # replace with whatever y-coordinate you want

sage: q = Polyhedron(vertices=points, rays=[(0,1)])
sage: q
A 2-dimensional polyhedron in ZZ^2 defined as the convex hull of 4 vertices and 1 ray
(A ray in the direction (0, 1), A vertex at (0, 8), A vertex at (9, 6), A vertex at (2, 2), A vertex at (7, 3))

Christophe BAL

unread,
Oct 22, 2012, 2:54:53 PM10/22/12
to sage-s...@googlegroups.com
Tanks.

I don't like the output produced via q.plot(). Is there a way to obtain one basic line like line does ?

Christophe

Volker Braun

unread,
Oct 22, 2012, 3:06:23 PM10/22/12
to sage-s...@googlegroups.com
You can always roll your own if you don't like it. You can also try to take apart the pieces that do the plot, for example,

sage: proj = sage.geometry.polyhedron.plot.Projection(q)
sage: proj.render_outline_2d(color='red')

Harald Schilly

unread,
Oct 23, 2012, 3:37:04 AM10/23/12
to sage-s...@googlegroups.com


On Monday, October 22, 2012 11:09:51 AM UTC+2, Volker Braun wrote:
sage: q = Polyhedron(vertices=points, rays=[(0,1)])

I just opened the documentation here:
 http://www.sagemath.org/doc/reference/sage/geometry/polyhedron/constructor.html
because I wasn't sure what it is doing, and at the top the definition states:
  • linear inequalities A \vec{x} + b \geq 0, and
  • linear equations C \vec{x} + d \geq 0.
But, I think the second one is also a inequality and this is a bug, right?

H

Volker Braun

unread,
Oct 23, 2012, 6:15:11 AM10/23/12
to sage-s...@googlegroups.com
yes, should be equality.

Btw if anybody feels adventurous I have a big pile of trac tickets relating to polyhedra that are sitting there for 1+ years.

Christophe BAL

unread,
Oct 23, 2012, 8:26:14 AM10/23/12
to sage-s...@googlegroups.com
Thanks for this. 

2012/10/22 Volker Braun <vbrau...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To post to this group, send email to sage-s...@googlegroups.com.
To unsubscribe from this group, send email to sage-support...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

328.png
Reply all
Reply to author
Forward
0 new messages