Skip to content

Commit 8813480

Browse files
committed
Add theta method
norm of angle about the screw
1 parent a5011df commit 8813480

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎spatialmath/twist.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ def unit(self):
183183
"""
184184
return Twist3(base.unitvec(self.S))
185185

186+
def theta(self):
187+
"""
188+
Twist angle (superclass method)
189+
190+
:return: magnitude of rotation (1x1) about the twist axis in radians
191+
:rtype: float
192+
"""
193+
if self.N == 2:
194+
return abs(self.w)
195+
else:
196+
return base.norm(np.array(self.w))
197+
186198
def inv(self):
187199
"""
188200
Inverse of Twist (superclass method)

0 commit comments

Comments
 (0)