#include <CGAL/Homogeneous.h>
As we mentioned before, homogeneous coordinates permit to avoid division operations in numerical computations, since the additional coordinate can serve as a common denominator. Avoiding divisions can be useful for exact geometric computation. With Homogeneous<RT> you can choose homogeneous representation of coordinates with the kernel objects. As for Cartesian representation you have to declare at the same time the type used to store the homogeneous coordinates. Since the homogeneous representation allows one to avoid the divisions, the number type associated with a homogeneous representation class must be a model for the weaker concept ring type only. However, some operations provided by this kernel involve division operations, for example computing squared distances or returning a Cartesian coordinate. To keep the requirements on the number type parameter of Homogeneous low, the number type Quotient<RT> is used instead. This number type turns a ring type into a field type. It maintains numbers as quotients, i.e. a numerator and a denominator. Thereby, divisions are circumvented.
A variable declaration for a point at Cartesian coordinates represented with homogeneous coordinates with ring type double then looks as follows:
Point_2< Homogeneous<double> > p(1.0, 5.0, 3.0);
With Homogeneous<NT>, Homogeneous<NT>::FT is equal to Quotient<NT> while Homogeneous<NT>::RT is equal to NT.