Ask Your Question
1

Visualizing Polyhedron with specified range

asked 2015-11-08 14:44:04 +0200

yuyu gravatar image

updated 2017-01-05 22:24:08 +0200

FrédéricC gravatar image

I am working on visualizing an unbounded polyhedron with plot command. I have a trouble with the way the default visualizer plots the polyhedron. I would like to define range of (x,y,z) domain it visualizes as well as remove big blue arrow that indicates the direction on which the polyhedron extends to because unboundedness is obvious in my application.

The code I have used is following.

dd = Polyhedron(ieqs=[[0,1,-sqrt(2),0],[0,1,sqrt(2),0],[0,0,-sqrt(2),1],[0,0,sqrt(2),1]]) dd.plot(ymax=4)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-10-09 15:48:47 +0200

jipilab gravatar image

First, to remove the arrows, one possible way is to use render_solid. The following code will not draw the rays (which are by default drawn as arrows).

sage: QF.<a> = QuadraticField(2)
sage: dd = Polyhedron(ieqs=[[0,1,-a,0],[0,1,a,0],[0,0,-a,1],[0,0,a,1]])
sage: dd.render_solid()

Second, to get a bigger picture, there is a work around by multiplying the rays by a certain scalar.

sage: dd2 = Polyhedron(rays = [100*r.vector() for r in dd.rays()])
sage: dd2.render_solid()

This is not as clean as specifying the ranges on each axis, but is a start.

Currently, to plot the polyhedron object, it uses the data of the polyhedron and it is not (yet) possible to set a certain range for the axis.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-11-08 14:44:04 +0200

Seen: 396 times

Last updated: Oct 09 '17