Skip to content

Instantly share code, notes, and snippets.

@marmakoide
Created February 12, 2020 07:27
Show Gist options
  • Save marmakoide/f7595289dddd1193b5a244b51b9dd2f6 to your computer and use it in GitHub Desktop.
Save marmakoide/f7595289dddd1193b5a244b51b9dd2f6 to your computer and use it in GitHub Desktop.
Generates the vertices of a unit hexacosichoron
import itertools
from sympy.combinatorics import Permutation
def get_hexacosichoron_vertices():
phi = (1 + 5 ** .5) / 2
U = [.5 * phi, .5, .5 / phi]
permutation_list = [P for P in itertools.permutations(range(4)) if Permutation(P).is_even]
for i in range(16):
yield [.5 if i & 2 ** j == 0 else -.5 for j in range(4)]
for i in range(4):
for x in [-1, 1]:
yield [x if i == j else 0 for j in range(4)]
for i in range(8):
A = [0] + [U[j] if i & 2 ** j == 0 else -U[j] for j in range(3)]
for P in permutation_list:
yield [A[j] for j in P]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment