I have three classes, the third one depends on the values of the other two (depends on E
of class Material
and A
, Ix
, Iu
and Iz
of class Geometria
. I know I need to fix the 3rd class, but I do not know how (or even if what's there is right).
class Material(object):
def __init__(self, nome, E, ni):
self.nome = nome
self.E = E
self.ni = ni
class Geometria(object):
def __init__(self, nome):
self.nome = nome
self.A = 0.
self.Ix = 0.
self.Iy = 0.
self.Iz = 0.
self.chi = 0.
def retangular(self, b, h):
self.A = b * h
self.Iz = b * h ** 3 / 12.
self.Iy = h * b **3 / 12
self.Ix = ( 1 / 3 - 0.21 * b / h * ( 1 - b ** 4 / ( 12 * h ** 4 ) ) ) * h * b ** 3
self.chi = 1.2
class SecTrans(Material, Geometria):
def __init__(self, E, A, Iz, Iy, Ix):
self.EA = E*A
self.EIz = E*Iz
self.EIy = E*Iy
self.EIx = E*Ix