Embed presentation
Download to read offline
![jsMath
CM 1.0 Geometry3 MrG 2011.0914
v=[(randrange(-5,5),randrange(-5,5),randrange(-5,5)) for x in
range(10)] p=polygon3d(v,color='green',alpha=0.5)
w=[(randrange(-5,5),randrange(-5,5),randrange(-5,5)) for x in
range(10)] q=polygon3d(w,color='red',alpha=0.5)
(p+q).show(viewer='tachyon')
g=dodecahedron(color='green',opacity=0.2)+sphere((0,0,0),0.5,col
or='red') g.show(viewer='tachyon')](https://image.slidesharecdn.com/cm1-0geometry3mrg2011-0914-sage-110917191535-phpapp01/75/CM-1-0-geometry3-MrG-2011-0914-sage-1-2048.jpg)


This document contains code to generate and display 3D geometric shapes using JavaScript. It first creates two random 3D polygons with 10 points each in green and red colors with 50% opacity. It then sums these polygons and displays them. It next generates a semi-transparent green dodecahedron plus a red sphere at the origin and displays them.
![jsMath
CM 1.0 Geometry3 MrG 2011.0914
v=[(randrange(-5,5),randrange(-5,5),randrange(-5,5)) for x in
range(10)] p=polygon3d(v,color='green',alpha=0.5)
w=[(randrange(-5,5),randrange(-5,5),randrange(-5,5)) for x in
range(10)] q=polygon3d(w,color='red',alpha=0.5)
(p+q).show(viewer='tachyon')
g=dodecahedron(color='green',opacity=0.2)+sphere((0,0,0),0.5,col
or='red') g.show(viewer='tachyon')](https://image.slidesharecdn.com/cm1-0geometry3mrg2011-0914-sage-110917191535-phpapp01/75/CM-1-0-geometry3-MrG-2011-0914-sage-1-2048.jpg)
