@@ -119,18 +119,19 @@ def test_13_1_3(self):
119
119
self .assertEqual (im_s | im_s , - alpha * alpha * r * r )
120
120
self .assertEqual (- self .inf | im_s , alpha )
121
121
122
+ def symbol_vector (self , name = 'n' , normalize = False ):
123
+ nx = Symbol (name + 'x' , real = True )
124
+ ny = Symbol (name + 'y' , real = True )
125
+ nz = Symbol (name + 'z' , real = True )
126
+ return self .vector (nx , ny , nz ) / (sqrt (nx * nx + ny * ny + nz * nz ) if normalize else S .One )
127
+
122
128
def test_13_2_2 (self ):
123
129
"""
124
130
Proper Euclidean motions as even versors : Translations.
125
131
"""
126
-
127
- nx = Symbol ('nx' , real = True )
128
- ny = Symbol ('ny' , real = True )
129
- nz = Symbol ('nz' , real = True )
130
-
131
- n = self .vector (nx , ny , nz ) / sqrt (nx * nx + ny * ny + nz * nz )
132
132
delta_1 = Symbol ('delta_1' , real = True )
133
133
delta_2 = Symbol ('delta_2' , real = True )
134
+ n = self .symbol_vector ('n' , normalize = True )
134
135
135
136
Tt = self .dual_plane (n , delta_2 ) * self .dual_plane (n , delta_1 )
136
137
@@ -141,3 +142,23 @@ def test_13_2_2(self):
141
142
r = Tt * self .o * Tt .inv ()
142
143
t = self .point (1 , 2 * (delta_2 - delta_1 ) * n )
143
144
self .assertEqual (r , t )
145
+
146
+ # TODO: This exponential isn't available in galgebra
147
+ #Te = (-t * self.inf * S.Half).exp()
148
+ #self.assertEqual(Te * Te.rev(), 1)
149
+ #self.assertEqual(Te, Tt)
150
+
151
+ def test_13_2_3 (self ):
152
+ """
153
+ Proper Euclidean motions as even versors : Rotations in the origin.
154
+ """
155
+ n0 = self .symbol_vector ('n0' )
156
+ n1 = self .symbol_vector ('n1' )
157
+ R = n1 * n0 # 2 reflections
158
+ Rinv = R .inv ()
159
+
160
+ p = self .symbol_vector ('p' )
161
+
162
+ p0 = R * self .point (1 , p ) * Rinv
163
+ p1 = self .point (1 , R * p * Rinv )
164
+ self .assertEqual (p0 , p1 )
0 commit comments