@@ -119,18 +119,19 @@ def test_13_1_3(self):
119119 self .assertEqual (im_s | im_s , - alpha * alpha * r * r )
120120 self .assertEqual (- self .inf | im_s , alpha )
121121
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+
122128 def test_13_2_2 (self ):
123129 """
124130 Proper Euclidean motions as even versors : Translations.
125131 """
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 )
132132 delta_1 = Symbol ('delta_1' , real = True )
133133 delta_2 = Symbol ('delta_2' , real = True )
134+ n = self .symbol_vector ('n' , normalize = True )
134135
135136 Tt = self .dual_plane (n , delta_2 ) * self .dual_plane (n , delta_1 )
136137
@@ -141,3 +142,23 @@ def test_13_2_2(self):
141142 r = Tt * self .o * Tt .inv ()
142143 t = self .point (1 , 2 * (delta_2 - delta_1 ) * n )
143144 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