import math
#Variable declaration
m = 9.1*10**-31 #mass of electron(kg)
v = 2.5*10**6 #velocity of electron(m/s)
theta = 30*math.pi/180 #angle(degrees)
B = 0.94*10**-4 #field strength(Wb/m^2)
e = 1.6*10**-19 #electron charge(C)
#Calculations
r = (m*v*math.sin(theta))/(B*e)
l = (5*v*math.cos(theta)*2*math.pi*m)/(B*e)
#Results
print "Radius =",round(r/1e-3,2),"mm"
print "Distance covered =",round(l,3),"m"
import math
#Variable declaration
m = 9.1*10**-31 #mass of electron(kg)
v = 3*10**7 #velocity of electron(m/s)
theta = 45*math.pi/180 #angle(degrees)
B = 0.23*10**-4 #field strength(Wb/m^2)
e = 1.6*10**-19 #electron charge(C)
#Calculations
r = (m*v*math.sin(theta))/(B*e)
l = (v*math.cos(theta)*2*math.pi*m)/(B*e)
#Results
print "Radius =",round(r,2),"m"
print "Distance covered =",round(l,3),"m"
#Calculation mistakes in the textbook
#Variable declaration
y = 1.5 #displacement(cm)
d = 0.42 #distance(cm)
Va = 1.6*10**3 #anode voltage(V)
D = 28 #cm
l = 1.8 #length of plates(cm)
#Calculation
V = (2*y*d*Va)/(D*l)
Vin = V/6
#Result
print "Input voltage =",round(Vin,2),"V"
#Variable declaration
da = 0.8 #minor axis(cm)
db = 2 #major axis(cm)
#Calculation
ps = math.degrees(math.asin(da/db))
#Result
print "Phase shift =",round(ps,2),"degrees"