import math
# Given Data
P = 40.; # N Magnitude of vector P
Q = 60. # N Magnitude of vector Q
# imagine triangle for triangle law of vectors
B = 180.-25; # degree , Angle between vector P and vector Q
# Calculations and Results
#R- resultant vector
B = B*math.pi/180; # conversion into radian
#R**2 = P**2+Q**2-2*P*Q*math.cos(B); Comath.sine Law
R = math.sqrt(P**2+Q**2-2*P*Q*math.cos(B)); # N
print "Maginitude of resultant is R = %.2f N"%(R);
#A- Angle between resultant and P vector, Unknown
# math.sin(A)/Q = = math.sin(B)/R math.sine law
A = math.asin(Q*math.sin(B)/R); # radian
A = A*180/math.pi; # # Conversion into degree
alpha = A+20; # degree
print "Angle of resultant vector R with x axis is %.2f Degrees"%(alpha);
import math
# Given Data
R = 25.; # kN Magnitude of resultant vector
alpha = 45.; #degree
# T1 and T2 are tensions in rope 1 and rope 2 respectively
A = 30.; # degree , Angle between vector T1 and resultant
B = alpha; # degree , Angle between vector T2 and resultant
C = 180.-(A+B); # degree , Angle between vector T1 and T2
# Calculations and Results
# conversion of angles into radian
A = A*math.pi/180;
B = B*math.pi/180;
C = C*math.pi/180;
# math.sin(A)/T2 = = math.sin(B)/T1 = = math.sin(C)/R .............. math.sine law
T1 = (R*math.sin(B))/math.sin(C); #kN
T2 = (R*math.sin(A))/math.sin(C); #kN
print "Tension in rope 1 is T1 = %.2f kN and in rope 2 is T2 = %.2f kN "%(T1,T2);
# Minimum value of T2 o# Resultsurs when T1 and T2 are perpendicular to each other i.e C = 90 degree
C = 90.; #degree
A = 30.; # degree
B = 180-(A+C); #degrees
alpha = B; #degrees
B = B*math.pi/180; # radian
T2 = R*math.sin(B); # kN
T1 = R*math.cos(B); #kN
print "Minimum tension in rope 2 is T2 = %.2f kN "%(T2);
print "corrosponding T1 = %.2f kN "%(T1);
print "alpha = %.2f degrees"%(alpha);
import math
# Given Data
F1 = 150.; # N
F2 = 80.; # N
F3 = 110.; #N
F4 = 100. # in N
F1x = 129. #in N
F2x = -27.4
F3x = 0.
F4x = 96.6
F1y = 75.
F2y = 75.2
F3y = -110.
F4y = -25.9
# Calculations and Results
Rx = F1x+F2x+F3x+F4x; #N Horizontal component of R- resultant
Ry = F1y+F2y+F3y+F4y; #N Vertical component of R- resultant
#R = Rx i +Ry j
print "R = %.2f i + %.2f j "%( Rx,Ry);
alpha = math.atan(Ry/Rx); #Radian, Angle made by resultant with +ve x axis
alpha = alpha*180/math.pi; #Conversion into degrees
R = math.sqrt(Rx**2+Ry**2); # N , Magnitude of resultant
print "alpha = %.2f degrees and R = %.2f N"%(alpha,R);
import math
# Given Data
W = 3500.; # lb weight of automobile
alpha = 2.; #degree
# TAB and TAC are tensions in cable AB and cable AC respectively
A = 90+30.; # degree , Angle between vector T1 and resultant
B = alpha; # degree , Angle between vector T2 and resultant
C = 180-(A+B); # degree , Angle between vector T1 and T2
# Calculations
# conversion of angles into radian
A = A*math.pi/180;
B = B*math.pi/180;
C = C*math.pi/180;
# math.sin(A)/TAB = = math.sin(B)/TAC = = math.sin(C)/W .............. math.sine law
TAB = (W*math.sin(A))/math.sin(C); #N
TAC = (W*math.sin(B))/math.sin(C); #N
# Results
print "Tension in cable AB is TAB = %.2f lb and in Cable AC is TAC = %.2f lb "%(TAB,TAC);
import math
# Given Data
mass = 30.; # kg
W = mass*9.81; # N, Weight of package
alpha = 15.; #degree
# Calculations
alpha = alpha*math.pi/180; # Conversion into radian
F = W*math.sin(alpha); #N
# Results
print "F = %.2f N"%(F);
import math
alpha = math.atan(7./4); #rad
beta = math.atan(1.5/4); #rad
T_AB = 200.; #N tension in cable AB
T_AE = -300.; #N, tension in cable AE
# R = T_AB+T_AC+T_AE+F_D = 0 ...Equillibrium Condition...........1
# Calculations
T_ABx = -T_AB*math.sin(alpha); # Xcomponent of T_AB
T_ABy = T_AB*math.cos(alpha); #Y component of T_AB
# T_ACx = T_AC*math.sin(beta); Xcomponent of T_AC
# T_ACy = T_AC*math.cos(beta); Y component of T_AC
# Sum Fx = 0 gives -T_AB*math.sin(alpha) N + T_AC*math.sin(beta) +F_D = 0..........2
#Sum Fy = 0 gives T_AB*math.cos(alpha) N +T_AC*math.cos(beta) +T_AE = 0................3
T_AC = (-T_AB*math.cos(alpha)-T_AE)/math.cos(beta); #N, From 3
F_D = T_AB*math.sin(alpha)-T_AC*math.sin(beta); #N, From 2
# Results
print "Value of drag force is F_D = %.2f N and tension in cable AC is T_AC = %.2f N"%(F_D,T_AC);
import math
# Given Data
dx = -40.; #m
dy = 80.; #m
dz = 30.; #m
f = 2500.; #N, Mafnitude of force F
# Calculations and Results
d = math.sqrt(dx**2+dy**2+dz**2); #m, total dismath.tance of vector AB
#F = f*lambda, lambda - unit vector = AB/d. So we can calculate each component by multiplying this unit vector
Fx = f*dx/d; #N , X component of F
Fy = f*dy/d; #N , Y component of F
Fz = f*dz/d; #N , Z component of F
print "Component of F along X axis is %.2f N"%(Fx);
print "Component of F along Y axis is %.2f N"%(Fy);
print "Component of F along Z axis is %.2f N"%(Fz);
print "We may write F as F = %.2f i + %.2f j + %.2f k"%(Fx,Fy,Fz);
thetax = math.acos(Fx/f); # radian , angle with +ve x axis
thetay = math.acos(Fy/f); # radian , angle with +ve y axis
thetaz = math.acos(Fz/f); # radian , angle with +ve z axis
#Conversion of angles into degree
thetax = thetax*180/math.pi; #degree
thetay = thetay*180/math.pi; #degree
thetaz = thetaz*180/math.pi; #degree
print "Angle made by F with +ve X axis %.2f degree"%(thetax);
print "Angle made by F with +ve Y axis %.2f degree"%(thetay);
print "Angle made by F with +ve Z axis %.2f degree"%(thetaz);
F = 800. # N , given force
theta = 145. # Degrees , angle with posiyive X axis
theta = theta*math.pi/180; # Conversion into radian
Fx = F*math.sin(theta); #N, Horizontal component
Fy = F*math.cos(theta); # N, Vertical Component
print "Horizontal component of F is %.2f N"%(Fx);
print "Vertial component of F is %.2f N"%(Fy);
print "We may write F as F = %.2f i + %.2f j"%(Fx,Fy);
F = 300. # N , given force
AB = math.sqrt(8**2+6**2); # m Length of AB
math.cos_alpha = 8/AB;
math.sin_alpha = -6/AB;
Fx = F*math.cos_alpha; #N, Horizontal component
Fy = F*math.sin_alpha; # N, Vertical Component
print "Fx = %.2f"%Fx
print "Fy = %.2f"%Fy
import math
# Given Data
T_AB = 4200.; #N , Tension in cable AB
T_AC = 6000.; #N , Tension in cable AC
# Vector AB = -(5m)i+(3m)j+(4m)k
#Vector Ac = -(5m)i+(3m)j+(5m)k
ABx = -5.; #m
ABy = 3.; #m
ABz = 4.; #m
ACx = -5.; #m
ACy = 3.; #m
ACz = -5.; #m
# Calculations and Results
AB = math.sqrt((-5)**2+3**2+4**2); #m, Magnitude of vector AB
AC = math.sqrt((-5)**2+3**2+5**2); #m, Magnitude of vector AC
#vT_AB = T_AB*lambdaAB, lambdaAB - unit vector = vAB/AB. So we can calculate each component by multiplying this unit vector
T_ABx = T_AB*ABx/AB; #N , X component of T_AB
T_ABy = T_AB*ABy/AB; #N , Y component of T_AB
T_ABz = T_AB*ABz/AB; #N , Z component of T_AB
print "Component of T_AB along X axis is %.2f N"%(T_ABx);
print "Component of T_AB along Y axis is %.2f N"%(T_ABy);
print "Component of T_AB along Z axis is %.2f N"%(T_ABz);
print "We may write T_AB as T_AB = %.2f i + %.2f j + %.2f k"%(T_ABx,T_ABy,T_ABz);
#vT_AC = T_AC*lambdaAC, lambdaAC - unit vector = vAC/AC. So we can calculate each component by multiplying this unit vector
T_ACx = T_AC*ACx/AC; #N , X component of T_AC
T_ACy = T_AC*ACy/AC; #N , Y component of T_AC
T_ACz = T_AC*ACz/AC; #N , Z component of T_AC
print "Component of T_AC along X axis is %.2f N"%(T_ACx);
print "Component of T_AC along Y axis is %.2f N"%(T_ACy);
print "Component of T_AC along Z axis is %.2f N"%(T_ACz);
print "We may write T_AC as T_AC = %.2f i + %.2f j + %.2f k"%(T_ACx,T_ACy,T_ACz);
Rx = T_ABx+T_ACx; #N ,X component of R
Ry = T_ABy+T_ACy; #N ,Y component of R
Rz = T_ABz+T_ACz; #N ,Z component of R
print "Component of R along X axis is %.2f N"%(Rx);
print "Component of R along Y axis is %.2f N"%(Ry);
print "Component of R along Z axis is %.2f N"%(Rz);
print "We may write R as R = %.2f i + %.2f j + %.2f k"%(Rx,Ry,Rz);
R = math.sqrt(Rx**2+Ry**2+Rz**2); #N, Magnitude of resultant
thetax = math.acos(Rx/R); # radian , angle with +ve x axis
thetay = math.acos(Ry/R); # radian , angle with +ve y axis
thetaz = math.acos(Rz/R); # radian , angle with +ve z axis
#Conversion of angles into degree
thetax = thetax*180/math.pi; #degree
thetay = thetay*180/math.pi; #degree
thetaz = thetaz*180/math.pi; #degree
print "Angle made by R with +ve X axis %.2f degree"%(thetax);
print "Angle made by R with +ve Y axis %.2f degree"%(thetay);
print "Angle made by F with +ve Z axis %.2f degree"%(thetaz);