Skip to content

Commit 1d21d52

Browse files
authored
Merge pull request #30 from btalb/fix/vec_xyzs
Fix implementation of Quaternion.vec_xyzs
2 parents 7de98ed + 63f4074 commit 1d21d52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spatialmath/quaternion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def vec_xyzs(self):
240240
:return: quaternion expressed as a 4-vector
241241
:rtype: numpy ndarray, shape=(4,)
242242
243-
``q.vec`` is the quaternion as a vector. If `len(q)` is:
243+
``q.vec_xyzs`` is the quaternion as a vector. If `len(q)` is:
244244
245245
- 1, return a NumPy array shape=(4,)
246246
- N>1, return a NumPy array shape=(N,4).
@@ -258,9 +258,9 @@ def vec_xyzs(self):
258258
>>> Quaternion([np.r_[1,2,3,4], np.r_[5,6,7,8]]).vec_xyzs
259259
"""
260260
if len(self) == 1:
261-
return self._A
261+
return np.roll(self._A, -1)
262262
else:
263-
return np.array([q._A for q in self])
263+
return np.array([np.roll(q._A, -1) for q in self])
264264

265265
@property
266266
def matrix(self):

0 commit comments

Comments
 (0)