{
 "metadata": {
  "name": "",
  "signature": "sha256:500ea84ac640cd41660e6f638f881e8562be78729e5c4e8b033f789e32ce7768"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 20:Projectiles"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.4, Page no.423"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#variable declaration\n",
      "alpha=30    #angle of projection with the horizontal in degree\n",
      "u=40        #velocity of projection in m/s\n",
      "g=9.8       #gravity in m/s**2\n",
      "\n",
      "#calculation\n",
      "t=(2*u*math.sin(alpha*math.pi/180)/g)\n",
      "\n",
      "#Result\n",
      "print\"t=\",round(t,2),\"s\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "t= 4.08 s\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.5, Page no.423"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#variable declaration\n",
      "alpha=25    #angle of projection with the horizontal in degree\n",
      "u=15        #velocity of projection in m/s\n",
      "g=9.8       #gravity in m/s**2\n",
      "\n",
      "#calculation\n",
      "R=((u**2)*(math.sin((2*alpha)*math.pi/180))/g)\n",
      "\n",
      "#Result\n",
      "print\"R=\",round(R,1),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R= 17.6 m\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.6, Page no.424"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#variable declaration\n",
      "alpha=45    #angle of projection with the horizontal in degree\n",
      "u=100       #velocity of projection in m/s\n",
      "g=9.8       #gravity in m/s**2\n",
      "\n",
      "#calculation\n",
      "H=((u**2)*math.sin((alpha*math.pi)/180)**2/(2*g))\n",
      "\n",
      "#Result\n",
      "print\"H=\",round(H,1),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "H= 255.1 m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.23, Page no.439"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#variable declaration\n",
      "alpha=35    #angle of projection with the horizontal in degree\n",
      "beta=15     #inclination of the plane in degree\n",
      "u=10        #velocity of projection in m/s\n",
      "g=9.8       #gravity in m/s**2\n",
      "\n",
      "#calculation\n",
      "t_1=(2*u*math.sin((alpha-beta)*math.pi/180)/(g*math.cos(beta*math.pi/180)))\n",
      "t_2=(2*u*math.sin((alpha+beta)*math.pi/180)/(g*math.cos(beta*math.pi/180)))\n",
      "\n",
      "#Result\n",
      "print\"Time of flight when the ball is projected upwards, t_1=\",round(t_1,2),\"s\"\n",
      "print\"Time of flight when the ball is projected downwards, t_2=\",round(t_2,2),\"s\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Time of flight when the ball is projected upwards, t_1= 0.72 s\n",
        "Time of flight when the ball is projected downwards, t_2= 1.62 s\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.24, Page no.441"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#variable declaration\n",
      "alpha=55    #angle of projection with the horizontal in degree\n",
      "beta=20     #angle of plane in degree\n",
      "u=30        #velocity of projection in m/s\n",
      "g=9.8       #gravity in m/s**2\n",
      "pi=180      #pi in degree\n",
      "\n",
      "#calculation\n",
      "alpha=(pi/4)+(beta/2)\n",
      "R=(u**2*(math.sin(((2*alpha)-beta)*math.pi/180)-math.sin(beta*math.pi/180))/(g*math.cos(beta*math.pi/180)**2))\n",
      "t=(2*u*math.sin((alpha-beta)*math.pi/180))/(g*math.cos(beta*math.pi/180))\n",
      "\n",
      "#Result\n",
      "print\"Maximum Range, alpha=\",int(alpha),\"degree\"\n",
      "print\"Range of the projectile, R=\",round(R,2),\"m\"\n",
      "print\"Time of flight, t=\",round(t,2),\"s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum Range, alpha= 55 degree\n",
        "Range of the projectile, R= 68.43 m\n",
        "Time of flight, t= 3.74 s\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}