ABSTRACT

This chapter weaves together a number of related stories of common formulation, both mathematical and in code, that unfold at a moment that our primary focus returns again to geometry, and to two entities which are staples in any computational geometry library: lines and planes. Lines and planes are a natural mathematical pair. Inheritance allows related objects to be tied together under a common formulation, with common methods and members, while also providing the flexibility to make distinctions between them. Comparison of LinearEntities fall into two categories: general relations that are valid for any sub-type of LinearEntity and those relationships that are only valid when considering two of the same sub-type. It is possible to design a mechanism to prevent users from instantiating a LinearEntity object by raising an error in the superclass contructor, and then catching this error in each of the subclass constructors.