Algorithmic Solutions > LEDA > LEDA Guide > Geometry > Cartesian and Homogeneous Coordinates

## Cartesian and Homogeneous Coordinates

We assume that the ambient space is equipped with the standard Cartesian coordinate system and specify points by their Cartesian coordinates.

The Cartesian coordinates of a point in the plane are a pair (x,y).

The homogeneous coordinates of a point in the plane are a triple (x,y,w) with w!=0. The Cartesian coordinates of a point with homogeneous coordinates (x,y,w) are (x/w,y/w).

Remark: We notice that the homogeneous coordinates of a point are not unique. Two triples that are multiples of each other specify the same point.

The Cartesian coordinates of a point are of type double in the floating point kernel and of type rational in the rational kernel. The homogeneous coordinates of a point in the rational kernel are of type integer. Points in the floating point kernel are stored by their Cartesian coordinates.

For points in the rational kernel it is more efficient to store them by their homogeneous coordinates, i.e., to use the same denominator for x- and y-coordinate.

For compatibility also points in the floating point kernel have homogeneous coordinates (x,y,1.0). These homogeneous coordinates are of type double.

Data Types for 2D Geometry

Rational

Integer

Geometry

Number Types