Abstract
We study the double-cross matrix descriptions of polylines in the two-dimensional plane. The double-cross matrix is a qualitative description of polylines in which exact, quantitative information is given up in favour of directional information. First, we give an algebraic characterization of the double-cross matrix of a polyline and derive some properties of double-cross matrices from this characterisation. Next, we give a geometric characterization of double-cross similarity of two polylines, using the technique of local carrier orders of polylines. We also identify the transformations of the plane that leave the double-cross matrix of all polylines in the two-dimensional plane invariant.
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.
2. Definitions and Preliminaries
In this section, we give the definitions of a polyline, of the double-cross matrix of a polyline and of double-cross similarity of two polylines.
2.1. Polylines in the Plane
Let denote the set of the real numbers, and let denote the two-dimensional real plane. To stress that some real values are constants, we use sans serif characters: . Real variables are denoted in normal characters. For constant points of , we use the sans serif characters
The following definition specifies what we mean by polylines. We define polylines as a finite sequences of points in (which is often used as their finite representation). When we add the line segments between consecutive points we obtain what we call the semantics of the polyline. We also introduce some terminology about polylines.
Definition 1.
A polyline (in ) is an ordered list of points in . We call the points , , the vertices of the polyline. We assume that no two consecutive vertices are identical, that is: , for .
We call N the size of the polyline P. The vertices and are respectively called the start and end vertex of P. The line segments connecting the points and , for , are called the (line) segments of the polyline P. The semantics of P, denoted , is the union of the line segments of P.
So, the semantics, , is the following union of line segments:
which is a polygonal curve in . The quantified real variable λ captures, for values , the points on the line segments, strictly between the vertices and in . Further on, we will loosely use the term polyline also to refer to the semantics of a polyline, although, in a strict sense, a polyline is a ordered list of points in .
We remark that two polylines with a different number of vertices, may have the same semantics. Figure 1 gives an example of such polylines. We also remark that the line segments, appearing in the semantics, may intersect in points which may or may be not vertices, as is illustrated by the polyline shown in Figure 2. A polyline where the start and end vertex coincide and which has no other self-intersections in its semantics is a polygon. Finally, we remark that it is reasonable to assume that polylines coming from GIS applications have vertices with rational coordinates.
Figure 1.
An example of a polyline and a polyline . Although they have a different vertex set and a different size, still .
Figure 2.
An example of a polyline and its semantics . We see that two of the line segments of its semantics intersect in a point that is not a vertex. The last line segment of the polyline intersects two other line setments in a vertex.
Below, we stick to the notation introduced in the above definitions. Furthermore, as a standard, we abbreviate by . We also use the following notational conventions. The (located) vector from to is denoted by (by the located vector from to , we mean an ordered pair of points of ). We use this concept to represent the oriented line segment between and . The counter-clockwise angle (expressed in degrees) measured from to is denoted by , as illustrated in Figure 3.
Figure 3.
The counter-clockwise angle from to .
2.2. The Double-Cross Matrix of a Polyline
In this section, we define the double-cross matrix of a polyline.
2.2.1. The Double-Cross Value of Two (Located) Vectors
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.
We associate to a polyline , with , the (located) vectors , representing the oriented line segments between the consecutive vertices of P. Because of the assumption in Definition 1, the vectors all have a strictly positive length. In the double-cross formalism, the relative orientation between and is given by means of a 4-tuple
We follow the traditional notation of this 4-tuple without commas. To determine and , for , first of all, a double cross is defined for the vectors and , determined by the following three lines:
- the line through and ;
- the line through , perpendicular on ; and
- the line through , perpendicular on .
These three lines are illustrated in Figure 4. These three lines determine a cross at and a cross at . Hence the name “double cross.” The entries and express in which quadrants or on which half lines and are located with respect to the double cross.
Figure 4.
The double cross (in blue): for and we have the lines , and .
We now define this more formally and follow the historical use of the double cross (see, for instance, [15,26]). In this definition, an interval of angles, represents the open interval between a and b on the counter-clockwise oriented circle.
Definition 2.
Let be a polyline, with , for , and with associated vectors . For and with , and , we define
as follows:
| = | ||
| = | ||
| = | ||
| = |
For and , with , we define, for reasons of continuity,
The argumentation for this convention is given in [32].
So, in particular, when , we have .
We remark that the values and describe the location of the point or, equivalently, the orientation of the vector with respect to the cross at (formed by the lines and ). We see that each of the four quadrants and four half lines determined by the cross at are determined by a unique combination of and values. Similarly, the values and describe the location of the point or, equivalently, the orientation of the vector with respect to the cross at (formed by the lines and ).
The quadrants and half lines where , , and take different values are graphically illustrated in Figure 5. For example, the 4-tuple for the vectors and , shown in Figure 4, is .
Figure 5.
The quadrants and half lines where , , and take different values.
Further on, we will sometimes use the notation to indicate , for . Obviously, this notation does not hide the dependence on i and j.
Remark.
Since , , and take values from the set , it may seem that there are possible values for the tuples .
However, some combinations are not possible because of the assumption in Definition 1, that says that two consecutive vertices of a polyline have to be different. This means that and cannot be both 0 and that and cannot be both 0, in each case with the exception of , , and all being 0, that is . So, we have possible values for .
This number of 65 possible values for the tuples can also be reached in another way. The point can be in one of four quadrants around or on one of four half lines starting in . These are 8 possible locations for . Similarly, we have 8 possible locations for in the quadrants and half lines starting in . This gives possible combinations. Together with the case , we reach a total number of 65 possibilities.
2.2.2. The Double-Cross Matrix of a Polyline
Based on the definition of , we now define the double-cross matrix of a polyline.
Definition 3.
Let be a polyline, with , for , and with associated vectors . The double-cross matrix of P, denoted , is the matrix with the entries , for .
For example, the entries of the double-cross matrix of the polyline of Figure 6 are given in Table 1. This first example can be used to illustrate some properties of this matrix that are proven in Section 4. First, we observe that on the diagonal always appears. We also see that there is a certain degree of symmetry along the diagonal. If , then we have . These two observations imply that it suffices to know a double-cross matrix above its diagonal.
Figure 6.
An example of a polyline.
Table 1.
The entries of the double-cross matrix of the polyline of Figure 6.
2.3. Double-Cross Similarity of Polylines
We now define double-cross similarity of two polylines of equal size.
Definition 4.
Let P and Q be polylines of the same size. We say that P and Q are double-cross similar if .
We stress that Definition 4 requires that the two polylines have to be of the same size before we can speak of their double-cross similarity.
Figure 7 depicts two polylines, P and Q, which are double-cross similar. The entries of their double-cross matrices are given in Table 2. In polyline P of Figure 7, at each vertex, the polyline bends around 10 degrees to the left. In polyline Q, this is only around 2 degrees. Nevertheless, all relative positions of oriented line segments remain the same. As the most extreme example, if we compare and in both polylines, we see that almost makes a left angle with the central line of the double cross in the polyline P, whereas, this is only some in the polyline Q. Still, both P and Q have the same double-cross entry for and .
Figure 7.
The polylines P and Q are double-cross similar.
Table 2.
The entries of the double-cross matrix of the polylines of Figure 7.
2.4. Examples of The Application of Double-Cross Similarity in GIS
In this section, we give some examples of the applicability of the concept of double-cross similarity of polylines in the area of GIS [27]. Polyline- (and polygon-) similarity testing, based on the double-cross formalism, can be applied in a number of areas in GIS. We think of applications in the area of image recognition or retrieval in the context of geographical maps. Features in maps are often modelled as polylines (for instance, roads and rivers) and polygons (for example, closed polylines can be used to delimit geographical areas such as cities, provinces and countries). Polyline-similarity testing can also be applied in the area of the classification of terrain features. In spatial database terms, it can be used for querying-by-sketch.
To determine the degree of similarity between two polylines (not necessary of the same size), according to the double-cross formalism, we can proceed by the following two steps: (1) first, if the polylines are of different size, their “generalized polylines” (that approximate the original polylines within an ε-error margin) are computed; (2) next, the differences between the double-cross matrices of the generalized polylines are used as a measure of dissimilarity between the given polylines. In the remainder of this section, we describe this process in some more detail and we give some examples of its application.
The definition of double-cross similarity of polylines (Definition 4) can only be applied to polylines of the same size. Obviously, in practice, we often want to test similarity of polylines that are not necessarily of the same size. To overcome this problem, we can use the notion of “generalized polylines”: for a given polyline P, a sequence of generalized polylines are defined that tend (as n grows) to converge to P (arbitrary close) and to consist of equally long line segments. To define the generalized polyline in this sequence, we measure the distance along P from its start vertex to its end vertex and we mark on the points that divide in pieces of equal length. These markers are used as the vertices of the generalized polyline . The first generalizations , and of a polyline P are shown in Figure 8. It can be shown that the generalized polylines of P converge to P, as n grows. This means that, for any error margin , a polyline P can be approximated, for sufficiently large n, by its generalizations up to an error of ε. In particular, the difference in length between P and is less than ε [27].
Figure 8.
An example of a polyline (in black). Next, its first generalizations , and are shown in blue, in red and in green, respectively.
This means that for two given polylines and and an arbitrarily small ε, we can find a large enough n such that both and are ε-close to and . For step (2), we can use the double-cross matrices and of and to define the double-cross (dis)similarity of and . There are many possibilities here, but in the experiments in [27], the distance function is shown to be the most suitable in many applications in GIS. To define the distance measure between double-cross matrices, we first construct, for both matrices and , 65-ary vectors over the natural numbers, that count for each of the 65 realizable 4-tuples of −, + and 0 (Proposition 10 explains the number 65), the number of times they occur in the matrices and . Then, for matrices and of polylines of size N, we define
where and where refers to the ith entry of the vector . This means that the function counts the average difference between the 65 count values. In [27], it is shown that can be efficiently computed. It was also shown to perform well in a number of applications. We conclude this section, by discussing some of the performance results of .
Example 1: Polygon Similarity: Image Recognition and the Classification of Terrain Features
Figure 9 shows a map of Belgium in Figure 9a, consisting of 2047 line segments. Figure 9b is the same figure with the three bumps in the upper part moved to the right. Figure 9c is a map drawn by a geographer and Figure 9d is an abstract representation. Table 3 gives an overview of the similarity levels determined by . For example, the actual map of Belgium is 99% similar to the slightly modified map, but only 60% similar to the abstract representation.
Figure 9.
A map of Belgium in (a) and some sketches in (b–d).
Table 3.
Similarity between polygons of Figure 9 using .
This technique of -based polygon similarity can be used in areas such as image retrievel or recognition, but also in the recognition and classification of terrain features, of which the basic terrain features, modelled as polylines, are depicted in Figure 10.
Figure 10.
The seven basic shapes of terrain features in (a–g). They are modelled as polylines and named as shown in the figure.
Example 2: Query-by-Sketch
Figure 11 first shows sketches of a bowler hat and a bow tie. Next, it shows a map of the the province of Limburg in Belgium with its municipalities. The municipalities that resemble the bowler hat the most, according to , are shown in black on this map. The most alike city is “Lommel”, as indicated in the figure. The municipalities, resembling the bow tie sketch, are shown in grey.
Figure 11.
Part (a) shows sketches of a bowler hat and bow tie. Part (b) shows the municipalities in the province of Limburg that resemble best these sketches in black, respectively, grey.
For further implementation details and experimental results, we refer to [27].
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 ) is
Here, 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
- .
• : 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.
4. Some Properties of Double-Cross Matrices that can be Derived from Their Algebraic Characterisation
In this section, we give some basic properties of double-cross matrices of polylines. In most cases, these properties can be derived from the algebraic characterization of the entries of a double-cross matrix, that we presented in previous section.
4.1. Symmetry in the Double-Cross Matrix of a Polyline
In Section 2.2.2, we have already announced by the example polyline given in Figure 6 with its double-cross matrix given in Table 1, that a double-cross matrix exhibits symmetry properties. We prove these properties in this section. The first property is by definition, the second needs some inspection of polynomials. The conclusion is that it is enough to know a double-cross matrix above its diagonal.
Proposition 7.
If is a polyline, then , for .
The following property says how can be derived from in a straightforward way.
Proposition 8.
Let be a polyline. If , then .
Proof.
Let be a polyline and let . We use the polynomials given in Theorem 5 to prove this result. Essentially, what we do is to interchange the role of i and j. If , nothing has to be shown. So, we assume . If we interchange in
the role of i and j, we get , with
It is easy to see that , , and .
| = | − | ||
| = | |||
| = | − | ; and | |
| = | . |
| = | − | ||
| = | |||
| = | − | ; and | |
| = |
These two properties imply that only the entries above the diagonal of the double-cross matrix of a polyline are significant.
4.2. The Double-Cross Value of Consecutive Line Segments
The following property says what the entries in the double-cross matrix of two successive line segments and in a polyline look like. These values correspond to entries in the double-cross matrix just above (or below) its diagonal.
Proposition 9.
Let be a polyline. Of the entries and are fixed to − and 0. That is,
for any .
Proof.
Let . We start with the entry . Because of the assumption in Definition 1, we have and we can conclude that .
For the third entry we have . This concludes the proof.
The following property shows that more values depend on one another.
Proposition 10.
Let be a polyline and let . If , with or 0, then , for some .
Proof.
Let be . We have the following expressions:
| = | ||
| = | ||
| = | ||
| = |
Let us abbreviate the first two expression as and and the latter two as and .
Then we have . Since, by assumption , it follows from the assumption in Definition 1 that and thus .
Further, we have . So, This concludes the proof.
4.3. On the Length of Line Segments of a Polyline
The following properties shows that changing the length of segments in a polyline may or may not influence certain entries in its double-cross matrix.
Proposition 11.
Let be a polyline and let , for . Changing the length of and does not influence the value of .
Proof.
If we take and , where is scaled by a factor c, with and is scaled by a factor d, with , then we first observe that and It is then easily verified that , since . Similarly, we get , and , since also . This concludes the proof.
The length of the last segment of a polyline does not influence the double-cross matrix. Only its direction matters. This follows straightforwardly from the definition.
Proposition 12.
Let be a polyline. Changing the length of does not change .
For segments, that differ from the last, this is not the case, as the following property shows.
Proposition 13.
Let be a polyline. Changing the length of , for , may change .
Proof.
Consider the polylines and of Figure 12. They only differ in the length of their third segment. For P, we have , whereas for Q, we have .
Figure 12.
Two polylines that differ in the length of their third segment.
4.4. The Quadrant of Points of a Polyline
In Section 6, we will see that we can apply a similarity transformation to a polyline without changing its double-cross matrix. Without loss of generality, we may therefore assume that the first line segment of the polyline is the unit interval of the x-axis, that is, and .
The following property states that we can derive the quadrants in which all the other points are located from the double-cross matrix.
Proposition 14.
Let be a polyline and assume that and . Let for . From , we can determine and .
Proof.
It is clear that and that .
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.
Figure 13.
An example the half-lines (in blue), (in green) and the two perpendicular half-lines and (in red).
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 :
and the local carrier order of P is the the list
- 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 ,
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:
Figure 14.
A polyline with its carriers (in green) and its perpendiculars (in red).
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 form
where , 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. If
for 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.
Figure 15.
A collinearity and betweenness-preserving transformation of the plane.
(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.
Figure 16.
A right-turn-preserving transformation of the plane.
(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.
Figure 17.
A polyline that is a square with its two diagonals. The six right-turns are indicated in bold.
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.
7. Conclusions
We have studied the double-cross matrix descriptions of polylines in the two-dimensional plane from an algebraic and geometrical point of view. We have first given an algebraic characterization of the double-cross matrix of a polyline. This algebraic characterisation allowed us to prove some basic properties of double-cross matrices. We have given a geometric characterization of double-cross similarity of two polylines by means of the notion of the local carrier orders of polylines. Finally, we identify the transformations of the plane that leave the double-cross matrix of all polylines in the two-dimensional plane invariant.
Research on double-cross matrices gives rise to many questions of which we name a few here. Firstly, variants of double crosses can be imagined, for instance, to include the temporal dimension of moving object data. Another variant would be to rotate the double cross by . This would make notions of straight ahead, back, right and left more relative. We can also envisage double crosses with a finer structure. They may have 8, 16 or more lines determining the “crosses”, as in the -approach [29] (in some sense, the double-cross formalism can be seen as ).
Our algebraic characterization of the double-cross matrix of a polyline, also raises the question of the realisability of double-cross matrices. This question adds up to the following: given an matrix of 4-tuples over the set , decide if this is the double-cross matrix of a polyline. A matrix where doesn’t appear on the diagonal, for instance, cannot be the double-cross matrix of a polyline. This decision problem leads to non-trivial problems in computational algebraic geometry.
Author Contributions
Both authors contributed equally.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Güting, R.H.; Schneider, M. Moving Objects Databases; Morgan Kaufmann: Burlington, MA, USA, 2005. [Google Scholar]
- Bookstein, F.L. Size and shape spaces for landmark data in two dimensions. Stat. Sci. 1986, 1, 181–242. [Google Scholar] [CrossRef]
- Dryden, I.; Mardia, K.V. Statistical Shape Analysis; Wiley: Hoboken, NJ, USA, 1998. [Google Scholar]
- Kent, J.T.; Mardia, K.V. Shape, procrustes tangent projections and bilateral symmetry. Biometrika 2001, 8, 469–485. [Google Scholar] [CrossRef]
- Mokhtarian, F.; Mackworth, A.K. A theory of multiscale, curvature-based shape representation for planar curves. IEEE Trans. Pattern Anal. Mach. Intell. 1992, 14, 789–805. [Google Scholar] [CrossRef]
- Gero, J.S. Representation and reasoning about shapes: cognitive and computational studies in visual reasoning in design. In Lecture Notes in Computer Science, Proceedings of the International Conference on Spatial Information Theory (COSIT 1999), Stade, Germany, 25–29 August 1999; pp. 315–330.
- Meathrel, R.C. A General Theory of Boundary-Based Qualitative Representation of 2D Shape. Ph.D. Thesis, University of Exeter, Exeter, UK, 2001. [Google Scholar]
- Schlieder, C. Geographic objects with indeterminate boundaries. In Qualitative Shape Representation; Taylor & Francis: Oxfordshire, UK, 1996; pp. 123–140. [Google Scholar]
- Gottfried, B. Tripartite line tracks qualitative curvature information. In Proceedings of the International Conference on Spatial Information Theory (COSIT 2003), Ittingen, Switzerland, 24–28 September 2003.
- Jungert, E. Symbolic spatial reasoning on object shapes for qualitative matching. In Proceedings of the International Conference on Spatial Information Theory (COSIT 1993), Marina, Italy, 19–22 September 1993.
- Kulik, L.; Egenhofer, M. Linearized terrain: Languages for silhouette representations. In Proceedings of the International Conference on Spatial Information Theory (COSIT 2003), Kartause Ittingen, Switzerland, 24–28 September 2003.
- Latecki, L.J.; Lakämper, R. Shape similarity measure based on correspondence of visual parts. IEEE Trans. Pattern Anal. Mach. Int. 2000, 22, 1185–1190. [Google Scholar] [CrossRef]
- Leyton, M. A process-grammar for shape. Artif. Int. 1988, 34, 213–247. [Google Scholar] [CrossRef]
- Giannotti, F.; Pedreschi, D. Mobility, Data Mining and Privacy; Springer: Berlin, Germany, 2009. [Google Scholar]
- Freksa, C. Using orientation information for qualitative spatial reasoning. In Lecture Notes in Computer Science, Proceedings of the Spatio-Temporal Reasoning (GIS 1992), Pisa, Italy, 21–23 September 1992; pp. 162–178.
- Cohn, A.G.; Renz, J. Qualitative spatial reasoning. In Handbook of Knowledge Representation; Elsevier: Philadelphia, PA, USA, 2007; pp. 551–596. [Google Scholar]
- Long, J.A.; Nelson, T.A. A review of quantitative methods for movement data. Int. J. Geogr. Inf. Sci. 2013, 27, 292–318. [Google Scholar] [CrossRef]
- Renz, J.; Nebel, B. Qualitative spatial reasoning using constraint calculi. In Handbook of Spatial Logics; Springer: Berlin, Germany, 2007; pp. 161–215. [Google Scholar]
- Kreutzmann, A.; Wolter, D. Qualitative spatial and temporal reasoning with AND/OR linear programming. In Proceedings of the 21st European Conference on Artificial Intelligence (ECAI 2014), Bethlehem, Czech, 18–22 August 2014.
- Wolter, D.; Kreutzmann, A. Analogical representation of RCC-8 for neighborhood-based qualitative spatial reasoning. In Proceedings of the 38th Annual German Conference on AI: Advances in Artificial Intelligence (KI 2015), Dresden, Germany, 21–25 September 2015.
- Wolter, D.; Kirsch, A. Leveraging qualitative reasoning to learning manipulation tasks. Robotics 2015, 4, 253–283. [Google Scholar] [CrossRef]
- Wallgrün, J.O.; Frommberger, L.; Wolter, D.; Dylla, F.; Freksa, C. Qualitative spatial representation and reasoning in the SparQ-toolbox. In Proceedings of the International Conference Spatial Cognition, Freiburg, Germany, 15–19 September 2008.
- Westphal, M.; Wölfl, S.; Gantner, Z. GQR: A fast solver for binary qualitative constraint networks. In Proceedings of the AAAI Spring Symposium: Benchmarking of Qualitative Spatial and Temporal Reasoning Systems, Stanford, CA, USA, 23–25 March 2009.
- Condotta, J.F.; Kaci, S.; Schwind, N. A framework for merging qualitative constraints networks. In Proceedings of the Twenty-First International Florida Artificial Intelligence Research Society Conference, Coconut Grove, FL, USA, 15–17 May 2008.
- Delafontaine, M.; Cohn, A.G.; Van de Weghe, N. Implementing a qualitative calculus to analyse moving point objects. Expert Syst. Appl. 1986, 38, 5187–5196. [Google Scholar] [CrossRef]
- Zimmermann, K.; Freksa, C. Qualitative spatial reasoning using orientation, distance, and path knowledge. Appl. Int. 1996, 6, 49–58. [Google Scholar] [CrossRef]
- Kuijpers, B.; Moelans, B. Towards a geometric interpretation of double-cross matrix-based similarity of polylines. In Proceedings of the 16th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems (ACM GIS 2008), Irvine, CA, USA, 5–7 November 2008.
- Mavridis, N.; Bellotto, N.; Iliopoulos, K.; Van de Weghe, N. QTC3D: Extending the qualitative trajectory calculus to three dimensions. Inf. Sci. 2015, 322, 20–30. [Google Scholar] [CrossRef]
- Moratz, R.; Renz, J.; Wolter, D. Qualitative spatial reasoning about line segments. In Proceedings of the 21st European Conference on Artificial Intelligence (ECAI 2014), Bethlehem, Czech, 18–22 August 2014.
- Moratz, R.; Lücke, D.; Mossakowski, T. A condensed semantics for qualitative spatial reasoning about oriented straight line segments. Artif. Int. 2011, 175, 2099–2127. [Google Scholar] [CrossRef]
- Mathematica, Wolfram Research. Available online: //www.wolfram.com (accessed on 24 August 2016).
- Forbus, K.D. Qualitative physics: past present and future. In Readings in Qualitative Reasoning about Physical Systems; Morgan Kaufmann: Burlington, MA, USA, 1990; pp. 11–39. [Google Scholar]
© 2016 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).
















