import math
# Given Data
#Area of plate
A = 9*.75; #in**2
y = 1./2*13.84+1/2*.75; #in, y co-ordinate of centroid of the plate
# Calculations and Results
#All values for flange are from table from book
sumA = A+8.85; #in**2 Total area
sumyA = y*A+0; #in**3
Y = sumyA/sumA; #in
#print (Y)
#Moment of inertia
#For wide flanfe
Ix1 = 291+8.85*Y**2; #in**4
#for plate
Ix2 = 1./12*9*(3./4)**3+6.75*(7.295-3.156)**2; #in**4
#For composite area
Ix = Ix1+Ix2; #in**4
print "Moment of inertia Ix = %.2e in**4 "%(Ix);
#Radius of gyration
kx = math.sqrt(Ix/sumA); #mm
print "Radius of gyration is kx = %.1f in"%(kx);
import math
#Given
r = 90.; #mm, radius of half circle
b = 240.; #mm, width
h = 120.; #mm, height
# Calculations
#Moment of inertia of recmath.tangle
Ixr = 1./3*b*h**3; #mm**4
#Moment of inertia of half circle
a = 4*r/(3*math.pi); #mm
b = h-a; #mm, Dismath.tance b from centroid c to X axis
I_AA = 1./8*math.pi*r**4; #mm**4, Moment of inertia of half circle with respect to AA'
A = 1./2*math.pi*r**2; #mm**2, Area of half circle
Ix1 = I_AA-A*a**2; #mm**4, Parallel axis theorem
Ixc = Ix1+A*b**2; #mm**4, Parallel axis theorem
#Moment of inertia of given area
Ix = Ixr-Ixc; #mm**4
# Results
print "Moment of inertia of area about X axis is Ix = %2.2e mm**4"%(Ix);
import math
# Given Data
Ix = 10.38; #in**4,Moment of inertia about x axis
Iy = 6.97; #in**4,Moment of inertia about y axis
# Calculations and Results
Ixy = -3.28+0-3.28
print (Ixy) #in in**4
#Principal axes
tan_2_theta_m = -(2*Ixy)/(Ix-Iy)
two_theta_m = math.degrees(math.atan(tan_2_theta_m))
theta_m = two_theta_m/2
print "Orientation of principle axes of section about O is Theta_m = %.1f degree "%(theta_m);
#Principle moment of inertia, eqn 9.27
Imax = (Ix+Iy)/2+math.sqrt(((Ix-Iy)/2)**2+Ixy**2); #mm**4
Imin = (Ix+Iy)/2-math.sqrt(((Ix-Iy)/2)**2+Ixy**2); #mm**4
print "Principle moment of inertia of section about O are Imax = %.2e in**4 Imin = %.0e in**4"%(Imax,Imin);
#answer difference is due to roundoff