Summary:
The main target of this diploma thesis is the development of a “geometric
idiom” for Python which will enrich the algorithmic pseudo-code, such as those
in Computational Geometry documentation, with the execution capability and the
development of an environment that will support the courses of Computational
Geometry. Unfortunately, most decimal fractions cannot be represented as binary
fractions. For cases which require exact representation, the decimal module is
available. In an effort to simplify the process, a new arithmetic type is
developed, which supplements the floating point arithmetic. This type redefines
all the arithmetic operations and predefines the precision in order to avoid
any representation or rounding error. A “pure Python” geometric library, while
offering a physical geometrical expression to the coding, it presents a lack in
execution speed, compared to a C++ library such as CGAL. As a proof of
correctness for this “pure Python” geometric library, the available version of
CGAL bindings are used. Using the article of Kettner et al. as a point of
reference to the possible failures caused by the floating –point arithmetic,
respective test cases have been introduced, so as to verify the exactness of
the results.
Keywords:
Python, Floating-Point, Decimal, Precision, Computational Geometry