{
 "metadata": {
  "name": "",
  "signature": "sha256:7117da667e9242c9a19d8eb5f355fd755219357cacc372784f1e3ef0c539e46b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17 Refraction of the light"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.1 Page no 918"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=1.50\n",
      "u2=1.33\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "sinr=u1*math.sin(50*3.14/180.0)/u2\n",
      "a=math.asin(sinr)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Angle of refraction is\", round(a,1),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of refraction is 59.8 degree\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.2 Page no 918"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=1.0\n",
      "u2=1.526\n",
      "i=45                      #degree\n",
      "#Calculation\n",
      "sinr=(u1*math.sin(i*3.14/180.0))/u2\n",
      "r=math.asin(sinr)*180/3.14\n",
      "d=i-r\n",
      "\n",
      "#Result\n",
      "print\"Angle of deviation is\", round(d,2),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of deviation is 17.39 degree\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.3 Page no 918"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "c=3.0*10**8\n",
      "u=1.5\n",
      "f=6*10**14                      #Hz\n",
      "\n",
      "#Calculation\n",
      "v=c/u\n",
      "l=c/f\n",
      "lm=v/f\n",
      "\n",
      "#Result\n",
      "print\"(i) Wavelength of light in air is\", l,\"m\"\n",
      "print\"(ii) Wavelength of light in glass is\",round(lm*10**7,1)*10**-7,\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Wavelength of light in air is 5e-07 m\n",
        "(ii) Wavelength of light in glass is 3.3e-07 m\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.4 Page no 919"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "ug=1.5\n",
      "uw=1.3\n",
      "vw=2.25*10**8\n",
      "\n",
      "#Calculation\n",
      "vg=(uw*vw)/ug\n",
      "\n",
      "#Result\n",
      "print\"Speed of the light in glass is\", vg*10**-8,\"*10**8 m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of the light in glass is 1.95 *10**8 m/s\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.5 Page no 919"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=1.6\n",
      "t=8\n",
      "t1=4.5\n",
      "u1=1.5\n",
      "t2=6\n",
      "u2=1.33\n",
      "\n",
      "#Calculation\n",
      "d=t*(1-(1/u))\n",
      "d1=t1*(1-(1/u1))\n",
      "d2=t2*(1-(1/u2))\n",
      "D=d+d1+d2\n",
      "\n",
      "#Result\n",
      "print\"Position of mark from the bottom is\", round(D,0),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of mark from the bottom is 6.0 cm\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.6 Page no 919"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "uw=1.33\n",
      "uo=1.20\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "uow=uw/uo\n",
      "sinr=(math.sin(30*3.14/180.0))/uow\n",
      "r=math.asin(sinr)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Angle of refraction in water is\", round(r,1),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of refraction in water is 26.8 degree\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.7 Page no 920"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "v=2.0*10**8                           #m/s\n",
      "c=3*10**8                           #m/s\n",
      "d=6.0                               #cm\n",
      "\n",
      "#Calculation\n",
      "ug=c/v\n",
      "a=d/ug\n",
      "D=d-a\n",
      "\n",
      "#Result\n",
      "print\"Distance through which ink dot appears to be raised is\", D,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distance through which ink dot appears to be raised is 2.0 cm\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.8 Page no 924"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "ug=1.5\n",
      "uw=1.33\n",
      "\n",
      "#Calculation\n",
      "u1=ug/uw\n",
      "sinC=1/u1\n",
      "C=math.asin(sinC)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Critical angle is\", round(C,2),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Critical angle is 62.49 degree\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.9 Page no 924"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "v=1.5*10**8\n",
      "c=3.0*10**8\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "a=v/c\n",
      "C=math.asin(a)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Value of critical angle is\", round(C,0),\"Degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of critical angle is 30.0 Degree\n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.10 Page no 924"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "uw=1.33\n",
      "\n",
      "#Calculation\n",
      "a=1/uw\n",
      "b=math.sin(a)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Angle of refraction is\", round(b,0),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of refraction is 39.0 degree\n"
       ]
      }
     ],
     "prompt_number": 74
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.11 Page no 924"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=4\n",
      "b=6.0\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=a/b\n",
      "B=math.atan(A)*180/3.14\n",
      "ur=1/(math.sin(B*3.14/180.0))\n",
      "\n",
      "#Result\n",
      "print\"Refrective index of the liquid is\", round(ur,1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refrective index of the liquid is 1.8\n"
       ]
      }
     ],
     "prompt_number": 79
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.12 Page no 925"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=52                                   #Degree\n",
      "b=33                                    #Degree\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "u2=(math.sin(a*3.14/180.0))/(math.sin(b*3.14/180.0))\n",
      "C=1/u2\n",
      "A=math.asin(C)*180/3.14\n",
      "\n",
      "#Result\n",
      "print\"Angle of refrection is\", round(A,1),\"Degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of refrection is 43.7 Degree\n"
       ]
      }
     ],
     "prompt_number": 88
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.13 Page no 932"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-240.0\n",
      "R=15.0                    #cm\n",
      "u1=1.33\n",
      "u2=1.5\n",
      "\n",
      "#Calculation\n",
      "v=1/((((u2-u1)/R)+(u1/u))/u2)\n",
      "\n",
      "#Result\n",
      "print\"Position of the image is\", round(v,0),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image is 259.0 cm\n"
       ]
      }
     ],
     "prompt_number": 94
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.14 Page no 932"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-9.0                        #cm\n",
      "y=1\n",
      "y1=1.5\n",
      "R=-15.0                      #cm\n",
      "\n",
      "#Calculation\n",
      "v=1/(((y-y1)/R)-(y1/-u))\n",
      "\n",
      "#Result\n",
      "print\"The value of distance is\",v,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of distance is -7.5 cm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.15 Page no 933 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-15               #cm\n",
      "y1=1\n",
      "y2=1.5\n",
      "R=-7.5              #cm\n",
      "\n",
      "#Calculation\n",
      "v=1/(((y1-y2)/R)-(y2/-u))\n",
      "\n",
      "#Result\n",
      "print\"Position of the image is\",v,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image is -30.0 cm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.16 Page no 933"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-60.0                    #cm\n",
      "R=25.0                     #cm\n",
      "y1=1\n",
      "y2=1.5\n",
      "\n",
      "#Calcution\n",
      "v=1/((((y2-y1)/R)+(y1/u))/y2)\n",
      "P=(y2-y1)/(R*10**-2)\n",
      "\n",
      "#Result\n",
      "print\"Position of the image is\", v,\"cm\"\n",
      "print\"Power of the refracting surface is\", P,\"dioptre\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image is 450.0 cm\n",
        "Power of the refracting surface is 2.0 dioptre\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.17 Page no 934"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=1\n",
      "u2=1.5\n",
      "R=1\n",
      "\n",
      "#Calculation\n",
      "x=(u1+u2)/(u2-u1)\n",
      "\n",
      "#Result\n",
      "print\"Distance of the object is\", x,\"R\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distance of the object is 5.0 R\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.18 Page no 934"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R=7.5                            #cm\n",
      "u1=1\n",
      "u2=1.33\n",
      "\n",
      "#Calculation\n",
      "v=1/(((u1-u2)/R))\n",
      "\n",
      "#Result\n",
      "print\"It gets focused at\", round(v,1),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "It gets focused at -22.7 cm\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.19 Page no 935"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=1\n",
      "u2=1.5\n",
      "u=-10\n",
      "v=-40                        #cm\n",
      "\n",
      "#Calculation\n",
      "R=-v*(u2-u1)/(u1+u2)\n",
      "\n",
      "#Result\n",
      "print\"Curvature given to the bounding surface is\", R,\"cm (Convex)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Curvature given to the bounding surface is 8.0 cm (Convex)\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.20 Page no 935"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=1\n",
      "u2=1.5\n",
      "v=100                        #cm\n",
      "R=20.0                        #cm\n",
      "a=3\n",
      "b=200.0\n",
      "\n",
      "#Calculation\n",
      "u1=(u2-u1)/R\n",
      "u2=-1/(u1-(a/b))\n",
      "d=-u2+R\n",
      "\n",
      "#Result\n",
      "print\"The object distance from the centre of curvature is\", d,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The object distance from the centre of curvature is 120.0 cm\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.21 Page no 952"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "ug=1.5\n",
      "R1=50.0                     #cm\n",
      "R2=-50.0                   #cm\n",
      "uw=9/8.0\n",
      "\n",
      "#Calculation\n",
      "f=1/((ug-1)*((1/R1)+(1/R1)))\n",
      "f1=1/((uw-1)*((1/R1)+(1/R1)))\n",
      "\n",
      "#Result\n",
      "print\"(i) Focal length in air is\", f,\"cm\"\n",
      "print\"(ii) Focal lenth in water is\", f1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Focal length in air is 50.0 cm\n",
        "(ii) Focal lenth in water is 200.0\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.22 Page no 953"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "fa=20                          #cm\n",
      "ug=9/8.0\n",
      "uw=3/2.0\n",
      "\n",
      "#Calculation\n",
      "a=(uw-1)/(ug-1)\n",
      "fw=a*fa\n",
      "f=fw-fa\n",
      "\n",
      "#Result\n",
      "print\"Change in focal length is\", f,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in focal length is 60.0 cm\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.23 Page no 953"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=1.56\n",
      "R1=20.0                      #cm\n",
      "u1=-10.0                      #cm\n",
      "\n",
      "#Calculation\n",
      "f=1/((u-1)*(2/R1))\n",
      "v=1/((1/u1)+(1/f))\n",
      "\n",
      "#Result\n",
      "print\"Position of the image formed is\", round(v,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image formed is -22.73\n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.24 Page no 953"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=1.47\n",
      "\n",
      "#Calculation\n",
      "u1=u\n",
      "\n",
      "#Result\n",
      "print\"The liquid is not water because refractive index of water is 1.33\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The liquid is not water because refractive index of water is 1.33\n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.25 Page no 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "f=18                         #cm\n",
      "u=1.5\n",
      "\n",
      "#Calculation\n",
      "R=(u-1)*f\n",
      "\n",
      "#Result\n",
      "print\"Radius of the curvature is\", R,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radius of the curvature is 9.0 cm\n"
       ]
      }
     ],
     "prompt_number": 68
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.26 Page no 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-25.0                      #cm\n",
      "f=10.0                       #cm\n",
      "h1=5\n",
      "\n",
      "#Calculation\n",
      "v=1/((1/f)+(1/u))\n",
      "h2=(v*h1)/u\n",
      "\n",
      "#Result\n",
      "print\"Position of the image is\", round(v,2),\"cm\"\n",
      "print\"Size of the image is\",round(h2,2),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image is 16.67 cm\n",
        "Size of the image is -3.33 cm\n"
       ]
      }
     ],
     "prompt_number": 78
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.27 Page no 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "f=-15.0                     #cm\n",
      "v=-10.0                       #cm\n",
      "\n",
      "#Calculation\n",
      "u=1/((1/v)-1/f)\n",
      "\n",
      "#Result\n",
      "print\"The object is placed at a distance of\", u,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The object is placed at a distance of -30.0 cm\n"
       ]
      }
     ],
     "prompt_number": 81
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.28 Page no 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "v=-20.0                         #cm\n",
      "u=-60.0                         #cm\n",
      "\n",
      "#Calculation\n",
      "f=1/((1/v)-(1/u))\n",
      "\n",
      "#Result\n",
      "print\"Focal length of the lens is\", f,\"cm\"\n",
      "print\"The lens is diverging\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Focal length of the lens is -30.0 cm\n",
        "The lens is diverging\n"
       ]
      }
     ],
     "prompt_number": 85
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.29 Page no 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u=-10.0                       #cm\n",
      "m=-3.0\n",
      "\n",
      "#Calculation\n",
      "v=m*u\n",
      "f=1/((1/v)-(1/u))\n",
      "\n",
      "#Result\n",
      "print\"Image formed at\",v,\"cm\"\n",
      "print\"Focal length is\",f,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Image formed at 30.0 cm\n",
        "Focal length is 7.5 cm\n"
       ]
      }
     ],
     "prompt_number": 94
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.30 Page no 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "P1=6\n",
      "P2=-2.0\n",
      "\n",
      "#Calculation\n",
      "P=P1+P2\n",
      "f=1/P\n",
      "\n",
      "#Result\n",
      "print\"Focal length of the combination is\", f*10**2,\"cm\"\n",
      "print\"Power of the combinationis\",P,\"D\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Focal length of the combination is 25.0 cm\n",
        "Power of the combinationis 4.0 D\n"
       ]
      }
     ],
     "prompt_number": 102
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.31 Page no 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "f1=20.0              #cm\n",
      "f2=-40.0                #cm\n",
      "\n",
      "#Calculation\n",
      "f=1/((1/f1)+(1/f2))\n",
      "P=1/f\n",
      "\n",
      "#Result\n",
      "print\"Focal length is\", f,\"cm\"\n",
      "print\"Power is\",P*10**2,\"D\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Focal length is 40.0 cm\n",
        "Power is 2.5 D\n"
       ]
      }
     ],
     "prompt_number": 107
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.32 Page no 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=2.0\n",
      "b=1\n",
      "\n",
      "#Calculation\n",
      "u=(b/a)+b\n",
      "\n",
      "#Result\n",
      "print\"Refractive index of the material is\", u"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index of the material is 1.5\n"
       ]
      }
     ],
     "prompt_number": 109
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.33 Page no 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "f=-0.2                        #m\n",
      "v=0.3                         #m\n",
      "\n",
      "#Calculation\n",
      "u=1/((1/v)-(1/f))\n",
      "\n",
      "#Result\n",
      "print\"Position of the point is\", u,\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the point is 0.12 m\n"
       ]
      }
     ],
     "prompt_number": 113
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.35 Page no 957"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "u1=-30.0                      #cm\n",
      "f1=10.0\n",
      "u2=10\n",
      "f2=-10.0\n",
      "\n",
      "#calculation\n",
      "v1=1/((1/u1)+(1/f1))\n",
      "v2=1/((1/u2)+(1/f2))\n",
      "v3=-u1\n",
      "\n",
      "#Result\n",
      "print\"Position of the image for first lens is\", v1,\"cm\"\n",
      "print\"Position of the image for second lens is\", round(v2*10**-2,0),\"cm\"\n",
      "print\"Position of the image for third lens is\", v3,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of the image for first lens is 15.0 cm\n",
        "Position of the image for second lens is -0.0 cm\n",
        "Position of the image for third lens is 30.0 cm\n"
       ]
      }
     ],
     "prompt_number": 127
    }
   ],
   "metadata": {}
  }
 ]
}