8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90b6166 commit d2e167aCopy full SHA for d2e167a
spatialmath/base/vectors.py
@@ -499,6 +499,27 @@ def unittwist2_norm(S):
499
500
return (S / th, th)
501
502
+def wrap_0_2pi(theta):
503
+ r"""
504
+ Wrap angle to range [0, 2pi)
505
+
506
+ :param theta: input angle
507
+ :type theta: scalar or ndarray
508
+ :return: angle wrapped into range :math:`[0, 2\pi)`
509
+ """
510
+ return theta - 2.0 * math.pi * np.floor(theta / 2.0 / np.pi)
511
512
513
+def wrap_mpi_pi(angle):
514
515
+ Wrap angle to range [-pi, pi)
516
517
518
519
+ :return: angle wrapped into range :math:`[-\pi, \pi)`
520
521
+ return np.mod(angle + math.pi, 2 * math.pi) - np.pi
522
523
524
def angdiff(a, b=None):
525
"""
0 commit comments