{'fraction_non_alphanumeric': 0.04875506658946149, 'fraction_numerical': 0.013086276780544297, 'mean_word_length': 4.262644728823888, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Anti-commutative Dual Complex Numbers and 2D Rigid Transformation

We introduce a new presentation of the two dimensional rigid transformation which is more concise and efficient than the standard matrix presentation. By modifying the ordinary dual number construction for the complex numbers, we define the ring of the anti-commutative dual complex numbers, which parametrizes two dimensional rotation and translation all together. With this presentation, one can easily interpolate or blend two or more rigid transformations at a low computational cost. We developed a library for C++ with the MIT-licensed source code and demonstrate its facility by an interactive deformation tool developed for iPad.


Rigid Transformation
The n-dimensional rigid transformation (or Euclidean) group E(n) consists of transformations of R n which preserves the standard metric. This group serves as an essential mathematical backend for many applications (see [2,9]). It is well-known (see [6], for example) that any element of E(n) can be written as a composition of a rotation, a reflection, and a translation, and hence, it is represented by (n + 1) × (n + 1)-homogeneous matrix; Here, we adopt the convention that a matrix acts on a (column) vector by the multiplication from the left. E(n) has two connected components. The identity component SE(n) consists of those without reflection. More precisely, where SO(n) = {R | R t R = I n , det(R) = 1} is the special orthogonal group composed of n-dimensional rotations. The group SE(n) is widely used in computer graphics such as for expressing motion and attitude, displacement ( [10]), deformation ( [1,5,11]), skinning ( [8]), and camera control ( [3]). In some cases, the matrix representation of the group SE(n) is not convenient. In particular, a linear combination of two matrices in SE(n) does not necessarily belong to SE(n) and it causes the notorious candy-wrapper defect in skinning. When n = 3, another representation of SE(3) using the dual quaternion numbers (DQN, for short) is considered in [8] to solve the candy-wrapper defect. In this paper, we consider the 2-dimensional case. Of course, 2D case can be handled by regarding the plane embedded in R 3 and using DQN, but instead, we introduce the anti-commutative dual complex numbers (DCN, for short), which is specific to 2D with much more concise and faster implementation ([13]). To summarise, our DCN has the following advantages: • any number of rigid transformations can be blended/interpolated easily using its algebraic structure with no degeneration defects such as the candy-wrapper defect (see §5) • it is efficient in terms of both memory and CPU usage (see §6). We believe that our DCN offers a choice for representing the 2D rigid transformation in certain applications which requires the above properties.

Anti-commutative dual complex numbers
Let K denote one of the fields R, C, or H, where H is the quaternion numbers. First, we recall the standard construction of the dual numbers over K.
Definition 2.1. The ring of dual numbersK is the quotient ring defined bŷ We often denote an element inK by a symbol with hat such asp.
The following involution is considered to be the dual version of conjugation The unit dual numbers are of special importance.  The unit dual quaternionĤ 1 is successfully used for skinning in [8]; a vector v = (x, y, z) ∈ R 3 is identified with 1 + (xi + y j + zk)ε ∈Ĥ 1 and the conjugation action ofĤ 1 preserves the embedded R 3 and its Euclidean metric. In fact, the conjugation action induces the double coverĤ 1 On the other hand, when K = R or C, the conjugation action is trivial since the corresponding dual numbers are commutative. Therefore, we define the anti-commutative dual complex numbers (DCN, for short)Č by modifying the multiplication ofĈ. That is,Č =Ĉ as a set, and the algebraic operations are replaced by The addition and the conjugation action are kept unchanged. Then, Theorem 2.3.Č satisfies distributive and associative laws, and hence, has a (non-commutative) ring structure.
Similarly to the unit dual quaternion numbers, the unit anti-commutative complex numbers are of particular importance: It forms a group with inverse We define an action ofČ 1 onČ by the conjugation. Now, we regard C = R 2 as usual. Identifying v ∈ C with 1 + vε ∈Č, we see thatČ 1 acts on C as rigid transformation.

Relation to SE(2)
In the previous section, we constructed the unit anti-commutative dual complex numbersČ 1 and its action on C = R 2 as rigid transformation.
0 v, which is the rotation around the origin of degree 2 arg(p 0 ) since |p 0 | = 1. On the other hand, when p 0 = 1, the action corresponds to the translation by 2p 1 . In general, we have ϕ :Č 1 → SE(2) where Re(2p 0 p 1 ) (respectively, Im(2p 0 p 1 )) is the real (respectively, imaginary) part of 2p 0 p 1 ∈ C. Note that this gives a surjective group homomorphism ϕ :Č 1 → SE(2) whose kernel is {±1}. That is, the preimage of any 2D rigid transformation consists of exactly two unit DCN's with opposite signs.
Example 3.1. We compute the DCN's ±p ∈Č 1 which represent θ-rotation around v ∈ C. It is the composition of the following three rigid transformations: (−v)-translation, θ-rotation around the origin, and v-translation. Thus, we havê

Relation to the dual quaternion numbers
The following ring homomorphism is compatible with the involution and the conjugation, and preserves the norm. Furthermore, if we identify v = (x, y) ∈ R 2 with 1 + (x j + yk)ε (= 1 + (x + yi) jε), the above map commutes with the action. From this point of view, DCN is nothing but a sub-ring of DQN. Note also thatČ can be embedded in the ring of the 2 × 2-complex matrices by We thus have various equivalent presentations of DCN. However, our presentation ofČ as the anti-commutative dual numbers is easier to implement and more efficient.
This property is particularly important when transformations are given in a certain hierarchy such as in the case of skinning; if the transformation assigned to the root joint is modified, the skin associated to lower nodes is deformed consistently.
Next, we consider the interpolation of the second type. For this, we need the exponential and the logarithm maps for DCN.
The following is a DCN version of SLERP [12].
Definition 5.3. SLERP interpolation fromp ∈Č 1 toq ∈Č 1 is given by This gives a uniform angular velocity interpolation of two DCN's, while DLB can blend three or more DCN's without the uniform angular velocity property.

Computational cost
We compare the following four methods for 2D rigid transformation: our DCN, the unit dual quaternion numbers (see §4), the 3 × 3-real (homogeneous) matrix representation of SE (2), and the 2 × 2-complex matrices described below.
We list the computational cost in terms of the number of floating point operations for • transforming a point • composing two transformations • converting a transformation to the standard 3 × 3-real matrix representation (except for the 3 × 3-real matrix case where it shows the computational cost to convert to DCN representation). We also give the memory usage for each presentation in terms of the number of floating point units necessary to store a transformation. Note that when a particular application requires to apply a single transformation to a lot of points, it is faster to first convert the DCN to a 3×3-real matrix.

A C++ Library
We implemented our DCN in a form of C++ library. Though it is written in C++, it should be easy to translate to any language. You can download the MIT-licensed source code at [13]. We also developed a small demo application called the 2D probe-based deformer ( [7]) for tablet devices running OpenGL ES (OpenGL for Embedded Systems). Thanks to the efficiency of DCN and touch interface, it offers interactive and intuitive operation. Although we did not try, we believe DCN works well with 2D skinning just as DQN does with 3D skinning. Here we briefly discuss the algorithm of the application. One can place an arbitrary number of probes P 1 , . . . , P n on a target image. The target image is represented by a textured square mesh with vertices v 1 , . . . , v m . The weight w i j of P i 's effect on v j is painted by user or automatically calculated from the distance between v j and P i . When the probes are rotated or translated by the user's touch gesture, the DCNp i is computed which maps the initial state of P i to its current state. The vertex v j is transformed by v j → DLB(p 1 ,p 2 , . . . ,p n ; w 1 j , w 2 j , . . . , w n j ) v j .
(See Equations (3.1) and (5.1) respectively for the definition of the action and DLB.)