#! /usr/bin/env python """ animi.py is a program which generates a 3D animation two spheres where one sphere moves towards the other Paul Eugenio PHZ4151C Feb 1, 2019 """ from __future__ import division, print_function from vpython import sphere, color, vector from time import sleep # create two spheres a=sphere(pos=vector(-5,0,0), radius=0.5, color=color.blue) b=sphere(pos=vector(6.1,0,0), radius=0.5, color=color.red) # have one sphere move increasingly faster # towards the other sphere and stop at the sphere for i in range(1,11): sleep(1/i) a.pos.x += 1 # change only the x position