1. Introduction and Summary of Results
Polylines arise in Geographical Information Science (GIS) in a multitude of ways. One recent example comes from the collection of moving object data, where trajectories of moving persons (or animals), that carry GPS-equipped devices, are collected in the form of time-space points that are registered at certain (ir) regular moments in time. The spatial trace of this movement is a collection of points in two-dimensional space. There are several methods to extend the trajectory in between the measured sample points, of which linear interpolation is a popular method [
1]. The resulting curve in the two-dimensional geographical space is a
polyline.
Another example comes from shape recognition and retrieval, which arises in domains, such as computer vision, image analysis and GIS, in general. Here, closed polylines (where the starting point coincides with the end point) or polygons, often occur as the boundary of two-dimensional shapes or regions. Shape recognition and retrieval are central problems in this context.
In examples, such as the above, there are, roughly speaking, two very distinct approaches to deal with polygonal curves and shapes. On the one hand, there are the
quantitative approaches and on the other hand there are the
qualitative approaches. Initially, most research efforts have dealt with the quantitative methods [
2,
3,
4,
5]. Only afterwards, the qualitative approaches have gained more attention, mainly supported by research in cognitive science that provides evidence that qualitative models of shape representation are much more expressive than their quantitative counterpart and reflect better the way in which humans reason about their environment [
6]. Polygonal shapes and polygonal curves are very complex spatial phenomena and it is commonly agreed that a qualitative representation of space is more suitable to deal with them [
7].
Within the qualitative approaches to describe two-dimensional movement or shapes, two major approaches can be distinguished: the region-based and the boundary-based approach. The
region-based approach, using concepts such as circularity, orientation with respect to the coordinate axis, can only distinguish between shapes with large dissimilarities [
8]. The
boundary-based, using concepts such as extremes in and changes of curvature of the polyline representing the shape, gives more precise tools to distinguish polylines and polygons. Examples of the boundary-based approaches are found in [
7,
8,
9,
10,
11,
12,
13].
The principles behind qualitative approaches to deal with polylines are also related to the field of spatial reasoning.
Spatial reasoning has as one of its main objectives to present geographic information in a qualitative way to be able to reason about it (see, for example, Chapter 12 in [
14]), also for spatio-temporal reasoning) and it can be seen as the processing of information about a spatial environment that is immediately available to humans (or animals) through direct observation. The reason for using a
qualitative representation is that the available information is often imprecise, partial and subjective [
15].
Qualitative spatial reasoning is a part of the broader field of
spatial reasoning and has as goals (1) to finitely represent knowledge about infinite spatial (and spatio-temporal) domains using a finite number of
qualitative relations and (2) to design computationally feasible symbolic reasoning techniques for these data. The aim of these models is to support human understanding of space. In particular, qualitative approaches aim to reflect human cognition and they offer intuitive representations of spatial situations that are nevertheless able to enable complex decision tasks. During the past decades, the qualitative spatial reasoning community has investigated several qualitative representations of spatial knowledge and reasoning techniques and their underlying computational principles, linking formal approaches to cognitive theories. For an overview of the aims and methods in this field, we refer to [
16] and [
17].
In the field of qualitative spatial reasoning several taxonomies of cognitive spatial (and spatio-temporal) concepts have been proposed and frameworks have been designed to accommodate computational techniques, useful for applications. Dozens of formalisms, in the form of, so-called,
qualitative spatial calculi have been proposed (a representative sample is discussed in [
18]). Recent examples are [
19,
20].
Only during the last decade, the field of spatial reasoning has focussed more on the applications of the developed techniques, for instance, in the area of GIS. This has lead to the insights that
semantics plays an important role and that qualitative spatial reasoning is more than
constraint-based reasoning. During the last years, also a number of toolboxes have been developed to incorporate qualitative spatial reasoning techniques in application domains such as computer-aided design, natural language processing, robot navigation [
21] and GIS. We mention the systems SparQ [
22], GQR [
23] and QAT [
24]. As an other example from GIS, qualitative calculi have also been used to analyse trajectory data of moving objects [
25].
If we return to the example of trajectory data, we can see that if a person orients her- or himself at a certain location in a city and then moves away from this location, she or he remembers her or his current location by using a mental map that takes the relative turns into account with respect to the original starting point, rather than the precise metric information about her or his trajectory. For such navigational problems, a person will for instance remember: “I left the station and went straight; passing a church to my right; then taking two left turns; ...”
One of the formalisms to qualitatively describe polylines in the plane is given by the
double-cross calculus. In this method, a
double-cross matrix captures the relative position of any two line segments in a polyline by describing it with respect to a double cross based on the starting points of these line segments. The double-cross calculus was introduced as a formalism to qualitatively represent a configuration of vectors in the plane [
15,
26]. In this formalism, the relative position (or orientation) of two (located) vectors is encoded by means of a 4-tuple, whose entries come from the set
. Such a 4-tuple expresses the relative orientation of two vectors with respect to each other. The double-cross formalism is used, for instance, in the
qualitative trajectory calculus, which, in turn, has been used to test polyline similarity with applications to query-by-sketch, indexing and classification [
27]. We elaborate on these applications in
Section 2.4. As an other example from GIS, the double-cross formalism have also been used for mining and analysing moving object data [
25]. Recently, first steps have been made to generalise the double-cross formalism to model spatial interactions in 3-dimensional space, called
, where it is used to model, for instance, flying planes. Also, the complex interactions of birds, that fly in a flock, are modelled, using this formalism. In this higher dimensional setting, the calculus is based on the transformations of the so-called Frenet-Serret frames [
28]. Other applications of the double-cross formalism and its generalisation
include the modelling of traffic situations [
29,
30].
Two polylines are called double-cross similar if their double-cross matrices are identical. Two polylines, that are quite different from a quantitative or metric perspective, may have the same double-cross matrices, as we illustrate below. The idea is that they follow a similar pattern of relative turns, which reflects how humans visualize and remember movement patterns.
In this paper, we provide an extensive algebraic and geometric interpretation of the double-cross matrix of a polyline and of double-cross similarity of polylines. To start with, we give a collection of polynomial constraints (polynomial equalities and inequalities) on the coordinates of the measured points of a polyline (its vertices) that express the information contained in the double-cross matrix of a polyline. This algebraic characterisation can be used to effectively verify double-cross similarity of polylines and to generate double-cross similar polylines by means of tools from algebraic geometry, implemented, for instance, in software packages like
Mathematica [
31]. This algebraic characterization of the double-cross matrix also allows us to prove a number of properties of double-cross matrices. As an example, we mention a high degree of symmetry in the double-cross matrix along its main diagonal.
Next, we turn to a geometrical interpretation of double-cross similarity of two polylines. This geometrical interpretation is based on local geometric information of the polyline in its vertices. This information is called the local carrier order and it uses (local) compass directions in the vertices of a polyline to locate the relative position of the other vertices. Our main result in this context says that two polylines are double-cross similar if and only if they have the same local carrier order structure.
From the definition of the doubtle-cross matrix of a polyline it is clear that this matrix remains the same if, for instance, we translate or rotate the polyline in the two-dimensional plane. In a final part of this paper, we identify the exact set of transformations of the two-dimensional plane that leave double-cross matrices invariant. Our main (and rather technical) result states that the largest group of transformations of the plane, that is double-cross invariant consist of the similaritiy transformations of the plane onto itself. In broad terms, the similarities of the plane are the translations, rotations and homotecies (scalings) of the plane. This result allows us, for instance, to prove any statement about double-cross matrices of a polyline, only for polylines start in the origin of the two-dimensional plane and have a unit length first line segment.
Organization
This paper is organized as follows.
Section 2 gives the definition of a polyline, the double-cross matrix of a polyline and double-cross similarity of two polylines. It also gives examples of the application of the concept of double-cross similarity in GIS.
Section 3 gives our algebraic characterization of the double-cross matrix of a polyline. In
Section 4, we derive a number of properties of double-cross matrices from the algebraic characterisation. In
Section 5, we give a geometric characterization of the double-cross similarity of two polylines in terms of the local carrier order. And finally, in
Section 6, we characterize the double-cross invariant transformations of the plane. In this section, we identify the transformations of the plane that leave the double-cross matrix of all polylines invariant.
3. An Algebraic Characterization of the Double-Cross Aatrix of a Polyline
In this section, we give an algebraic characterization of the entries in the double-cross matrix of a polyline. This algebraic characterisation can be used to effectively verify double-cross similarity of polylines.
Let be a polyline and let , for . Theorem 5 gives algebraic expressions to calculate the entries of a double-cross matrix in terms of the x- and y-coordinates of the points and . Further on, we use this theorem extensively to prove properties of double-cross matrices.
Before stating and proving this theorem, we recall some elementary notations from algebra and some formula’s in the following remark.
Remark. The well-known formula to calculate the (counter-clockwise) angle θ between two vectors and in (and also, in general, in ) isHere, we are not talking about located
vectors like before, but vectors in the common sense. In the above formula, the · in the numerator denotes the inner product
(also called scalar product
) of two vectors and is the norm or length of (and the · in the denominator is the product of real numbers). The above formula implies that we have if and only if if and only if . So, means that is perpendicular to . On the other hand, we have and thus , when . And finally is equivalent to .
If , then is the unique vector, perpendicular to and of the same length of , such that the (counter-clockwise) angle from to is .
In the following theorem, we use the function
We also work with the following convention concerning signs: is +; is 0; and is −.
Theorem 5. Let be a polyline and let , for . Then, with | = | − | |
| = | | |
| = | − | ; and |
| = | | . |
Proof. We have if and only if and and in this case the four (instantiated) polynomials in the statement of the theorem evaluate to zero.
Next, we assume
. We consider the following vectors in
:
;
;
; and
.
We remark that
and that the vectors
,
and
(in the common sense of the word vector) are the (located) vectors
,
and
translated to the origin of
.
• : Now, we apply the above cosine-formula to
and
to obtain an expression for
. Because
is negative towards
, we get the minus-sign in the following expression for
:
| = | |
| = | . |
• : Next, we apply the cosine-formula to
and
to obtain an expression for
. Again, because
is negative towards
, we get the minus-sign in
. This means that
| = | |
| = | . |
• : Here, we apply the cosine-formula to
and
and get
. We have a minus-sign here, because
in the direction of
. Since
, we get
| = | |
| = | . |
• : Finally, we apply the cosine-formula to
and
. Since
in the direction of
, we have
. Since
, we get
| = | |
| = | . |
This concludes the proof.
In the following property, we show that the double-cross value , which, for reasons of continuity, is the value in the case (see Definition 2), can only occur in that exceptional case.
Proposition 6. Let be a polyline and let . Then, if and only if .
Proof. As already observed in the proof of Theorem 5, implies and and in this case the four (instantiated) polynomials of Theorem 5 evaluate to zero. This implies that .
For the converse, we have to show that if the four polynomials evaluate to zero, then . We prove this by assuming and deriving a contradiction. If , then or . First, we consider the case .
As a first subcase, we consider the case . Then we get from the equations and that and . Since is assumed, this implies that and . This contradicts the assumption in Definition 1, which says that no two consecutive vertices of a polyline are identical.
As a second subcase, we consider the case
. Then we get from
that
From
, we get
Combined, these two equalities imply Since in this case , we conclude . But then, again using the equation for , we get , or . So, we have both and , which again contradicts the assumption in Definition 1. We have contradiction in all cases and this concludes the proof of the first case. The case has a completely analogous proof, now using and instead of and This concludes the proof.
We end this section by remarking that all the factors appearing in the algebraic expressions, given by the theorem, that is , , , , and are differences in x-coordinate or differences in y-coordinate values.
5. A Geometric Characterization of the Double-Cross Similarity of Two Polylines
In this section, we define the local carrier order of a polyline. This is a geometric concept and the main result of this section is a characterization of double-cross similarity of two polylines in terms of their local carrier orders.
5.1. The Local Carrier Order of a Polyline
Here, we give the definition of the local carrier order of a polyline. First, we introduce some notation for half-lines.
Definition 15. Let be a polyline in and let . If , the (directed) half-line starting in through will be denoted by . The half-line, also starting in , but in the opposite direction is denoted . The half-lines and , for with and , are called the carriers at .
The perpendicular half-line on starting in directing to the right of (that is, making a clockwise angle with ) as and the opposite perpendicular half-line starting in as . The half-lines and are called the perpendiculars at .
For
, the vertex
has
carriers and 2 perpendiculars. For an illustration of the half-lines of and of this single cross between
and
, we refer to
Figure 13.
Now, we define the local carrier order of a vertex of a polyline P, for . This local carrier order consists of nine sets. One keeps track which ’s are equal to and the other eight are corresponding to eight directions of a compass card. We use the image of a 8-point compass with the northern cardinal direction in the direction of the half-line to name these sets.
In the following definition, we say that a half-line is strictly between the two perpendicular half-lines and , if they all have the same starting point and is in the quadrant determined by and (following the counter-clockwise direction).
Definition 16. Let be a polyline in . For , we define the following nine sets for the vertex : is the set of equal to ;
is the set of strictly between and ;
is the set of equal to ;
is the set of strictly between and ;
is the set of equal to ;
is the set of strictly between and ;
is the set of equal to ; and
is the set of strictly between and ,
with or . Finally, is the set of that are equal to . The local carrier order of
P in its vertex
, for , denoted as , is the list of setsand the local carrier order of
P is the the list We remark that if , then the half-line makes no sense and therefore does not appear in any of the sets , ..., .
As an illustration we use the polyline
P depicted in
Figure 14. Here, the local carrier orders in the vertices are given by:
We now define the notion of local-carrier-order similarity of two polylines.
Definition 17. Let and be polylines of equal size. We say that P and Q are local-carrier-order similar if for all , that is, if (always, modulo changing in ).
5.2. An Algebraic Characterization of the Local Carrier Order of a Polyline
In this section, we give algebraic conditions to express the local carrier order of a polyline. Hereto, it suffices to give for each vertex
, with
, in the polyline
characterizations of the sets in the list
The following property gives this characterization. The proof of this property uses the same algebraic tools as the proof of Theorem 5 and we will skip the (straightforward) details.
We remark that, obviously, the algebraic characterisation of is given by equalities on the coordinates.
Proposition 18. Let be a polyline and let , for . For or , the following table gives algebraic conditions for the halfline to belong to with : | is equivalent to |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
| |
| and |
| |
5.3. A Characterization of Double-Cross Similarity of Polylines in Terms of Their Local Carrier Order
In this section, we give a geometric characterization of double-cross similarity of polylines in terms of their local carrier orders. The main theorem that we prove in this section is the following.
Theorem 19. Let P and Q be polylines of equal size. Then, P and Q are double-cross similar if and only if they are local-carrier-order similar. That is The two directions of this theorem are proven in Lemma 20 and Lemma 22 (or their immediate Corollaries 21 and 23).
Lemma 20. Let be a polyline. For with , we can derive the value of the 4-tuple from and .
Proof. Let be a polyline of size N. If , then This is in particular true if .
If
, then the following twelve easily observable facts show how to determine
,
,
and
(for instance, by a detailed inspection of
Figure 5).
| is equivalent to |
0 | |
+ | |
− | |
| |
| is equivalent to |
0 | |
+ | |
− | |
| |
| is equivalent to |
0 | |
+ | |
− | |
| |
| is equivalent to |
0 | |
+ | |
− | |
This concludes the proof.
This lemma has the following immediate corollary.
Corollary 21. Let P be a polyline in . Then, the matrix can be reconstructed from the local carrier order .
Proof. Properties 7 and 8 show that it is sufficient to know a double-cross matrix of a polyline on and above its diagonal in order to complete it below its diagonal. And Lemma 20 shows how the local carrier order gives the double-cross matrix on and above its diagonal. This concludes the proof.
Now, we turn to the other implication of Theorem 19.
Lemma 22. Let be a polyline in of size N. If , then contains enough information to derived to which set of the half-lines belong and to which set of the half-lines belong.
Proof. Let
, for
. Again, the following facts are easily observable (for instance, by a detailed inspection of
Figure 5).
| | is equivalent to | | | | is equivalent to |
− | − | | | − | − | |
− | 0 | | | − | 0 | |
− | + | | | − | + | |
0 | − | | | 0 | − | |
0 | 0 | is excluded | | 0 | 0 | is excluded |
0 | + | | | 0 | + | |
+ | − | | | + | − | |
+ | 0 | | | + | 0 | |
+ | + | | | + | + | |
This concludes the proof.
This lemma has the following immediate corollary.
Corollary 23. Given , can be constructed for all .
Combined, Corollaries 21 and 23 prove Theorem 19.
6. A Characterization of the Double-Cross Invariant Transformations of the Plane
In this section, we identify the transformations of the plane that leave the double-cross matrix of all polylines invariant. By a transformation we mean a continuous, bijective mapping of the plane onto itself.
If is a transformation and if and are points in , then we write for .
What do we mean by applying a transformation of the plane to a polyline? The following definition says that we mean it to be the polyline formed by the transformed vertices.
Definition 24. Let be a transformation. Let be a polyline. We define to be the polyline
We remark that since a transformation α is a bijective function, the assumption in Definition 1, which says that no two consecutive vertices of a polyline are identical, will hold for if it holds for the polyline P.
We now define the notion of double-cross invariant transformation of the plane.
Definition 25. Let be a transformation. Let P be a polyline. We say that α leaves P invariant if P and are double-cross similar, that is, if .
We say that α is a double-cross invariant transformation if it leaves all polylines invariant. A group of transformations of is double-cross invariant if all its members are double-cross invariant transformations.
The main aim of this section is to prove the following theorem, which says that the largest group of transformations that is double-cross invariant consists of the translations, rotations and homotecies (or scalings) of the plane. The elements of this group are called the similarities of . We remark that a homotecy of the plane is a transformation of the form , where and .
Theorem 26. The largest group of transformations of , that is double-cross invariant consist of the similarity transformations
of the plane onto itself, that is, transformations of the formwhere , and . We remark that the condition imply that the matrix is orthogonal and that and cannot be both zero. In fact, we can see as and as , where φ is the angle of the rotation expressed by the matrix.
We prove this theorem by proving three lemma’s. Lemma 27 proves soundness and Lemma 29 proves completeness. Lemma 28 is a purely technical lemma.
Lemma 27. The translations, rotations and homotecies of the plane (that is, the transformations given in Theorem 5) are double-cross invariant transformations.
Proof. We consider the three types of transformations separately, since we can apply them one after the other. In all cases, we use the algebraic characterization, given by Theorem 5.
1. Translations. We have already remarked that all the factors appearing in the algebraic expressions, given by given by Theorem 5, that is , , , , and are differences in x-coordinates or differences in y-coordinates. A translation , therefore leaves these differences unaltered. For instance, is transformed to , which is, of course, the original value . None of the expressions given by Theorem 5 are therefore changed and the double-cross condition remain the same.
2. Rotations. Let
with
, be a rotation (that fixes the origin).
The expression for
is transformed to
which simplifies to
, which is the original polynomial since
. For
,
and
, a similar straightforward computation shows that the polynomials remain the same.
3. Homotecies. A homotecy , transforms the differences , , , , and to , , , , and . This means that the polynomials given by Theorem 5 are multiplied by , which is strictly larger than zero, for . The signs of these polynomials are therefore unaltered. And the double-cross value of the scaled polyline is the same as the original one.
Before we can turn to completeness, we need the following technical lemma.
Lemma 28. Let be a strictly monotone increasing function. Iffor any , then . Proof. Suppose that f is a function as described and suppose that there is a such that . We remark that therefore cannot be 0 or 1.
If , then it follows from that also . We may therefore assume .
If , then it follows from that also . We may therefore assume .
Claim. For any
and any
k, with
, we have that
We first prove this claim (by induction on n). For , and , we respectively have and
Assume now that the claim is true for n. We prove it holds for . We consider and distinguish between the cases, and with . If , then , which by the induction hypothesis equals or .
If with , then , which by the induction hypothesis equals which equals or which is . This concludes the proof of the claim.
To conclude the proof, let
and assume first that
. This means that
. We remark that since
f is assumed to be strictly monotone,
and therefore the division is allowed. Choose
k and
n such that
with
. Then
, although
, which contradicts the fact that
f is strictly monotone increasing.
If we assume
on the other hand, we have
. Choose
k and
n such that
with
. Then
, although
, which contradicts the fact that
f is strictly monotone increasing. In both cases, we obtain a contradiction and this concludes the proof.
The following lemma proves completeness. The proof is kept elementary and we remark that it shows how the double-cross formalism can be used to construct midpoints.
Lemma 29. The similarity transformations of the plane (given in Theorem 5) are the only double-cross invariant transformations.
Proof. Let be a double-cross invariant transformation.
(1) We consider polylines
where
,
and
are collinear points with
between
and
. By the assumption in Definition 1,
should be
strictly between
and
The only relevant entry in the double-cross matrix of this polyline is
which is
. In
,
should also be
. This implies that
,
and
should also be collinear, with
(strictly) between
and
. This means that
α preserves
collinearity and
betweenness, depicted in
Figure 15.
(2) We consider polylines
where
, that is, the polyline takes a right turn at
. The only relevant entry in the double-cross matrix of this polyline is again
which is now
. In
,
should also be
. This means that
α is a
right-turn-preserving transformation. This is illustrated in
Figure 16. Similarly,
α is a
left-turn-preserving transformation.
(3) We consider the polyline
with
,
,
,
and
, depicted in
Figure 17. This polyline forms a square with its two diagonals after making six
right-turns and two
left-turns . It is also closed in the sense that its start and end vertex are equal. The transformation
α, which according to (2) preserves right and left turns, therefore has to map
P again to a square with its diagonals. This means
α is a
square-preserving transformation. In particular,
α preserves parallel line segments. Also,
, which is the midpoint between
and
is mapped to
, which should be the midpoint between
and
. This means
α is a
midpoint-preserving transformation.
Suppose
. If
is the translation
, then
. Suppose
. Let
be the rotation with
as center that brings
to the positive
x-axis, that is, to
. We remark that
cannot be the origin since
α is assumed to be a bijective function. So, also
is bijective. Furthermore, let
be the scaling
and let
Then we have that
and
.
Since α is a double-cross invariant transformation, by assumption, and since , and are double-cross invariant transformations by Lemma 27, also β is a double-cross invariant transformation. And β also inherits from α the properties of preserving betweenness, collinearity, right- and left turns, squares, parallel line segments and midpoints. Because β preserves squares, we also have .
We now claim the following.
Claim. The transformation β is the identity.
The proof of this claim finishes the proof. Indeed, then we have
which is of the required form.
Proof of the claim: First, we show that
β is the identity on the
x-axis and next we do the same for all lines perpendicular to the
x-axis. Hereto, we consider the function
where
is the projection on the first component, that is,
. Since
and
and
β preserves collinearity,
β maps the
x-axis onto the
x-axis and we have
and
. Furthermore, since
β and hence
preserves betweenness,
is strictly monotone increasing. Indeed, let
with
. With respect to 0 and 1, we can consider the twelve possible locations of
s and
t:
;
;
;
;
;
;
;
;
;
;
; and
. In all cases, except
, we have three points. So, here we can use the fact that
β preserves betweenness to show that
. In the case
, we have
Finally, since
β preserves midpoints, also for
, we have
for all
. All the conditions to apply Lemma 28 are therefore fulfilled. And we get
Now, we fix some
and consider the function
where
Since
β preserves parallel line segments,
maps the line with equation
onto itself (since it maps the
y-axis to itself). Since
β also preserves the rectangle given by the polyline
(for
, we can omit
and
from the list) onto itself, we have again have
and
. The function
also inherits from
β the property of preserving midpoints and is strictly monotonic increasing on the line
. So, again we can apply Lemma 28 to show that
is the identity.
Since , we obtain that β is the identity transformation. This finishes the proof of the claim and also of the lemma.