Almost all the kernel objects (and the corresponding functions) are templates with a parameter that allows the user to choose the representation of the kernel objects. A type that is used as an argument for this parameter must fulfill certain requirements on syntax and semantics. The list of requirements defines an abstract concept which is called a representation class in CGAL and denoted by R throughout this manual. The complete list of requirements is beyond the scope of this introduction. It is important only if you want to define your own representation class. It is sufficient to know that a representation class provides the actual implementations of the kernel objects.
CGAL offers two families of concrete models for the concept representation class, one based on the Cartesian representation of points and one based on the homogeneous representation of points. The interface of the kernel objects is designed such that it works well with both Cartesian and homogeneous representation, for example, points in 2D have a constructor with three arguments as well (the three homogeneous coordinates of the point). The common interfaces parameterized with a representation class allow one to develop code independent of the chosen representation. We said ``families'' of models, because both families are parameterized too. A user can choose the number type used to represent the coordinates.
For reasons that will become evident later, a representation class provides two typenames for number types, namely R::FT and R::RT. The type R::FT must fulfill the requirements on what is called a field type in CGAL. This roughly means that R::FT is a type for which operations , , and are defined with semantics (approximately) corresponding to those of a field in a mathematical sense. Note that, strictly speaking, the built-in type int does not fullfil the requirements on a field type, since ints correspond to elements of a ring rather than a field, especially operation is not the inverse of . The requirements on the type R::RT are weaker. This type must fulfill the requirements on what is called a ring type in CGAL. This roughly means that R::RT is a type for which operations , , are defined with semantics (approximately) corresponding to those of a ring in a mathematical sense. A very limited division operation must be available as well. It must work for exact (i.e., no remainder) integer divisions only. Furthermore, both number types should fulfill CGAL's requirements on a number type. Note that a ring type is always a field type but not the other way round.
We describe below the two representations provided for CGAL kernel objects, namely Cartesian and Homogeneous.