ЧЕБЫШЕВСКИЙ СБОРНИК расстояния взаимодействия в контексте геометрии расстояния для движений человека Introducing the Interaction Distance in the context of Distance Geometry for Human Motions

The dynamical Distance Geometry Problem (dynDGP) is a recently introduced subclass of the distance geometry where problems have a dynamical component. The graphs 𝐺 = ( 𝑉 × 𝑇, 𝐸, { 𝛿, 𝜋 } ) of dynDGPs have a vertex set that is the set product of two sets: the set 𝑉 , containing the objects to animate, and the set 𝑇 , representing the time. In this article, the focus is given to special instances of the dynDGP that are used to represent human motion adaptation problems, where the set 𝑉 admits a skeletal structure ( 𝑆, 𝜒 ) . The “interaction distance” is introduced as a possible replacement of the Euclidean distance which is able to capture the information about the dynamics of the problem, and some initial properties of this new distance are presented.


Introduction
Given a weighted undirected graph = ( × , , { , }), the dynamical Distance Geometry Problem (dynDGP) [16,20] in dimension 3 consists in finding a realization : ( , ) ∈ × −→ ( , , ) ∈ R 3 (1) of in the Euclidean space R 3 such that the following objective is minimized: where is a distance function, and | · | indicates the absolute value of a real number. It is important to point out the two different roles of and in equ. (2). The former is one of the weights associated to the edges of the graph , which corresponds to the available distance value between a vertex pair. The latter is instead a distance function: associates, to every pair of positions, their corresponding distance. In the majority of the applications of distance geometry [19], the distance function is the Euclidean distance: The value of associated to every distance represents the "importance" of such a distance, and it is generally referred to as the priority of the distance [9,16]. The vertex ( , ) of the graph is an ordered pair that represents a given object at a certain instant , and a realization corresponds to an animation of the objects in over the time steps in = {1, 2, . . . , }. As in the equations already introduced above, the compact notations and { , } are employed for indicating a vertex and an edge of , respectively. The coordinates of the object at the time obtained through the realization function are indicated with compact notations , and . Notice that, from a formal point of view, the only particularity of the dynDGP (w.r.t a standard distance geometry problem) is the fact that the vertex set of is the set product of two sets: (the objects) and (the time). In other words, a dynDGP with = {1} is a "standard" distance geometry problem [12]. This article focuses on a particular application of the dynDGP, where the main interest is in analyzing human motions through the study of animated skeletal structures which resemble the human body [20]. Some initial works have shown that tools for distance geometry can be employed in this context [2,17], but they consider, as in the majority of the applications in distance geometry, the Euclidean distance as a metric.
In fact, only a few examples of use of non-Euclidean distances in the context of distance geometry can currently be found in the scientific literature: in [4], for example, the ∞ distance is used to reformulate the distance geometry problem as an optimization problem whose constraints only include linear terms; in [13], distance geometry on the sphere is studied, where the distances can be either Euclidean, or geodesic distances. In the present work, the possibility to replace the Euclidean distance with another distance function, which is able to "better" capture the features of the motion adaptation problem, is discussed. To this aim, the interaction distance will be introduced, and some of its basic properties will be studied.
The rest of the article is organized as follows. Section 2 will introduce more in details the mathematical objects that are involved in motion adaptation. Section 3 will propose a definition of the human motion adaptation problem which is based on the formulation of a dynDGP. Then, the interaction distance will be introduced in Section 4, and some initial properties will be presented. Finally, Section 5 will conclude the paper.

