Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ring pb with Polyhedron

Hi

why is an error generated if I comment the line:

#lNew=[[0, 0, 0], [0, -1, 0], [1, -1, 0], [0, -1, 1]]

in the code below:

var('t_x',latex_name=r"\\teta_{x}")

Adic={0: [0, 0, 0], 1: [1, 0, 0], 2: [1, 1, 0], 3: [0, 1, 0] , 
          4: [0, 0, 1], 5: [1, 0, 1], 6: [1, 1, 1], 7: [0, 1, 1]}

tetraHedron=[0, 4, 5, 7]
tetraHedronDic={}
for vertice in tetraHedron :
    tetraHedronDic[vertice]=Adic.get(vertice)

angleRot=pi/2
rotX=matrix(SR,[[1,0,0],[0,cos(t_x),-sin(t_x)],[0,sin(t_x),cos(t_x)]])
newDic={}
for k in tetraHedronDic.keys() :
    newDic[k]=list((rotX.subs(t_x=angleRot)*vector(tetraHedronDic.get(k))))

pOld=Polyhedron([tetraHedronDic.get(k) for k in tetraHedronDic.keys() ])
print('pOld vertices: ',pOld.integral_points())

lNew=[newDic.get(k) for k in newDic.keys() ]
print('lNew : ',lNew)
#lNew=[[0, 0, 0], [0, -1, 0], [1, -1, 0], [0, -1, 1]]
print('lNew : ',lNew)
pNew=Polyhedron(lNew)
print('pNew vertices : ',pNew.integral_points())
click to hide/show revision 2
retagged

ring pb with Polyhedron

Hi

why is an error generated if I comment the line:

#lNew=[[0, 0, 0], [0, -1, 0], [1, -1, 0], [0, -1, 1]]

in the code below:

var('t_x',latex_name=r"\\teta_{x}")

Adic={0: [0, 0, 0], 1: [1, 0, 0], 2: [1, 1, 0], 3: [0, 1, 0] , 
          4: [0, 0, 1], 5: [1, 0, 1], 6: [1, 1, 1], 7: [0, 1, 1]}

tetraHedron=[0, 4, 5, 7]
tetraHedronDic={}
for vertice in tetraHedron :
    tetraHedronDic[vertice]=Adic.get(vertice)

angleRot=pi/2
rotX=matrix(SR,[[1,0,0],[0,cos(t_x),-sin(t_x)],[0,sin(t_x),cos(t_x)]])
newDic={}
for k in tetraHedronDic.keys() :
    newDic[k]=list((rotX.subs(t_x=angleRot)*vector(tetraHedronDic.get(k))))

pOld=Polyhedron([tetraHedronDic.get(k) for k in tetraHedronDic.keys() ])
print('pOld vertices: ',pOld.integral_points())

lNew=[newDic.get(k) for k in newDic.keys() ]
print('lNew : ',lNew)
#lNew=[[0, 0, 0], [0, -1, 0], [1, -1, 0], [0, -1, 1]]
print('lNew : ',lNew)
pNew=Polyhedron(lNew)
print('pNew vertices : ',pNew.integral_points())