#! /usr/bin/env python """ lattice.py is a program which generates a 3D image of a simple atomic cubic lattice This is an example use of the vpython package. Run the program and rotate the image in 3D. Paul Eugenio PHZ4151C Jan 4, 2019 """ from __future__ import division, print_function import vpython as vp L = 5 # lattice size equals 2*L+1 radius = 0.3 # generate cubic lattice for i in range(-L,L+1): for j in range(-L,L+1): for k in range(-L,L+1): vp.sphere(pos=vp.vector(i,j,k),radius=radius)