#! /usr/bin/env python # -*- coding: utf8 -*- # Some computation for the "Bag of Balls" illustration. from math import * r=7.2 x=4*r ad=32 + 12 + r +x ax=20 dx=sqrt( ad**2 - ax**2 ) theta=atan(ax / dx) -ad + cos(theta)*dx sin(theta)*dx ax1=12. dx1=sqrt( 48**2 - ax1**2 ) -32 -60 + cos(theta)*dx1 sin(theta)*dx1 -80 + 45 4*44 4*r sqrt( (4*r)**2 - r**2 ) dx2=sqrt( (4*r)**2 - r**2 ) -80 + cos(theta)*dx2 sin(theta)*dx2 dx3=110 -80 + cos(theta)*dx3 sin(theta)*dx3