4
$\begingroup$

I’m learning Mathematica and I need the coordinates of the Icosahedron vertices. This is my attempt at writing a program for it. The vertex coordinates are simply all cyclic permutations and sign-flips of {GoldenRatio, 1, 0}. My program is almost as long as writing the vertices down by hand, however. Can this be done in a more compact way in Mathematica?

signs = Flatten[Table[{i,j,k},{i,{-1,1}},{j,{-1,1}},{k,{-1,1}} ],2]
vertices = Table[RotateRight[{GoldenRatio, 1, 0}, i]\[Times]signs[[j]],{i, 3},{j, 8}]
$\endgroup$
0
10
$\begingroup$

You can use the built-in functionality

PolyhedronData["Icosahedron", "VertexCoordinates"]
{{0, 0, -(5/Sqrt[50 - 10 Sqrt[5]])}, ... }

or this short generator

{0,##2}~RotateLeft~#&@@@Tuples@{{1,2,3},s={-1,1},s(1+√5)/2}

ConvexHullMesh[%]

enter image description here

$\endgroup$
6
$\begingroup$

You can try this:

V = Table[RotateRight[{0, (-1)^j, (-1)^Floor[j/2] GoldenRatio}, Floor[(j - 1)/4]], {j, 12}];

You can plot it using ConvexHullMesh:

ConvexHullMesh[V]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.