Chapter 17 :Lenses

Example 17.3 , Page no:102

In [1]:
import math
from __future__ import division
 
#initialisation of variables
p=24; #in inch
f=16; #inch
h=3; #inch

#CALCULATIONS
q=(p*f)/(p-f); #calculating image distance
hd=(-h*q)/p; #calculating diameter

#RESULTS
print"Distance of image in inch =",round(q,3);
print"Diameter in inch =",round(hd,3);
Distance of image in inch = 48.0
Diameter in inch = -6.0

Example 17.4 , Page no:103

In [2]:
import math
from __future__ import division
 
#initialisation of variables
p=30; #in cm
f=15; #in cm
h=8; #in cm

#CALCULATIONS
q=(p*f)/(p-f); #calculating image distance
hd=(-h*q)/p; #calculating diameter

#RESULTS
print"Distance of image in cm =",round(q,3);
print"Diameter in cm =",round(hd,3);
Distance of image in cm = 30.0
Diameter in cm = -8.0

Example 17.5 , Page no:103

In [3]:
import math
from __future__ import division
 
#initialisation of variables
p=100; #in cm
f=40; #in cm
h=6; #in cm

#CALCULATIONS
q=(p*f)/(p-f); #calculating image distance
hd=(-h*q)/p; #calculating diameter

#RESULTS
print"Distance of image in cm =",round(q,3);
print"Diameter in cm =",round(hd,3);
Distance of image in cm = 66.667
Diameter in cm = -4.0

Example 17.6 , Page no:103

In [4]:
import math
from __future__ import division
 
#initialisation of variables
p=12; #in ft
f=-2; #in ft

#CALCULATIONS
q=(p*f)/(p-f); #calculating image distance
m=-q/p; #calculating magnification

#RESULTS
print"Distance of image in ft =",round(q,3);
print"Magnification =",round(m,3);
Distance of image in ft = -1.714
Magnification = 0.143

Example 17.7 , Page no:103

In [5]:
import math
from __future__ import division
 
#initialisation of variables
hd=5; #in mm
h=2; #in mm
f=6; #in cm

#CALCULATIONS
m=hd/h; #calculating magnification
p=((m-1)/m)*f; #lens formula
q=-m*p; #lens formula

#RESULTS
print"Distance in cm =",round(p,3);
print"Image distance in cm =",round(q,3);
Distance in cm = 3.6
Image distance in cm = -9.0

Example 17.8 , Page no:104

In [6]:
import math
from __future__ import division
 
#initialisation of variables
p=1.5; #in inch
m=3; #magnification

#CALCULATIONS
q=-m*p; #calculating image distance
f=(p*q)/(p+q); #calculating focal length

#RESULTS
print"Distance of image in inch =",round(q,3);
print"Focal Length in inch =",round(f,3);
Distance of image in inch = -4.5
Focal Length in inch = 2.25

Example 17.9 , Page no:104

In [7]:
import math
from __future__ import division
 
#initialisation of variables
p=1.5; #in inch
f=0.15; #in metre

#CALCULATIONS
w=(p*f)/(p-f); #calculating focal length
w1=w*10**3;

#RESULTS
print"Length in mm =",round(w1,3);
Length in mm = 166.667

Example 17.10 , Page no:104

In [8]:
import math
from __future__ import division
 
#initialisation of variables
hd=-36; #in inch
h=2; #in inch
q=-15; #in ft

#CALCULATIONS
m=hd/h; #calculating magnification
p=-q/m; #in ft
f=(p*q)/(p+q); #calculating focal length

#RESULTS
print"Focal Length in ft =",round(f,3);
Focal Length in ft = -0.789

Example 17.11 , Page no:104

In [9]:
import math
from __future__ import division
 
#initialisation of variables
f1=10; #in cm
f2=-20; #in cm

#CALCULATIONS
f=(f1*f2)/(f1+f2); #calculating focal length

#RESULTS
print"Focal length of the combination in cm =",round(f,3);
Focal length of the combination in cm = 20.0