summaryrefslogtreecommitdiff
path: root/sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb
diff options
context:
space:
mode:
authorkinitrupti2017-05-12 18:53:46 +0530
committerkinitrupti2017-05-12 18:53:46 +0530
commit6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch)
tree22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb
parentd36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff)
downloadPython-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip
Removed duplicates
Diffstat (limited to 'sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb')
-rwxr-xr-xsample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb658
1 files changed, 658 insertions, 0 deletions
diff --git a/sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb b/sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb
new file mode 100755
index 00000000..212743ac
--- /dev/null
+++ b/sample_notebooks/MandalaManoj pruthvi/Chapter_4.ipynb
@@ -0,0 +1,658 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4 Radian Measure"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.1 page.no:96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Radian measure is 0.314159 rad\n",
+ "(or)\n",
+ "Radian measure is (pi/10)rad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To convert a degree measure to radians\n",
+ "from math import pi\n",
+ "\n",
+ "deg=18 # degree measure\n",
+ "radian=deg*(pi/180) # radian measure\n",
+ "print \"Radian measure is %f rad\\n(or)\"%radian\n",
+ "print \"Radian measure is (pi/%.0f)rad\"%(1/(radian/pi))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.2 page.no:96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Degree measure is 20 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To convert a radian meeasure to degree\n",
+ "from math import pi\n",
+ "\n",
+ "radian=pi/9 # radian measure\n",
+ "deg=radian/(pi/180) # degree measure\n",
+ "print \"Degree measure is %.0f degree\"%deg"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.3 page.no:99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Length of arc intercepted =2.4 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine length of the intercepted arc\n",
+ "r=2. #radius of circle\n",
+ "theta=1.2 # central angle in radian\n",
+ "s=r*theta # length of arc\n",
+ "print \"Length of arc intercepted =%.1f cm\"%s"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.4 page.no:99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Length of arc intercepted = 7.16 ft \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine length of the arc intercepted\n",
+ "from math import pi\n",
+ "\n",
+ "r=10 #radius of circle\n",
+ "theta=41*(pi/180) # central angle in radian\n",
+ "s=r*theta # length of arc\n",
+ "print \"Length of arc intercepted = %.2f ft \"%s"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.5 page.no:100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Measure of central angle = 0.40 rad\n",
+ " \n",
+ "Measure of central angle =22.92 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine angle in radians and degrees\n",
+ "from math import pi\n",
+ "\n",
+ "r=5. #radius of circle\n",
+ "s=2. #length of arc\n",
+ "theta = s/r #central angle in radian\n",
+ "print \"Measure of central angle = %.2f rad\\n \"%theta\n",
+ "print \"Measure of central angle =%.2f degree\"%(theta*(180/pi))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.6 page.no:100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Length of the rope =13.4 ft\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine the length of the rope\n",
+ "from math import sqrt,pi,atan,acos\n",
+ "\n",
+ "d=8. #distance between places in feet\n",
+ "r=2. #radius of cylinder in feet\n",
+ "#from the figure\n",
+ "DA=d/2\n",
+ "BE=r\n",
+ "DE=3 #distance from centre of container to wall\n",
+ "AE=sqrt(DE**2 + DA**2) # pythagoras theorem\n",
+ "AB=sqrt(AE**2 - BE**2) # pythagoras theorem\n",
+ "#all angles below are in radians\n",
+ "angle_AED = atan((d/2)/DE)\n",
+ "angle_AEB = acos(BE/AE)\n",
+ "angle_BEC = pi - (angle_AED + angle_AEB)\n",
+ "arc_BC = BE*angle_BEC #length of arc BC\n",
+ "L = 2*(AB + arc_BC) #length of rope\n",
+ "print \"Length of the rope =%.1f ft\"%L"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.7 page.no:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Length of belt around pulley = 71.4 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine the length of the belt around the pulleys\n",
+ "from math import pi,sqrt,asin\n",
+ "\n",
+ "AE= 5. #radius of first pulley in cm\n",
+ "BF= 8. #radius of second pulley in cm\n",
+ "AB=15. #distance between centre of pulleys in cm\n",
+ "#from the figure\n",
+ "CF=AE #parallel side of rectangle ACFE\n",
+ "BC= BF- CF\n",
+ "AC = sqrt(AB**2 - BC**2) #by pythagoras theorem\n",
+ "EF=AC# parallel side of rectangle ACFE 14\n",
+ "angle_EAC = pi/2\n",
+ "angle_BAC = asin(BC/AB)\n",
+ "angle_DAE = pi - angle_EAC - angle_BAC\n",
+ "angle_ABC = angle_DAE #AE and BF are parallel\n",
+ "angle_GBF= pi - angle_ABC\n",
+ "arc_DE=AE*angle_ABC # length of arc DE\n",
+ "arc_FG=BF*angle_GBF # length of arc FG\n",
+ "L=2*(arc_DE + EF + arc_FG) #length of belt\n",
+ "print \"Length of belt around pulley = %.1f cm\"%L"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.8 page.no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Area of sector = 1.6∗pi cmˆ2\n",
+ "(or)\n",
+ "Area of sector = 5.026548 cmˆ2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To find the area of sector of circle\n",
+ "from math import pi\n",
+ "\n",
+ "theta= pi/5 # angle in radian\n",
+ "r=4. #radius in cm\n",
+ "A=r*r*theta/2 #Area of sector\n",
+ "print \"Area of sector = %.1f∗pi cmˆ2\\n(or)\"%(A/pi)\n",
+ "print \"Area of sector = %f cmˆ2\"%A"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.9 page.no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Area of sector =12.51 mˆ2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine area of sector of a circle\n",
+ "from math import pi\n",
+ "\n",
+ "theta= 117*(pi/180) # angle in radian\n",
+ "r=3.5 #radius in m\n",
+ "A=r*r*theta/2 #Area of sector\n",
+ "print \"Area of sector =%.2f mˆ2\"%A"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.10 page.no:104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Area of sector =27 cmˆ2\n",
+ "\n",
+ "Note: Angle subtended by arc = 0.666667 rad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine area of sector of circle\n",
+ "\n",
+ "s=6. #arc length in cm\n",
+ "r=9. #radius in cm\n",
+ "A=r*s/2 #Area of sector\n",
+ "print \"Area of sector =%.0f cmˆ2\\n\"%A\n",
+ "print \"Note: Angle subtended by arc = %f rad\"%(s/r)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.11 page.no:104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Area enclosed by belt pulley system = 338.71 cmˆ2 \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine area insude belt pulley system\n",
+ "from math import pi,sqrt,asin\n",
+ "\n",
+ "AE= 5. #radius of first pulley\n",
+ "BF= 8. #radius of second pulley\n",
+ "AB=15. #distance between centre of pulleys\n",
+ "#from the figure\n",
+ "CF=AE\n",
+ "BC= BF- CF\n",
+ "AC = sqrt(AB**2 - BC**2)\n",
+ "#from the figure\n",
+ "angle_EAC = pi/2\n",
+ "angle_BAC = asin(BC/AB)\n",
+ "angle_DAE = pi - angle_EAC - angle_BAC\n",
+ "angle_ABC = angle_DAE #AE and BF are parallel\n",
+ "angle_GBF= pi - angle_ABC\n",
+ "area_DAE = AE**2*angle_DAE/2 #area of sector DAE\n",
+ "area_GBF = BF**2*angle_GBF/2 #area of sector GBF\n",
+ "area_AEFC = AE*AC #area of rectangle AEFC\n",
+ "area_ABC = AC*BC/2 #area of triangle ABC\n",
+ "area_K =2*( area_DAE + area_AEFC + area_ABC +area_GBF)\n",
+ "print \"Area enclosed by belt pulley system = %.2f cmˆ2 \"%area_K\n",
+ "#Note: answer differs from book due to approximations by them "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.12 page.no:105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Required area of segment = 1.408 square units\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine area of segment formed by a chord in circle\n",
+ "from math import acos,sin\n",
+ "\n",
+ "radius = 2.\n",
+ "chord = 3.\n",
+ "#Use law of cosines\n",
+ "cos_theta = (radius**2+radius**2-chord**2)/(2*radius*radius)\n",
+ "theta=acos(cos_theta) #subtended central angle in radians\n",
+ "area_K=radius**2*(theta-sin(theta))/2\n",
+ "print \"Required area of segment = %.3f square units\"%area_K"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.13 page.no:106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Area of intersection of 2 circles =7.66 cm ˆ2 \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To determine area of intersection of 2 circles\n",
+ "from math import acos\n",
+ "\n",
+ "d=7. #distance between centres in cm\n",
+ "r1= 5. #radius of first circle in cm\n",
+ "r2= 4. #radius of second circle in cm\n",
+ "#use law of cosines\n",
+ "cos_alpha=(d**2+ r1**2 - r2**2 ) /(2*d*r1)\n",
+ "cos_beeta=(d**2+ r2**2 - r1**2 ) /(2*d*r2)\n",
+ "#from the geometry of the figure\n",
+ "#all the angles below are in radians\n",
+ "alpha= acos(cos_alpha)\n",
+ "beeta= acos(cos_beeta)\n",
+ "angle_BAC = alpha\n",
+ "angle_ABC = beeta\n",
+ "angle_CAD =2* angle_BAC\n",
+ "angle_CBD =2* angle_ABC\n",
+ "#required area = area at segment CD in circle at A and at B\n",
+ "area_K = r1**2*(angle_CAD-sin(angle_CAD))/2 + r2 **2*(angle_CBD-sin(angle_CBD))/2\n",
+ "print \"Area of intersection of 2 circles =%.2f cm ˆ2 \"%area_K"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.14 page.no:109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Angular speed= 2.094395 radian/sec\n",
+ "\n",
+ "Linear speed=6.283185m/sec\n",
+ "\n",
+ "(or)\n",
+ "\n",
+ "Angular speed= 0.666667∗pi radian/sec\n",
+ " \n",
+ "Linear speed = 2.000000∗pi m/sec \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To find linear and angular speed of a moving object\n",
+ "from math import pi\n",
+ "t=0.5 #time in second\n",
+ "r= 3 #radius in m of the circle\n",
+ "theta = pi/3 # central angle in radian\n",
+ "w = theta/t #angular speed in rad /sec\n",
+ "v=w*r#linear speed in m/sec\n",
+ "print \"Angular speed= %f radian/sec\\n\"%w\n",
+ "print \"Linear speed=%fm/sec\"%v\n",
+ "print \"\\n(or)\\n\\nAngular speed= %f∗pi radian/sec\\n \"%(w/pi)\n",
+ "print \"Linear speed = %f∗pi m/sec \"%(v/pi)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.15 page.no:109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Linear speed = 12.96 ft/sec\n",
+ "\n",
+ "Angular speed= 6.48 radian/sec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#To find linear and angular speed of a moving object\n",
+ "\n",
+ "t=2.7 #time in second\n",
+ "r= 2. #radius in ft of the circle\n",
+ "s=35. #distance in feet\n",
+ "v=s/t #linear speed in ft/sec\n",
+ "w=v/r #angular speed in rad /sec\n",
+ "print \"Linear speed = %.2f ft/sec\\n\"%v\n",
+ "print \"Angular speed= %.2f radian/sec\"%w"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.16 page.no:109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "central angle swept = 7.75 radian \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To find the central angle swept by a moving object\n",
+ "t=3.1 #time in second\n",
+ "v= 10 #linear speed in m/sec\n",
+ "r= 4 #radius in m of the circle\n",
+ "s=v*t # distance in m\n",
+ "theta = s/r #central angle swept\n",
+ "print \"central angle swept = %.2f radian \"%theta"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exa 4.17 page.no:110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Angular speed of larger gear=20 rpm \n"
+ ]
+ }
+ ],
+ "source": [
+ "#To find the angular speed of larger gear interlocked with smaller gear\n",
+ "r1=5 #radius of larger gear\n",
+ "r2=4 #radius smaller gear\n",
+ "w2=25 #angular speed of smaller gear\n",
+ "# Imagine a particle on outer radii of each gear\n",
+ "#At any time , for every rotation , circular displacement of each particle is same\n",
+ "# (or) s1=s2 implies v1∗t=v2∗t\n",
+ "#v1= v2 implies w1∗r1=w2∗r2\n",
+ "w1=(w2*r2)/r1 #angular speed of larger gear\n",
+ "print \"Angular speed of larger gear=%.0f rpm \"%w1"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}