\section{\Sec4. The 2SP in homogeneous coordinates}
% Begin
\note{This section is a slightly edited version of the comments in COGHomo2.mesa}
A point of the Two-Sided Plane (2SP) {\smallsize\rm (Homogeneous plane? Homoplane?)} is represented in homogeneous coordinates by a triplet of real numbers $\hop{x,y\hom w}$, not all of them zero, with the convention that two triplets $\hop{x,y\hom w}$ and $\hop{x', y'\hom w'}$ represent the same point iff we have $x=\alpha x'$, $y=\alpha y'$, and $w=\alpha w'$ for some {\em positive} real $\alpha $. If we view each triplet $\hop{x,y\hom w}$ as a point $(x,y,w)$ in $\reals^3$, then each point of the 2SP corresponds to an open ray in $\reals^3$ emanating from the origin $(0,0,0)$, and vice-versa.
The {\it homogeneous distance} between two points $p=\hop{x,y\hom w}$ and $q=\hop{x', y'\hom w'}$ of the 2SP is defined by
$$\hdist(p,q) = 1-{{xx' + yy' + ww'}\over
{\sqrt{x^2+y^2+w^2}\sqrt{{x'}^2+{y'}^2+{w'}^2}}}.$$ This is simply $1-\cos\theta{pq}$, where $\theta{pq}$ is the angle between the rays corresponding to the two points.
Each point $p$ of the 2SP has a unique {\it normalized representation}, a triplet $\hop{x,y\hom w}$ where $x^2+y^2+w^2=1$. This triplet corresponds to the point $(x,y,w)$ in $\reals^3$ where the ray corresponding to $p$ hits the surface $\sphere^2$ of the three-dimensional unit sphere. If $\hop{x,y\hom w}$ and $\hop{x', y'\hom w'}$ are the normalized representations of $p$ and $q$, then $\hdist(p,q)=1-xx' + yy' + ww'$. Clearly, the 2SP with the topology induced by the $\hdist$ metric is homeomorphic to the surface $\sphere^2$ of the three-dimensional unit ball, with the usual topology.
An (oriented) line of the 2SP is also represented by a triplet $\hol{X, Y\hom W}$ of real coordinates, not all three zero. We say that a point $\hop{x,y\hom w}$ lies on that line, to its left, or to its right, depending on whether $Xx+Yy+Ww$ is zero, positive, or negative. We say that a line passes to the left of a point iff the point lies to the left of the line, and vice-versa. {\smallsize\rm Should it be the other way around?}
The {\it natural correspondence} between the 2SP and the oriented Cartesian plane is defined in the following way: to the point $\hop{x,y\hom w}$ there corresponds the point $(x/w,y/w)$; to the line $\hol{X,Y\hom W}$ there corresponds the oriented line with equation $Xx+by+W=0$ and left side defined by the normal direction vector $(X,Y)/\sqrt{X^2+Y^2}$. This correspondence is not defined for the points with $w=0$ or for the lines with $X=Y=0$. This is equivalent to the central projection of the unit sphere $\sphere^2$ onto the plane $z=1$.
The natural image $L$ of a line $\hol{X,Y\hom W}$ passes at distance $W/\sqrt{X^2+Y^2}$ from the Cartesian origin $(0,0)$. The longitudinal orientation of $L$ (that is, the direction in which we must face so that the left side of $L$ lies to our left) is the vector $(Y, -X)/\sqrt{X^2+Y^2}$. It follows that $L$ is oriented counterclockwise as seen from the origin iff $W>0$. If $W=0$, $L$ passes through $(0,0)$. The two lines $\hol{X,Y\hom W}$ and $\hol{-X,-Y\hom -W}$ map onto the same Cartesian line with opposite orientations; they are said to be the opposite of each other. Two lines $\hol{X, Y\hom W}$ and $\hol{X, Y\hom W'}$ are said to be parallel, while $\hol{X,Y\hom W}$ and $\hol{-X,-Y\hom W'}$ are antiparallel.
The points $\hop{x,y\hom w}$ with $w>0$ constitute the {\it top side} of the 2SP. The natural correspondence defines an isomorphism between the top side of the 2SP and the oriented Cartesian plane: open sets map to oppen sets, and $\hop{x,y\hom w}$ is on or to the left of $\hol{X,Y\hom W}$ if and only if the same relation holds for their natural images.
The bottom side of the 2SP, also called the "antiplane", consists of the points with $w<0$. The natural correspondence also maps the bottom side one-to-one onto the Cartesian plane, taking open sets into open sets, but it falls short of being an isomorphism: a point $\hop{x,y\hom w}$ on the bottom side lies to the left of a line $\hol{X,Y\hom W}$ if and only if the corresponding point lies to the {\it right} of the corresponding line.
The points $\hop{x,y\hom w}$ and $\hop{-x,-y\hom -w}$ of the 2SP that map onto the same Cartesian point $(x/w, y/w)$ are said to be the antipodes of each other. A line that passes through a point also passes through its antipode. The top origin of the 2SP is the point $\hop{0,0\hom 1}$ (and its positive multiples); its antipode $\hop{0,0\hom -1}$ is called the bottom origin. Under the natural correspondence, both are mapped to the Cartesian origin $(0,0)$. A line $\hol{X, Y\hom W}$ passes through the top (and bottom) origin iff $W=0$.
We can imagine that a point $\hop{x,y\hom 0}$ of the 2SP corresponds to a point at infinite distance from the origin in the in the direction (x,y). Note that $\hop{x,y\hom 0}$ is distinct from $\hop{-x,-y\hom 0}$. That point lies on all lines of the form $\hol{-y, x\hom W}$ for all $W$. The lines $\hol{0,0\hom 1}$ and $\hol{0,0\hom -1}$ are the two lines at infinity of the 2SP, and consist of exactly all the points at infinity. The left side of $\hol{0,0\hom 1}$ is the entire top side of the 2SP, whereas that of $\hol{0,0\hom -1}$ is the bottom side.
The triplets $\hop{0, 0\hom 0}$ and $\hol{0,0\hom 0}$ are called the indeterminate point and indeterminate line, respectively. They are not considered to be true elements of the 2SP, but they are returned by many operations in this interface when the latter are applied to invalid combinations of arguments. For example, the procedure that computes the intersection of two lines returns $\hop{0,0\hom 0}$ when the lines are coincident. Many operations will return $\hop{0,0\hom 0}$ or $\hol{0,0\hom 0}$ if one or more of the arguments is $\hop{0,0\hom 0}$ of $\hol{0,0\hom 0}$. However, in some cases an arithmetic trap (divide by zero, or such) will result instead, so be careful.
The set of all points on the 2SP lying on an oriented line $\hol{X, Y\hom W}$ is homeomorphic to the unit circle $S1$. The orientation of the line defines a cyclical ordering of the points lying on it: given any three points $p1,q,p2$, on $L$, we can tell whether $q$ lies on the way from $p1$ to $p2$ along $L$ (HOW?). The set of all $q$'s on $L$ on the way from $p1$ to $p2$ constitutes by definition the {\it arc of $L$ from $p1$ to $p2$}. An arc is {\it proper} if no two of its points (including the extremities) are antipodes of each other.
If $p1$, $p2$ are two distinct, non-antipodal points of the 2SP, there are exactly two lines $L1$, $L2$ passing through those two points, and they are opposite to each other. We define the {\it oriented line $p1p2$} as being the one such that its arc from $p1$ to $p2$ is proper. Informally, the line $p1p2$ as the one that goes from $p1$ to $p2$ by the shortest way. The oriented line $p2p1$ is the opposite of the line $p1p2$ (or both are undefined). The {\it line segment connecting $p1$ and $p2$}, or simply the {\it segment $p1p2$}, is the (proper) arc from $p1$ to $p2$ on the line $p1p2$.
Two lines $L1$, $L2$ of the 2SP that are not coincident or opposite of each other meet at exactly two antipodal points. Those points will be both at infinity if the lines are parallel; if not, they are both finite.
The point $\hop{x,y\hom w}$ and the line $\hol{x,y\hom w}$ are dual of each other. If the point $p$ lies on (resp. to the left of) the line $L$, then the point $L$* that is dual of $L$ lies on (resp. to the left of) the line $p*$ that is dual of $p$. Two points are antipodal of each other iff theis duals are opposite lines.
Therefore, If $L1, L2$ are not coincident or opposite of each other, their dual points $L1*$ and $L2*$ define a unique oriented line $L1*L2*$ passing through both points. The dual $(L1*L2*)*$ of this line is a point that lies on both $L1$ and $L2$, and is by definition the intersection point $L1L2$. Note that the point $L2L1$ is the antipode of the point $L1L2$
Two lines $L1$, $L2$ of the 2SP that are not coincident or opposite of each other meet at exactly two antipodal points. Those points will be both at infinity if the lines are parallel; if not, they are both finite. We define the intersection $p$ of $L1$ and $L2$ (in that order) as the one of those two points such that we can get $L2$ by rotating $L1$ counterclockwise around $p$ by less than $180$ degrees.
The homogeneous distance between two lines is defined as the homogeneous distance between their duals.