klampt.math.so2 module
Operations for 2D rotations. Rotations are represented by a single number giving the angle in radians.
- klampt.math.so2.identity()[source]
The identity rotation. Here for compatibility with so3.py
- Return type:
float
- klampt.math.so2.apply(a, pt)[source]
Applies a rotation of the angle a about the origin to the point pt.
- Return type:
Sequence
[float
]
- klampt.math.so2.normalize(a)[source]
Returns an angle a normalized to the range [0,2pi].
- Return type:
float
- klampt.math.so2.diff(a, b)[source]
returns the CCW difference between angles a and b, i.e. the amount that you’d neet to rotate from b to get to a. The result is in the range [-pi,pi].
- Return type:
float
- klampt.math.so2.interp(a, b, u)[source]
interpolates on the geodesic between angles a and b, with interpolation parameter u in the range [0,1] (can also be used for extrapolation).
- Return type:
float
- klampt.math.so2.compose(a, b)[source]
Returns the composition of rotations a and b.
- Return type:
float
- klampt.math.so2.matrix(a)[source]
Returns the 2x2 rotation matrix representing a rotation about the angle a.
- Return type:
List
[List
[float
]]
- klampt.math.so2.from_matrix(R)[source]
Returns the rotation angle of a rotation matrix.
- Return type:
float