CoCalc Public Filesunits2021 / groups / sessions / group-actions.ipynb
Author: Killian O'Brien
Views : 120
Description: Rotate the platonic solids, drawn slightly transparent with prominent edges and vertices to aid visualization.
Compute Environment: Ubuntu 18.04 (Stable)
In [7]:
G = Graphics() # an empty graphics object

# create an orange dodecahedron D and add it to G
# try the other platonic solid polyheda:
# tetrahedron, cube, octagon, icosahedron

D = dodecahedron(color='orange', opacity=0.85)
G += D

# add lines to G for each edge of D
for e in D.edges():
G += line3d(e,color='black',thickness=5)

# add dots to G for each vertex of D
for v in D.vertices():
G += point3d(v,size=15,color='black')

# add the face labels 1,..,12
flabel = 0
n = len(D.face_list()[0]) # number of vertices per face
for f in D.faces():
flabel += 1
c = 1/n*sum(vector(v) for v in f) # the face center
c = 1.1*c # out a bit
# comment out next line to suppress the label printing
G += text3d(str(flabel), c, color=(0,0,0))

# add the vertex labels a,b,c,...
vlabels = 'abcdefghijklmnopqrstuvwxyz'
i = 0
for v in D.vertices():
v = 1.08 * vector(v) # out a bit
# comment out next line to suppress the label printing
G += text3d(vlabels[i], v, color=(0,0,0))
i += 1

# look at G
show(G,frame=False)

In [ ]:


In [5]:
1/24*(3^8+6*3^2+17*3^4)

333
In [8]:
RR(6561/333)

19.7027027027027
In [ ]: