# Revision history [back]

### Polyhedron.volume() ZeroDivisionError

def vol(c): S = [g * c for g in G] return Polyhedron(S).volume() vol(vector([1.1,0.1,1]))

Here, G is the list of rotation matrices in SO(3) corresponding to the octahedral symmetry group. However when I try to run this code it gives a ZeroDivisionError. Can I do anything to fix it? It seems to work for all integer vectors but fails on most random RDF vectors.

Code to generate G:

G = [
matrix( ((0, 0, -1), (-1, 0, 0), (0, 1, 0)) ),
matrix( ((-1, 0, 0), (0, 0, 1), (0, 1, 0)) ),
matrix( ((0, 1, 0), (0, 0, -1), (-1, 0, 0)) ),
matrix( ((-1, 0, 0), (0, 0, -1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (1, 0, 0), (0, 1, 0)) ),
matrix( ((1, 0, 0), (0, -1, 0), (0, 0, -1)) ),
matrix( ((0, 0, 1), (-1, 0, 0), (0, -1, 0)) ),
matrix( ((1, 0, 0), (0, 1, 0), (0, 0, 1)) ),
matrix( ((0, 1, 0), (0, 0, 1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, -1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, 1), (-1, 0, 0)) ),
matrix( ((0, 0, -1), (0, -1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (1, 0, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (-1, 0, 0), (0, 0, -1)) ),
matrix( ((0, 0, -1), (1, 0, 0), (0, -1, 0)) ),
matrix( ((-1, 0, 0), (0, -1, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, -1), (0, 1, 0)) ),
matrix( ((0, 0, 1), (0, 1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (-1, 0, 0), (0, 0, 1)) ),
matrix( ((-1, 0, 0), (0, 1, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (1, 0, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, 1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (0, -1, 0), (1, 0, 0)) ),
matrix( ((0, 0, -1), (0, 1, 0), (1, 0, 0)) )
]


### Polyhedron.volume() ZeroDivisionError

def vol(c): S = [g * c for g in G] return Polyhedron(S).volume() vol(vector([1.1,0.1,1]))

Here, G is the list of rotation matrices in SO(3) corresponding to the octahedral symmetry group. However when I try to run this code it gives a ZeroDivisionError. Can I do anything to fix it? It seems to work for all integer vectors but fails on most random RDF vectors.

Code to generate G:

G = [
matrix( ((0, 0, -1), (-1, 0, 0), (0, 1, 0)) ),
matrix( ((-1, 0, 0), (0, 0, 1), (0, 1, 0)) ),
matrix( ((0, 1, 0), (0, 0, -1), (-1, 0, 0)) ),
matrix( ((-1, 0, 0), (0, 0, -1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (1, 0, 0), (0, 1, 0)) ),
matrix( ((1, 0, 0), (0, -1, 0), (0, 0, -1)) ),
matrix( ((0, 0, 1), (-1, 0, 0), (0, -1, 0)) ),
matrix( ((1, 0, 0), (0, 1, 0), (0, 0, 1)) ),
matrix( ((0, 1, 0), (0, 0, 1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, -1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, 1), (-1, 0, 0)) ),
matrix( ((0, 0, -1), (0, -1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (1, 0, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (-1, 0, 0), (0, 0, -1)) ),
matrix( ((0, 0, -1), (1, 0, 0), (0, -1, 0)) ),
matrix( ((-1, 0, 0), (0, -1, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, -1), (0, 1, 0)) ),
matrix( ((0, 0, 1), (0, 1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (-1, 0, 0), (0, 0, 1)) ),
matrix( ((-1, 0, 0), (0, 1, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (1, 0, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, 1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (0, -1, 0), (1, 0, 0)) ),
matrix( ((0, 0, -1), (0, 1, 0), (1, 0, 0)) )
]

 3 None vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Polyhedron.volume() ZeroDivisionError

def vol(c): S = [g * c for g in G] return Polyhedron(S).volume() vol(vector([1.1,0.1,1]))

Here, G is the list of rotation matrices in SO(3) corresponding to the octahedral symmetry group. However when I try to run this code it gives a ZeroDivisionError. Can I do anything to fix it? It seems to work for all integer vectors but fails on most random RDF vectors.

Code to generate G:

G = [
matrix( ((0, 0, -1), (-1, 0, 0), (0, 1, 0)) ),
matrix( ((-1, 0, 0), (0, 0, 1), (0, 1, 0)) ),
matrix( ((0, 1, 0), (0, 0, -1), (-1, 0, 0)) ),
matrix( ((-1, 0, 0), (0, 0, -1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (1, 0, 0), (0, 1, 0)) ),
matrix( ((1, 0, 0), (0, -1, 0), (0, 0, -1)) ),
matrix( ((0, 0, 1), (-1, 0, 0), (0, -1, 0)) ),
matrix( ((1, 0, 0), (0, 1, 0), (0, 0, 1)) ),
matrix( ((0, 1, 0), (0, 0, 1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, -1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, 1), (-1, 0, 0)) ),
matrix( ((0, 0, -1), (0, -1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (1, 0, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (-1, 0, 0), (0, 0, -1)) ),
matrix( ((0, 0, -1), (1, 0, 0), (0, -1, 0)) ),
matrix( ((-1, 0, 0), (0, -1, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, -1), (0, 1, 0)) ),
matrix( ((0, 0, 1), (0, 1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (-1, 0, 0), (0, 0, 1)) ),
matrix( ((-1, 0, 0), (0, 1, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (1, 0, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, 1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (0, -1, 0), (1, 0, 0)) ),
matrix( ((0, 0, -1), (0, 1, 0), (1, 0, 0)) )
]

 4 None vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Polyhedron.volume() ZeroDivisionError

Let us consider the following function

def vol(c):
S = [g * c for g in G]
return Polyhedron(S).volume()
vol(vector([1.1,0.1,1]))vol(vector([1.1,0.1,1]))


Here, G is the list of rotation matrices in SO(3) corresponding to the octahedral symmetry group. However when I try to run this code it gives a ZeroDivisionError. Can I do anything to fix it? It seems to work for all integer vectors but fails on most random RDF vectors.

Code to generate G:

G = [
matrix( ((0, 0, -1), (-1, 0, 0), (0, 1, 0)) ),
matrix( ((-1, 0, 0), (0, 0, 1), (0, 1, 0)) ),
matrix( ((0, 1, 0), (0, 0, -1), (-1, 0, 0)) ),
matrix( ((-1, 0, 0), (0, 0, -1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (1, 0, 0), (0, 1, 0)) ),
matrix( ((1, 0, 0), (0, -1, 0), (0, 0, -1)) ),
matrix( ((0, 0, 1), (-1, 0, 0), (0, -1, 0)) ),
matrix( ((1, 0, 0), (0, 1, 0), (0, 0, 1)) ),
matrix( ((0, 1, 0), (0, 0, 1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, -1), (1, 0, 0)) ),
matrix( ((0, -1, 0), (0, 0, 1), (-1, 0, 0)) ),
matrix( ((0, 0, -1), (0, -1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (1, 0, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (-1, 0, 0), (0, 0, -1)) ),
matrix( ((0, 0, -1), (1, 0, 0), (0, -1, 0)) ),
matrix( ((-1, 0, 0), (0, -1, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, -1), (0, 1, 0)) ),
matrix( ((0, 0, 1), (0, 1, 0), (-1, 0, 0)) ),
matrix( ((0, 1, 0), (-1, 0, 0), (0, 0, 1)) ),
matrix( ((-1, 0, 0), (0, 1, 0), (0, 0, -1)) ),
matrix( ((0, -1, 0), (1, 0, 0), (0, 0, 1)) ),
matrix( ((1, 0, 0), (0, 0, 1), (0, -1, 0)) ),
matrix( ((0, 0, 1), (0, -1, 0), (1, 0, 0)) ),
matrix( ((0, 0, -1), (0, 1, 0), (1, 0, 0)) )
]