Chapter 01: Vectors and their use¶

Ex1.1:pg-25¶

In [21]:
  #Example 1_1
import math
#To add the given Displacements Graphically
d1=25     #units in cm
d2=10     #units in cm
d3=30     #units in cm
R=math.sqrt(d1**2+d2**2+d3**2)    #units in cm
theta1=30     #units in degrees
theta2=90    #units in degrees
theta3=120    #units in degrees
theta=360-(theta1+theta2+theta3)    #units in degrees
print "The Resultant R=",round(R,2)," cm\n"
print "Theta=",round(theta)," degrees"
#In text book the answer is printed wrong as R=49cm and theta=82 degrees but the correct answer is R=40.31cm and theta=120 degrees

The Resultant R= 40.31  cm

Theta= 120.0  degrees


Ex1.2:pg-25¶

In [20]:
  #Example 1_2

import math

# To add the given vector displacements
a=1    #units in meters
b=3    #units in meters
c=5    #units in meters
d=6    #units in meters
theta1=90    #units in degrees
Rx_a=a*math.sin(theta1*math.pi/180)     #units in meters
Rx_b=round(b*math.cos(theta1*math.pi/180))   #units in meters
theta2=37     #units in degrees
Rx_c=-round(c*math.cos(theta2*math.pi/180))       #units in meters
theta3=53    #units in degrees
Rx_d=-d*math.cos(theta3*math.pi/180)
Ry_a=round(a*math.cos(theta1*math.pi/180))     #units in meters
Ry_b=round(c*math.sin(theta2*math.pi/180))   #units in meters
Ry_c=round(c*math.sin(theta2*math.pi/180))   #units in meters
Ry_d=-(d*math.sin(theta3*math.pi/180))   #units in meters
Rx=Rx_a+Rx_b+Rx_c+Rx_d       #units in meters
Ry=Ry_a+Ry_b+Ry_c+Ry_d       #units in meters
R=sqrt(Rx**2+Ry**2)    #units in meters
phi=round(math.atan(Ry/-(Rx))*180/math.pi)      #units in degrees
phi=180-phi     #units in degrees
print "The Resultant R=",round(R,2)," Meters\n"
print "The Angle theta=",round(phi)," degrees"

The Resultant R= 6.72  Meters

The Angle theta= 170.0  degrees


Ex1.3:pg-26¶

In [18]:
  #Example 1_3

import math
#To subtract vector B from Vector A
Ax=8.7    #units in meters
Ay=5     #units in meters
Bx=-6     #units in meters
By=0     #units in meters
Rx=Ax-Bx       #units in meters
Ry=Ay-By        #units in meters
R=sqrt(Rx**2+Ry**2)      #units in meters
theta=round(math.atan(Ry/(Rx))*180/math.pi)      #units in degrees
print "Resultant R=",round(R,1)," Meters\n"
print "Angle Theta=",round(theta)," Degrees"

Resultant R= 15.5  Meters

Angle Theta= 19.0  Degrees


Ex1.4:pg-30¶

In [1]:
  #Example 1_4
import math

#To calculate the Volume
r=3*10**-5    #units in meters
L=0.20    #units in meters
V=math.pi*r**2*L    #Units in meter**3
print "Volume V=",round(V,12),"Meter**3"

Volume V= 5.65e-10 Meter**3