The objects that come to play
Human-like characters are sets of bars that represent "bones" (i.e. the rigid components) of a human body, while the intersection points between two bars are named "joints". This kind of structure is widely used in applied mathematics and can be represented by a simple graph = ( , ), where vertices in are the joints and the existence of an edge { , } ∈ between two joints and indicates that they are connected by a bar [11].
The graph provides information about the structure (a hand is connected through a bar to an elbow, which is then connected through another bar to the shoulder, and so on), but it gives no information about the morphology of the character. For a predefined accuracy level of the skeletal representation of the character (not all human bones are generally represented, but only a few of them, often a little more than 20 bones), in fact, it is actually possible to consider the graph as a constant for an entire group of characters. Then, the difference between pairs of characters can be evaluated by simply comparing their morphology. Notice that, for the majority of the skeletal representations, the graph is a tree.
The simplest way to add morphology information to a character is to include in the graph a weight function that associates a real positive value (the bone length) to all its edges in . This way, a "tall guy" has larger values associated to the weights of its "leg" edges, in comparison with a normal-sized guy. Naturally, lengths can be provided in absolute values for all edges: or rather the propositions among them can be provided in order to obtain a more efficient character description which is independent from the metric scale.
Even though the simple, and weighted, graph = ( , , ) provides enough information to represent a character bone structure and morphology, it is typical (in the works signed by the computer graphics community) to represent characters by skeletal structures [1,11]. A skeletal structure is a pair consisting of a graph ( in our case, without weights), and a function that is able to assign a position in R 3 to every joint ∈ . This initial set of positions corresponds to the Рис. 1: The initial pose for the skeletal structure ( , ). is a tree and, in its realization shown in this figure, the joint positions are computed by setting the position of its root to (0, 0, 0) and by using the displacement function to compute the coordinates of all other joints.
"initial pose" of the character ( Fig. 1 shows an example of initial pose for a human-like character). The function takes into consideration the hierarchical information in the graph , and actually provides the displacement ( , , ) of every vertex ∈ w.r.t. its parent (when is a tree, every vertex has only one parent): : from which all vertex positions in the initial pose can be obtained. The most common way to represent the animation of the character ( , ) is through the function: where , and are three Euler angles (pitch: , roll: and yaw: ) used to control the relative rotations of every character edge in the local coordinate system of the hierarchically lowest (closest to the root) joint of the edge [14]. This representation has the great advantage of keeping the skeletal structure, as well as its morphology, constant during the animation.
From the initial pose for the character, and by using the Euler angles ( , , ) for all following time steps , it is possible to calculate the vertex coordinates of all subsequent character poses, so that the entire animation can be represented through a function (see equ. (1)). This procedure is detailed, for example, in [14]. A solutions (realization) to a dynDGP has exactly the same form.

