\begfile{TwoSidedPlane.tex of April 18, 1984 6:24:50 am PST --- Stolfi}
% Elucubrations on the 2SP for the Kinetic Framework paper (FOCS '83)
\begintitles
\title{The Two-Sided Plane}
\author{Jorge Stolfi}
\abstract{The two-sided plane (2SP) is an extension of the Euclidean plane to include the points at infinity, which allows us to define both the notion of oriented line and a perfect duality between points and lines.\par
The 2SP can be inerpreted as a two-sided covering of the classical projective plane. Its geometry is isomorphic to that of the points and great circles on the surface of the sphere; the mapping between the two is established by a slightly modified form of central projection. The elements of the 2SP have a natural and elegant representation in terms of homogeneous coordinates. In fact, for many applications in computational geometry the 2SP is a more convenient domain than the Euclidean, projective, or inversive geometries.}
\endtitles

% ADDITIONAL MACROS
% special macros
\input GeoMacros \input KineMacros
\def\em{\bf}
\def\S#1{{\sphere^{#1}}}
\def\bv#1{{{\bf e}←{#1}}}
% search macros
\input SearchMacros
% bibliography tags
\def\Cox{Cox}
\section{\Sec1. Introduction}
% Begin
A natural duality between points and lines in the Cartesian plane has long been known to geometers [\Cox]. Under this duality a point with coordinates $(a, b)$ corresponds to the line with equation $ax+by+1=0$. The point and the corresponding line are called {\it dual} of each other. Geometrically, if $d$ is the distance from the origin $O$ to point $p$, the dual $p\star$ of $p$ is the line perpendicular to $Op$ at distance $1/d$ of $O$ and placed on the other side of $O$ (see figure 8.1).
\fig3cm{}{Figure 2.1. A point and its dual line.}
In order to handle all cases, this definition requires that the plane be extended (by the addition of points at infinity) in such a way that it becomes topologically equivalent to a non-orientable surface, the so-called {\it projective plane}. As a consequence of this non-orientability, there is no consistent way to define the ``left side'' of an oriented line, or to define a ``counterclockwise sense of rotation'' for all points of the plane. In particular, this classical dualization prevents us from giving unique and unambiguous duals for all moves and turns.
We solve this problem by using a different extension of the plane, that is endowed with the topology of a sphere (and therefore is orientable). Informally speaking, this extension consists in distinguishing a point on the ``top'' side of the plane from its {\it antipode}, a point with same position but on the ``bottom'' side of the plane. For such a point, the meaning of ``counterclockwise'' is defined with respect to an observer standing on the same side of the plane. So, if a car describes a counterclockwise loop on the top side of the plane, a second car on the bottom side that passes through the same positions in the same order will describe a clockwise loop. We call this extension the {\it two-sided plane} (2SP). One can view this construction algebraically by using homogeneous coordinates, in which a triplet $\hop{x,y\hom w}$ of reals numbers is used to represent the point with Cartesian coordinates $(x/w, y/w)$. In classical homogeneous coordinates we identify the points $\hop{x,y\hom w}$ and $\hop{\lambda x, \lambda y\hom \lambda w}$ for each real $\lambda0$. In the new manifold we only do so if $\lambda>0$. If $\lambda$ is negative, the point $\hop{\lambda x, \lambda y\hom \lambda w}$ is the antipode of the point $\hop{x,y\hom w}$.
A straight line extends to both sides of the 2SP, and therefore it passes through a point if and only if it passes through its antipode. An oriented line has the same direction vector on both sides; however, since the notions of ``left'' and ``right'' are relative to a local observer, a point is to the left of an oriented line $\lscr$ if and only if its antipode is to the right of $l$. The left and right ``half-planes'' of $l$ are well-defined concepts, and their union is the whole 2SP minus the line $l$.
By working on the 2SP, we can define the duality between points and lines so as to preserve relative orientations. Under this mapping, a point $p$ is transformed to an {\it oriented} line $p\star$, and vice versa: the line $p^\ast$ is oriented counterclockwise (as seen from the origin $O$) if and only if $p$ lies on the top side of the plane\foot\dag{The dual of a line passing through the origin is a {\it point at infinity}, and the dual of the origin is the {\it line at infinity}.}. It follows from this construction that a point $p$ lies to the left of an oriented line $l$ if and only if the dual point $l\star$ lies to the left of the line $p\star$.
This duality extends nicely to states, moves, and turns. The dual of a state is a state, the dual of a move is a turn, and the dual of a turn is a move. A move is forward if and only if its dual turn is counterclockwise. The point where the dual turn occurs is the dual of the tangent to the move; it will be on the top side of the plane if and only if the move is oriented counterclockwise as seen from the origin. If we take the dual of every move and turn of a tracing, the result will be another tracing, the {\it dual} of the first.
The concept of duality is another powerful tool for the study of tracings and for the description, analysis, and construction of algorithms dealing with them. By applying it to theorems, proofs, operations, and algorithms we can obtain twice as many results with practically the same effort. For example, an algorithm for computing the convex hull of $n$ points in the plane {\it automatically} becomes an algorithm for computing the intersection of $n$ half-planes. One fact that makes this technique even more valuable is that certain problems are much easier to visualize in one of the two domains than in the other.
Many of the concepts, operations, theorems, and algorithms given above have important dual versions. For example, winding numbers are the duals of degrees: $\wi(p, A)=\dg(p^\ast, A\star)$. The dual of the sweep number is the {\it crossing number} $\kr(l, A)=\sw(l\star, A\star)$, which is a signed count of how many times the tracing $A$ crosses the line $l$. The {\it dual product} of two tracings $A$ and $B$, mentioned in section 4.6, is defined as $A\dpr B=(A\star\cdot B\star)\star$. While computing $A\cdot B$ we insert new turns where two moves pass through the same point; in $A\dpr B$ we add new moves connecting vertices of $A$ and $B$ wherever two turns pass through the same oriented line. Thus we see the duality between the operations of intersection and convex hull.
The geometric dual of a convex polygon which encloses the origin can be defined in the classical projective plane, and has in fact been used by several authors. However, we believe that the 2SP and the concept of tracing as we defined here are the simplest formalism that allows that concept to be extended to arbitrary polygons. It is instructive to consider the example of a convex tracing that does not enclose the origin (figure 8.2). Note that the dual tracing contains points on both sides of the plane, since the original contains both counterclockwise- and clockwise-oriented moves; in particular, the vertex $1\star$ is on top, and $2\star$ is on the bottom. The move $1\star2\star$ follows the shortest possible route, namely the straight line segment connecting those two points, which turns out to be the two rays (one on top and one on the bottom) shown in the figure. If the distinction between top and bottom is ignored, there does not seem to be any simple way of interpreting the dual figure as a convex polygon. As a tracing on the 2SP, however, the dual is a perfectly valid convex polygon. Its interior $R$ consists of the hatched region on the top side of the plane, plus the dotted region on the bottom. For any two points $u,v$ in $R$, the segment $uv$ (with the convention mentioned above) lies entirely in $R$.
\fig4cm{}{Figure 8.2. A convex tracing and its dual.}
\section{\Sec2. Axiomatic definition}
\section{\Sec3. The spherical model}
\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.
\section{\Sec5. Combine this with the above:}
\subsection{\Sec1.1. Points and lines}
The Cartesian unit sphere $\S2$ consists of all vectors of $\reals^3$ with unit length. A non-zero vector $v=(x,y,z)$ is said to {\it represent} the normalized (unit) vector $v/\left| v\right|$, which is denoted by $[v]$ or $[x,y,z]$. Therefore, two non-zero vectors $(x,y,z)$ and $(x',y',z')$ represent the same point of $\S2$ if and only if we have $x'=\alpha x$, $y'=\alpha y$, and $z'=\alpha z$ for some {\em positive} number $\alpha$. The points $[x,y,z]$ and $[-x,-y,-z]$ are distinct, and are said to be {\it antipodes} of each other.
An {\it oriented line} on the unit sphere is one of the great circles of $\S2$, together with one of its two possible orientations\foot\dag{In figures, the orientation of a line will be denoted by a solid arrowhead ($\rpoint$)}. An oriented line divides the sphere in two {\it sides} or hemispheres, named {\it left} and {\it right} as from the point of view of an observer on the outside of $\S2$, with the feet on the line and facing along its orientation. Any any non-zero vector $V=(X,Y,Z)$ of $\reals^3$ is said to {\it represent} the unique oriented line, denoted by $\la V\ra$ or $\la X,Y,Z\ra$, that lies in a plane perpendicular to $V$ and is oriented counterclockwise around $V$. Conversely, any oriented line can be represented as $\la V\ra$, where $V$ is any non-zero vector perpendicular to the plane of the line and pointing towards its left hemisphere. Therefore, two non-zero vectors $(X,Y,Z)$ and $(X', Y', Z')$ correspond to the same line if and only if $X'=\alpha X$, $Y'=\alpha Y$, $Z'=\alpha Z$ for some {\it positive} real number $\alpha$.
\subsection{\Sec1.2. Line-point distance}
The {\it signed distance} between a line $L=\la X,Y,Z\ra$ and a point $p=[x,y,z]$ is by definition $\sdist(L,p)=L\star\cdot p=[X,Y,Z]\cdot[x,y,z]$. This quantity is the sine of the angle between the vector $(x,y,z)$ and the plane of $L$: it is positive, negative, or zero, depending on whether $p$ is to the left of $L$, to the right of $L$, or on $L$, respectively.
\subsection{\Sec1.3. Duality}
For any oriented line $L=\la V\ra$, we define its {\it dual} $L\star$ as being the point $[V]$ (the center of the left hemisphere of $L$) Analogously, we define the {\it dual} of a point $p=[v]$ as being the line $p\star=\la v\ra$. Since $\sdist(L,p)=\sdist(p\star, l\star)$, the duality mapping preserves incidence and the ``sideness'' relations: a point $p$ lies on (resp. to the left of) a line $L$ if and only if the point $L\star$ lies to the left of the line $p\star$. Note also that $\sdist(p\star, p)=\sdist(L,L\star)=1$ for any line $L$ and any point $p$.
\subsection{\Sec1.4. Angular distance}
The {\it angular distance} $\adist(p,q)$ between two points $p=[u]$ and $q=[v]$ of $\S2$ is by definition the angle (in radians) whose co-sine is $[u]\cdot[v]$. This is the angle between the two vectors $u$ and $v$, reduced to the interval $[0\sp\pi]$. In particular, $\adist(p,q)$ is $0$ when the two points coincide, is $\pi\over2$ when they are orthogonal (so that $p$ lies on the line $q\star$, and vice-versa), and is $\pi$ when one is the antipode of the other. The metric $\adist$ gives $\S2$ the same topological structure as the usual Euclidean distance.
The {\it angular distance} $\adist\star(K,L)$ between two lines $K,L$ of $\S2$ is by definition the angular distance between their dual points. So, $\adist\star(K,L)$ is $0$ when the two lines are equal, $\pi\over2$ when they intersect perpendicularly, and $\pi$ when they are the opposite of each other. The set of all lines, with the topology induced by the $\adist\star$ metric, is a two-dimensional manifold ${\S2}\star$ homeomorphic to $\S2$.
\subsection{\Sec1.5. Vector product}
The vector product of two vectors $p$ and $q$ will be denoted by $p\cdot q$. Given two points $p=[u],q=[v]$ on $\S2$ that are neither equal nor antipodal to each other, there are exactly two oriented great circles of $\S2$, opposite of each other, that pass through both $p$ and $q$. The one that goes from $p$ to $q$ by the shortest arc is called the {\it line from $p$ to $q$}, and is given by the formula $\la p\times q\ra$. Note that the line from $q$ to $p$ is the opposite of that from $p$ to $p$.
Similarly, two lines $L=\la u\ra$ and $R=\la v\ra$ that are neither equal not opposite to each other have exactly two common points, that are antipodal of each other. We define the {\it vertex from $L$ to $R$} as being the one where the angle from the direction of $L$ to the direction of $R$ is counterclockwise and less than $180\deg$. This point is given by the formula $[u\times v]$.
\subsection{\Sec1.6. Projective trnasformations the sphere}
A non-singular linear function $M$ of $\reals^3\mapsto\reals^3$ defines a non-singular function $[M]$ of $\S2\mapsto \S2$ by the formula $[v]^{[M]}=[v^M]$ where $p$ is any point on $\S2$ (observe that for such map $M$ we always have $[u]=[v]$ if and only if $[u^M]=[v^M]$). A map $[M]$ obtained in this way is called a {\it projective transformation}.
If three points of $\S2$ lie on a subspace $X$ of $\reals^3$, then their images under $[M]$ will lie on the subspace $X^{[M]}$. Therefore, if the three points lie on a great circle of $\S2$, their images will also lie on some great circle.
{\bf STOPPED HERE September 29, 1983 12:47 am}
$[M]$ maps antipodal pairs to antipodal pairs, and mapf two $[M]$ maps great circles be coplanarthat is The image of an oriented line $L$ of $\S2$ under a map $M$ is by definition the oriented line $L^M$ such that a point $p$ lies on (resp. to the left of) $L$ if and only if $P^M$ lies on (resp. to th left of) the line $L^M$.
A {\it general rotation} is a linear transformation of $\reals^3$ that preserves the scalar product. That is, a linear map $R$ is a rotation if and only if we have $u^R\cdot v^R = u\cdot v$ for all $u,v\in\reals^3$.
Rotations can be
\subsection{\Sbsec{\Sec2.0} Tracings on the sphere}
This section develops the theory of tracings on the Cartesian unit sphere $\S2$. Working on the unit sphere makes the algebra much simpler, and makes duality a very natural operation. Central projection on the plane $z=1$ of $\reals^3$ defines a geometrical isomorphism of the oriented unit sphere and the two-sided plane (2SP), which preserves lines, points and sideness relations. Via this projection, we get automatically a definition for tracings on the 2SP, and these turn out to satisfy many of the properties of spherical tracings, namely those that depend only on incidence and sideness. In general properties that depend on the numerical value of distances and angles (as opposed to their signs) require some revision.
A similar theory can be developed for tracings on the Euclidean plane, except that we lose the notion of duality, and many definitions become asymetrical.
\subsection{\Sec2.1 The state manifold.}
We define a {\it state} $s$ as a pair consisting of a pair of orthogonal elements of $\S2$, $\po s$ (the {\it position} of $s$) and $\ta s$ (the {\it normal} of $s$. The {\it tangent line} of $s$ is the oriented line ${\ta s}\star$, which passes through $\po s$. The {\it orientation} of the state, $\di s$, is the unit vector parallel to the orientation of the tangent ${\ta s}\star$ at the point $\po s$, which is given by $\ta s\times\po s$. A state can be thought of as describing the instantaneous position $\po s$ of a car on the outer surface of the sphere, and the direction $\di s$ along which the hood of the car is facing.
The three vectors $\ta s$, $\po s$ and $\di s$, in that order, constitute a right-handed orthonormal basis of $\reals^3$, the {\it local frame} of the state. There is exactly one rotation $\lbb s\rbb$ that maps the standard basis $\bv1,\bv2,\bv3$ to $\ta s,\po s,\di s$; its matrix is
$$\left[\;\matrix{
\po s\cdot\bv1 & \po s\cdot\bv2 & \po s\cdot\bv3\cr
\ta s\cdot\bv1 & \ta s\cdot\bv2 & \ta s\cdot\bv3\cr
\di s\cdot\bv1 & \di s\cdot\bv2 & \di s\cdot\bv3\cr}\;\right]$$
The concept of a state is therefore equivalent to that of a right-handed orthonormal basis, and therefore to that of a positive rotation. The set $\states$ of all states, with the topology established by the total angular distance (defined below), is a three-dimensional manifold homeomorphic to the manifold of all positive rotations of $\reals^3$. This topology is the same as that induced by the product topology of its superset $\S2\times\S2\star$. {\bf Prove!} \foot\ddag{What is that topology? It doesn't seem to be $\S2\times \S1$.}.
Given two states $r,s$, there is exactly one rotation that takes $r$ into $s$, namely {\bf check!}
$$\lbb r\rbb^{-1}\lbb s\rbb=\left[\;\matrix{
\po s\cdot\po r&\po s\cdot\ta r&\po s\cdot\di r\cr
\ta s\cdot\po r&\ta s\cdot\ta r&\ta s\cdot\di r\cr
\di s\cdot\po r&\di s\cdot\ta r&\di s\cdot\di r\cr}\;\right]R^{-1}.
$$
The {\it total distance} between those two states is the angle by which $\lbb r\rbb^{-1}\lbb s\rbb$ rotates around its axis. This distance is expressed in radians and is always a number between $0$ and $\pi$, inclusive. {\bf Give formula!}
\par\vfill\eject\end