Channels ▼  Open Source  The PolyArea Project: Part 1  Poly Area
Architecture and Organization  The architecture focuses on
separating the UI code from the algorithmic code to accomodate
testing and also potential replacement of the low-level graphic
library (PyGame). In addition, there is a little module called
that lets users configure the look-and-feel.  There are three
modules in the algorithmic core:    • The polygon module is
responsible for the main algorithm. It has a custom Polygon
class that provides some important methods used by the
calc_polygon_area() function and its support functions:
find_Second_top_point() and remove_top_triangle(). It uses
functions from the triangle and helpers modules.   • The
triangle module contains two functions: herons_formula() and
calc_triangle_area(). It also has two test functions:
test_herons_formula() and test_calc_triangle_area(). This is a
good example of bottom up programming. It is a very small bit of
functionality (calculating the area of a triangle) encapsu