By choosing a type such as double to represent the coordinates of a point, the Point class and all accompanying classes are forever sealed at that precision. Yet another application may need to use an identical set of classes at a different precision, perhaps float, long double, or a rational number type from the GMP library such as mpq class. This chapter discusses how the genericity of C++ can be used to design classes that delay the decision of the number type used for coordinates. Such a delay increases the chance that multiple systems could be developed based on the same set of foundational geometric classes.
It is best to read Chapters 6 and 7 simultaneously, perhaps by reading either of the two chapters before and after the other.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2008 Springer-Verlag London Limited
About this chapter
Cite this chapter
(2008). Genericity in Geometric Computing. In: Introduction to Geometric Computing. Springer, London. https://doi.org/10.1007/978-1-84800-115-2_6
Download citation
DOI: https://doi.org/10.1007/978-1-84800-115-2_6
Publisher Name: Springer, London
Print ISBN: 978-1-84800-114-5
Online ISBN: 978-1-84800-115-2
eBook Packages: Computer ScienceComputer Science (R0)