Pyramid constructor

init

Construct a new pyramid instance with default bottom area(10, 10) and default height(5)

def __init__(self):
    ...

init

Construct a new pyramid instance with specified bottom area

def __init__(self, xbottom, ybottom, height):
    ...
ParameterTypeDescription
xbottomfloatThe x-direction length of the bottom
ybottomfloatThe y-direction length of the bottom
heightfloatThe height of the pyramid

init

Construct a new pyramid instance with specified bottom area and top area and height.

def __init__(self, xbottom, ybottom, xtop, ytop, height):
    ...
ParameterTypeDescription
xbottomfloatThe x-direction length of the bottom area
ybottomfloatThe y-direction length of the bottom area
xtopfloatThe x-direction length of the top area
ytopfloatThe y-direction length of the top area
heightfloatThe height of the pyramid

init

Construct a new pyramid instance with specified bottom area and top area and height.

def __init__(self, name, xbottom, ybottom, xtop, ytop, height):
    ...
ParameterTypeDescription
namestrThe name of the pyramid
xbottomfloatThe x-direction length of the bottom area
ybottomfloatThe y-direction length of the bottom area
xtopfloatThe x-direction length of the top area
ytopfloatThe y-direction length of the top area
heightfloatThe height of the pyramid

See Also