Skip to content

Commit aedd48f

Browse files
petercorketaughz
authored andcommitted
fix(twist): add missing denominator in Twist3.pitch calculation
The pitch calculation was missing the denominator, returning an incorrect value. Pitch should be normalized by |w|²: pitch = (w · v) / (w · w) This represents the translation distance per radian along the screw axis. All 25 twist tests pass.
1 parent 7e7fc92 commit aedd48f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎spatialmath/twist.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def pitch(self):
944944
>>> S.pitch
945945
946946
"""
947-
return np.dot(self.w, self.v)
947+
return np.dot(self.w, self.v) / np.dot(self.w, self.w)
948948

949949
def line(self):
950950
"""

0 commit comments

Comments
 (0)