Skip to content

Commit 0a97e6e

Browse files
committed
Added constrained uniform sampling of angles
1 parent 739e59a commit 0a97e6e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

spatialmath/base/quaternions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def _compute_cdf_sin_squared(theta: float):
2828
"""
2929
Computes the CDF for the distribution of anular magnitude for uniformly sampled rotations.
3030
31-
:arg theta: anglular magnitude
31+
:arg theta: angular magnitude
3232
:rtype: float
33-
:return: cdf of a given anglular magnitude
33+
:return: cdf of a given angular magnitude
3434
:rtype: float
3535
3636
Helper function for uniform sampling of rotations with constrained angular magnitude.
@@ -869,15 +869,15 @@ def qrand(theta_range:Optional[ArrayLike2] = None, unit: str = "rad") -> UnitQua
869869
"""
870870
Random unit-quaternion
871871
872-
:arg theta_range: anglular magnitude range [min,max], defaults to None.
872+
:arg theta_range: angular magnitude range [min,max], defaults to None.
873873
:type xrange: 2-element sequence, optional
874874
:arg unit: angular units: 'rad' [default], or 'deg'
875875
:type unit: str
876876
:return: random unit-quaternion
877877
:rtype: ndarray(4)
878878
879879
Computes a uniformly distributed random unit-quaternion, with in a maximum
880-
anglular magnitude, which can be considered equivalent to a random SO(3) rotation.
880+
angular magnitude, which can be considered equivalent to a random SO(3) rotation.
881881
882882
.. runblock:: pycon
883883

spatialmath/pose3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def Rand(cls, N: int = 1, *, theta_range:Optional[ArrayLike2] = None, unit: str
461461
462462
:param N: number of random rotations
463463
:type N: int
464-
:param theta_range: anglular magnitude range [min,max], defaults to None.
464+
:param theta_range: angular magnitude range [min,max], defaults to None.
465465
:type xrange: 2-element sequence, optional
466466
:param unit: angular units: 'rad' [default], or 'deg'
467467
:type unit: str
@@ -1533,7 +1533,7 @@ def Rand(
15331533
:type yrange: 2-element sequence, optional
15341534
:param zrange: z-axis range [min,max], defaults to [-1, 1]
15351535
:type zrange: 2-element sequence, optional
1536-
:param theta_range: anglular magnitude range [min,max], defaults to None -> [0,pi].
1536+
:param theta_range: angular magnitude range [min,max], defaults to None -> [0,pi].
15371537
:type xrange: 2-element sequence, optional
15381538
:param unit: angular units: 'rad' [default], or 'deg'
15391539
:type unit: str

spatialmath/quaternion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ def Rand(cls, N: int = 1, *, theta_range:Optional[ArrayLike2] = None, unit: str
12311231
12321232
:param N: number of random rotations
12331233
:type N: int
1234-
:param theta_range: anglular magnitude range [min,max], defaults to None -> [0,pi].
1234+
:param theta_range: angular magnitude range [min,max], defaults to None -> [0,pi].
12351235
:type xrange: 2-element sequence, optional
12361236
:param unit: angular units: 'rad' [default], or 'deg'
12371237
:type unit: str

0 commit comments

Comments
 (0)