Human motion adaptation
Character animation is nowadays largely used in movie and video game industries. Typically, a 3D model and its associated skeletal structure ( , ) are designed by an artist, then animated either manually or using recorded motion capture data. However, it is often the case that animations created for a specific character, or captured from a given actor, need to be reused on characters with a different morphology: this problem is known in the specialized literature as the motion adaptation problem.
Since the early works of Gleicher [8], and Choi and Ko [3], the problem of adapting a given animation to the special features of a given character is taking particular attention from the research community. The main problem consists extracting the information about the animation played by character A (the actor), and to transfer this piece of information to another character B (the character to be animated), which is generally morphologically different from character A (see Section 2 for the representation of the characters and the animations).
Let ( , ) be the skeletal structure that describes the morphology of character A, and suppose that the initial animation is captured from character A; let ( , ) be the skeletal structure of the target character B. The two characters have a common graph , but the two functions and are different. When the two initial poses described by the two displacement functions and are the same (different numerical values for the displacements over the three components may represent the same pose, such as the typical T pose), one possible (and easy) approach to motion adaptation is to simply transfer the function (see equ. (3), representing the animation of character A, to character B (in other words, it is imposed that ≡ ). However, the Euler angles in are not able to take into consideration the spatial relationship between pairs of character joints [2,10], and as a consequence undesired effects may be introduced in the animation. Typical undesired effects include creating body contacts that were not present in the original animation, or to miss body contacts that actually occur in the original animation.
As already remarked in Section 2, the coordinates ( , , ) for every joint and for every time can be computed by combining the displacement function of the skeletal structure ( , ) with the function . With the obtained representation of the animation, Euclidean distances between pairs of joints, at every time frame , can be computed. As it is well-known, the Euclidean distance is widely used in several scientific disciplines, and provides information that is easily understandable by humans, which is, the simple measure of proximity between object pairs. A character that flaps its hands, for example, needs to bring, at particular time frames, the Euclidean distance between the two hands to zero in order to perform this movement; the distance provides this simple and fundamental feature of the movement.
When the animations are represented by functions having the form of equ. (1), the motion adaptation problem can be formulated as follows [2,17]. Let be the initial animation of ( , ), given in terms of absolute vertex positions. In order to capture the spatial relationships between joint pairs in the animation, all relative distances , for every time frame, can be computed. If some distances are considered to be more important than others, then a higher priority value can be associated to them. This procedure allows to define the simple undirected graph = ( × , , { , }), which represents the animation in terms of distances.
Given a skeletal structure ( , ) and a simple weighted undirected graph = ( × , , { , }) obtained from an animation of ( , ), find an animation for the skeletal structure ( , ) that is solution to dynDGP( ).
It is important to remark that "an animation for ( , )" is meant to be an animation where the morphology described by the skeletal structure is preserved. Naturally, finding an animation for ( , ), when was obtained from an animation of the same skeletal structure, is an easy problem, because all distance constraints are precise and compatible to each other [15]. When the morphology changes from the original character to the target character, instead, it is unlikely that the all distance constraints can be satisfied, so that the best trade-off needs to be identified by minimizing the function ( ) (see equ. (2)).
Some initial studies where the motion adaptation problem is formulated as a dynDGP can be found in [2,15,17]. However, these studies pointed out some limitations in the use of the Euclidean distance for this particular application. The Euclidean distance, in fact, can fail in providing information about the dynamics of the considered animation, because it focuses only on one snapshot of the animation per time. This observation motivated the main aim of this paper: the next section will introduce the concept of interaction distance, and will study some basic properties.

The interaction distance
Immanuel Kant, whose works preceding the criticism were influenced by his readings of Newton and Leibniz, compared time (in his early writings on the topic) to a point moving on an infinite line [22]. Moreover, such a line was oriented, because "time instants do not depend reciprocally on each other, it is rather the instant that precedes which determines the one that follows; this is the reason why time admits only one dimension" [7].
In the same spirit, the main idea behind the interaction distance is to consider the dynamics of the problem through the semi-straight lines (only the future information is taken into consideration) defined by given joint positions at two consecutive time frames. Let and ∈ be two distinct joints. The orientation of the joint at the current frame > 1 can be obtained by using two positions: the position of at the previous frame −1 = ( −1 , −1 , −1 ), and its current position . The semi-straight line ℓ defined by −1 and , having as a boundary and not including −1 , provides an approximation of the trajectory of at further frames in the hypothesis there will be no changes in the joint orientation. Moreover, in the hypothesis the joint speed is also constant, it is possible to select a discrete subset of equidistant points on ℓ representing potential positions for at future time steps. The discrete set of potential future positions for is therefore given by the equation: Once a similar discrete set of potential positions for the joint is computed, the interaction distance between and can be measured by studying how these potential position points on the two semistraight lines ℓ and ℓ approach one another.

Definition 12. (The interaction distance).
Given a skeletal structure ( , ) and an animation , the "interaction distance" ( , ) at frame > 1 between two joints , ∈ is: where is the Euclidean distance.
From a geometric point of view, the interaction distance gives a measure of the relative approach between two joints by using only the information about their current position and orientation. It follows immediately from the definition that interaction distances between joints can be computed at every frame of the animation, except the frame 1, and that two consecutive frames are involved in the computation of this distance. Fig. 2 shows a graphical representation of the interaction distance for a simple animation.
It is important to remark that the idea to use semi-straight lines to define a distance function is not completely new. A distance with exactly the same name ("interaction distance") was already introduced in the context of ballistics [6] (see Ch.24, Distances in Physics), but it differs from the definition given above for the domain of (which is discrete in the definition above). Moreover, in the context of robotics, semi-straight lines were also used in [21] with the aim of verifying an entire set of intermediary configurations for robot arms, instead of only a few positions. This use of the semi-straight lines is evidently different from the one in the definition of interaction distance.
Since the interaction distance is, by definition, the smallest Euclidean distance between selected points on two straight lines, which also include the two points and , it follows that the interaction distance between two joints and at frame > 1 is always smaller than, or at most equal to, the Euclidean distance between the current positions of the two joints at frame . Рис. 2: A graphical representation of the interaction distance between two joints (wrist of approaching arm in red, and steady opposite shoulder in blue) in a simple animation. Since one joint is steady, it is necessary to compute the semi-straight line (light red) only for one of the two joints. It is possible to notice that the interaction distance (blue segment) is able to "anticipate" the detection of potential joint contacts. The potential interaction is finally not completely attained, because the value of the interaction distance at the third shown frame is smaller than the Euclidean distance in the last frame, where the Euclidean and interaction distances coincide. Proposition 2. The interaction distance is not a metric, but rather a symmetric quasidistance.
Proof The three properties that a symmetric quasi-distance and a metric have in common can be easily verified: The other two additional properties of a metric are instead not satisfied. The interaction distance does not satisfy the "identity of indiscernibles" property, because a distance equal to 0 does not necessarily imply that and are actually the same. As the reflexivity property shows, in fact, the distance between one joint and itself is 0 (because the two straight lines ℓ and ℓ coincide), but the converse implication is not true in general: ( , ) can be equal to 0 when two distinct joints will collide when continuing to travel along their current trajectories in future frames (in other words, when the two straight lines ℓ and ℓ intersect in the common point where the collision occurs).
The second property of a metric that is not satisfied is the triangular inequality. Suppose that the joints and are fixed in two distinct positions during the animation, while the joint "travels" on the straight line defined by and in their direction, so that ( , ) and ( , ) are both equal to 0. Let be the Euclidean distance between and , which is strictly larger than 0 by hypothesis. The triangular inequality would imply: which brings to a contradiction. 2 Notice that, for any given distance function ( , ), if the distance value^is known and one of the two points is fixed, say , then the set contains all points such that the distance between and is equal to^. When is the Euclidean distance, it is well-known that Π is a sphere centered in and having radius^. When the interaction distance is concerned, fixing implies the definition of the semi-straight line ℓ , from which all potential interaction points ( , ), for every , can be extracted (because the step − −1 is known).
Let^be the known value for the interaction distance between the two joints and at the time step . Every interaction point ( , ) on ℓ corresponds to a sphere ( −1 ) centered in ( , ) and having radius^. The points in Π are therefore those lying on the semi-straight lines passing through −1 and any other point of ( −1 ), for any . Once one semi-straight line ℓ is selected, the corresponding value of can be deduced from the sphere ( −1 ) that ℓ intersects. This value is necessary to set the intersection point time steps after −1 : the position corresponds to the point of ℓ placed only one time step further ( = 1).
In the hypothesis that more than one distance constraint concerns the same point (the unknown), so that the system of equations can be defined, the feasible points for lie on the intersection of the several sets Π. Intuitively, this intersection is related to a set of semi-straight lines which do not only pass through the point , but also through the points of ( −1 ) ∩ · · · ∩ ( −1 ), for every . Since the value of needs to be the same for every semi-straight line, each intersection concerns only the spheres related to the same : the number of spheres to intersect, for every , depends on the number of distance constraints (see Fig. 3 for a graphical representation in 2D). These sphere intersections may be for example empty (indicating that the target distance cannot be attained for the fixed value of ), or they could enjoy special properties, such as the ones studied in [18] in the context of distance geometry with the Euclidean distance. This is the current research direction.

Conclusions
Some initial empirical studies on the interaction distance computed for the joints of humanlike character animations have shown that this new distance can, differently from the Euclidean distance, anticipate joint contacts and collisions of several frames before they actually occur (see Fig. 2). This is of fundamental importance in real-time applications, where the future is actually not known yet (differently from other applications where an animation may be preprocessed in order to find out its critical parts).
Even if the interaction distance is introduced in this article in the context of human motion adaptation, it is important to point out that the problem of "collision detection" arises in many other contexts, such as aircraft and robot trajectory planning, and crowd simulations, to name a few important examples. In some early studies of pedestrians collision avoidance [5], a short survey on previous works proposed a classification on the two main approaches to the problem: those which focus on the idea to predict when a collision is going to occur; the others where the main question is whether the collision is going to take place or not. The interaction distance introduced in this work makes a bridge between these two main approaches: small values of the distance indicates in fact that joints are going to approach each other; moreover, the value of (see Def. 12) corresponding to the distance value indicates how many time steps are necessary for the contact to actually take place.
However, while the interaction distance already finds its interest from a mathematical point of view, the real practical benefits in using it in real-life applications still need to be verified.
Рис. 3: An example in 2D where the set of feasible semi-straight lines for reduces to two lines when = 2 (only one of the two is reported in gray in the figure). The spheres ( ) on ℓ , as well as the spheres ( ) on ℓ , intersect in fact only when is set to 2 (the values of are reported inside the spheres). Once one semi-straight line ℓ is selected, the point (the unknown) is the point on the line corresponding to = 1.
In particular, the definition and solution of dynDGP instances related to human-like character animations, where the interaction distance replaces the classical Euclidean distance, will be the subject of future publications.

Dedication
This article is dedicated to the memory of Michel Deza (1939Deza ( -2016. The reason to dedicating this work to him is not only because it is going to appear in a journal special issue where contributions from a recent conference, dedicated to his 80 ℎ birthday, are collected. The main reason is actually that most of this work was inspired by the reading of the wonderful Encyclopedia of Distances, that Michel authored with his wife.