import math
#Initilization of variables
F=20 #lb
L=4.33 #ft
#Calculation
M=-F*L #lb-ft
#Result
print'The moment of force F about O is',round(M,1),"lb-ft"
import math
#Initilization of variables
F=20 #lb
theta=((60*pi)/180) #radians
L=5 #ft
#Calculations
F_x=F*cos(theta) #Resloving the vector
F_y=F*sin(theta) #Resloving the vector
M=-F_y*L #Appling Varignon's theorem
#Negative sign tells that moment is clockwise
#Result
print'The moment of the force about O is',round(M,1),"lb-ft"
import math
#Initilization of variables
F=100 #N
x1=2 #m
x2=5 #m
y1=0 #m
y2=1 #m
z1=4 #m
z2=1 #m
#Calculations
xside=(x2-x1) #m
yside=(y2-y1) #m
zside=(z2-z1) #m
LD=sqrt(xside**2+yside**2+zside**2)
Fx=(xside/LD)*F #N
Fy=(yside/LD)*F #N
Fz=(zside/LD)*F #N
Mx=-Fy*z1 #N-m
My=Fx*x1-Fz*z1 #N-m
Mz=Fy*x1 #N-m
#Result
print'Fx is',round(Fx,1),"N"
print'Fy is',round(Fy,1),"N"
print'Fz is',round(Fz,1),"N"
print'Moment about X-Axis is',round(Mx,1),"N.m"
print'Moment about Y-Axis is +',round(My),"N.m"
print'Moment about Z-Axis is +',round(Mz,1),"N.m"
# Decimal point error in calculation causes a small discrepancy in the resulting solutions.
import math
#Initilization of variables
Fx=68.7 #N
Fy=22.9 #N
Fz=-68.7 #N
rx=2 #m
ry=0 #m
rz=4 #m
rx1=5 #m
ry1=1 #m
rz1=1 #m
#Calculation
Mx=Fz*ry-Fy*rz #N-m
My=-(Fz*rx-Fx*rz) #N-m
Mz=Fy*rx-Fx*ry #N-m
Mx1=Fz*ry1-Fy*rz1 #N-m
My1=-(Fz*rx1-Fx*rz1) #N-m
Mz1=Fy*rx1-Fx*ry1 #N-m
#Result
print'Moment with respect to origin using point(2,0,4)is',round(Mx,1),"i +",round(My),"j +",round(Mz,1),"k N.m"
print'Moment with respect to origin using point (5,1,1) is',round(Mx1,1),"i +",round(My1),"j +",round(Mz1,1),"k N.m"
import math
#Initilization of variables
Fx=2 #lb
Fy=3 #lb
Fz=-1 #lb
rx=1 #ft
ry=-4 #ft
rz=3 #ft
#Coordinates of points
ax=3 #ft
ay=1 #ft
az=1 #ft
bx=3 #ft
by=-1 #ft
bz=1 #ft
cx=2 #ft
cy=5 #ft
cz=-2 #ft
#Calculations
Rx=ax-cx #ft
Ry=ay-cy #ft
Rz=az-cz #ft
Mx=(Ry*Fz)-(Rz*Fy) #lb-ft
My=-((Rx*Fz)-(Rz*Fx)) #lb-ft
Mz=(Rx*Fy)-(Ry*Fx) #lb-ft
E_u=sqrt((bx-cx)**2+(by-cy)**2+(bz-cz)**2) #ft
ex=(bx-cx)/E_u #ft
ey=(by-cy)/E_u #ft
ez=(bz-cz)/E_u #ft
M_lx=Mx*ex #lb-ft
M_ly=My*ey #lb-ft
M_lz=Mz*ez #lb-ft
M_l=M_lx+M_ly+M_lz #lb-ft
#Result
print'Hence the moment about line is',round(M_l,2),"lb-ft"
import math
#Initilization of variables
P_x=22 #N
P_y=23 #N
P_z=7 #N
p1=1 #m
p2=-1 #m
p3=-2 #m
#Calculations
Mx=(p2*P_z)-(p3*P_y) #N-m
My=-((p1*P_z)-(p3*P_x)) #N-m
Mz=(p1*P_y)-(p2*P_x) #N-m
#Result
print'The moment about the line from the origin is',round(Mx),"i",round(My),"j +",round(Mz),"k N.m"
import math
#Initilization of variables
F=10 #N Force couple
a=3 #m Moment arm
#Calculations
C=-F*a #N-m
#Result
print'The resultant couple is',round(C),"N-m"
import math
#Initilization of variables
C1=20 #N-m
C2=40 #N-m
C3=-55 #N-m
#Calculations
C=sqrt(C1**2+C2**2+C3**2) #N-m
thetax=C2/C
thetay=C3/C
thetaz=C1/C
Cx=C*thetax #N-m
Cy=C*thetay #N-m
Cz=C*thetaz #N-m
#Result
print'Couple in vector notation is',round(Cx),"i",round(Cy),"j +",round(Cz),"k N.m"
import math
#Initilization of variables
F1=25 #lb
F2=25 #lb
L1=14 #in
L2=20 #in
#Calculations
C=F1*L1 #lb-in
M=-F2*L2 #lb-in
#Result
print'The twisting couple is',round(C),"lb-in"
print'The bending moment is',round(M),"lb-in"
import math
#Initilization of variables
rx=20 #in
ry=0 #in
rz=14 #in
Fx=0 #lb
Fy=-25 #lb
Fz=0 #lb
#Calculation
Mx=ry*Fz-rz*Fy #lb-in
My=rx*Fz-rz*Fx #lb-in
Mz=rx*Fy-ry*Fx #lb-in
#Result
print'The moment of the 25-lb force is',round(Mx),"i +",round(My),"j",round(Mz),"k lb-in"
import math
#Initilization of variables
#Co-ordinates with respect to point O
x=17.9 #ft
y=6.91 #ft
z=46.3 #ft
Fz=-4000 #lb
Fy=0 #lb
#Calculation
Mx=y*Fz-z*Fy #lb-ft
#Result
print'The scalar coefficient of the i term is the moment about the X-Axis is',round(Mx,3),"lb-ft"
# The answer given in the textbook is incorrect