Thursday, June 12, 2014

Cluster Coordinates

My PhD research is on clusters of tiny little spheres. I often need to compute things for the spheres in specific configurations. I usually just figure out the coordinates each time. BUT, now I'm posting the most common configurations here, so that I can just look them up here. In python array format. The sphere diameter is assumed to be 1, and the center of each cluster is at the origin.

import numpy as np

single_coords = np.array(
       [0,0,0])

dimer_coords = np.array([
       [-.5,0,0],
       [.5,0,0]])

line_coords = np.array([
       [-1.,0,0],
       [0,0,0],
       [1.,0,0]])

tri_coords = np.array([
       [sqrt(3)/6.,-.5,0],
       [sqrt(3)/6., .5,0],
       [-sqrt(3)/3.,0,0]])

dia_coords = np.array([
       [0,-.5,0],
       [0,.5,0],
       [sqrt(3)/2.,0,0],
       [-sqrt(3)/2.,0,0]])

sq_coords = np.array([
       [-.5,.5,0],
       [-.5,-.5,0],
       [.5,.5,0],
       [.5,-.5,0]])

tetra_coords = np.array([
       [.5/sqrt(3),-.5,-(1/4.0)*sqrt(2/3.0)],
       [.5/sqrt(3),.5,-(1/4.0)*sqrt(2/3.0)],
       [-1/sqrt(3),0,-(1/4.0)*sqrt(2/3.0)],
       [ 0,0,(3/4.0)*sqrt(2/3.0)]])

trap_coords = np.array([
       [-1,sqrt(3)/5.,0],
       [0,sqrt(3)/5.,0],
       [1,sqrt(3)/5.,0],
       [-.5,-3*sqrt(3)/10.,0],
       [.5,-3*sqrt(3)/10.,0]])

bipyramid_coords = np.array([
       [.5/sqrt(3),-.5,0],
       [.5/sqrt(3),.5,0],
       [-1/sqrt(3),0,0],
       [0,0,sqrt(2/3.)],
       [0,0,-sqrt(2/3.)]])

oct_coords = np.array([[ 0.,  0.,  1./sqrt(2)],
       [ 0.,  1./sqrt(2),  0.],
       [ 1./sqrt(2),  0.,  0.],
       [ 0.,  -1./sqrt(2),  0.],
       [ -1./sqrt(2),  0.,  0.],
       [ 0.,  0.,  -1./sqrt(2)]])

pol_coords = np.array([
       [-.5/(sqrt(2)),.5/(sqrt(2)),.5/(sqrt(2))+.19641855032959654],
       [.5/(sqrt(2)),.5/(sqrt(2)),-.5/(sqrt(2))+.19641855032959654],
       [.5/(sqrt(2)),-.5/(sqrt(2)),.5/(sqrt(2))+.19641855032959654],
       [-.5/(sqrt(2)),-.5/(sqrt(2)),-.5/(sqrt(2))+.19641855032959654],
       [5/6.0/sqrt(2),-5/6.0/sqrt(2),-5/6.0/sqrt(2)+.19641855032959654],
       [-5/6.0/sqrt(2), 5/6.0/sqrt(2),-5/6.0/sqrt(2)+.19641855032959654]])

bigTri_coords = np.array([
       [0,4*sqrt(3)/6.,0],
       [-.5,sqrt(3)/6.,0],
       [.5,sqrt(3)/6.,0],
       [-1,-2*sqrt(3)/6.,0],
       [0,-2*sqrt(3)/6.,0],
       [1,-2*sqrt(3)/6,0]])

parl_coords = np.array([
       [-1.25,sqrt(3)/4.,0],
       [-.25,sqrt(3)/4.,0],
       [.75,sqrt(3)/4.,0],
       [-.75,-sqrt(3)/4.,0],
       [.25,-sqrt(3)/4.,0],
       [1.25,-sqrt(3)/4.,0]])

che_coords = np.array([
       [sqrt(3)/2.,2/3.,0],
       [-sqrt(3)/2.,2/3.,0],
       [0,-5/6.,0],
       [0,1/6.,0],
       [sqrt(3)/2.,-1/3.,0],
       [-sqrt(3)/2.,-1/3.,0]])