Pyramid constructor

__init__(self)

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


def __init__(self):
    ...

__init__(self, xbottom, ybottom, height)

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__(self, xbottom, ybottom, xtop, ytop, height)

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__(self, name, xbottom, ybottom, xtop, ytop, height)

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