INNER CODE UNIT · Python
norm
TheOpenSpaceProgram/osp-magnum · scripts/icosahedron_tables.py:47
def norm(a):
m = mag(a)
return (a[0]/m, a[1]/m, a[2]/m)
def distance(a, b):
return mag((b[0]-a[0], b[1]-a[1], b[2]-a[2]))
# -----------------------------------------------------------------------------
# Create an Icosahedron. Blender style, so there's a vertex directly on
# top and directly on the bottom. Basicly, a sandwich of two pentagons,
# rotated 180 apart from each other, and each 1/sqrt(5) above and below
# the origin.
#
# Icosahedron indices viewed from above (Z)
#
# 5
# 4