klampt.math.so2 module

Operations for 2D rotations. Rotations are represented by a single number giving the angle in radians.

klampt.math.so2.apply(a, pt)[source]

Applies a rotation of the angle a about the origin to the point pt

klampt.math.so2.compose(a, b)[source]

Returns the composition of rotations a and b

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]


Returns the rotation angle of a rotation matrix


The identity rotation. Here for compatibility with so3.py

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).


The inverse rotation


Returns the 2x2 rotation matrix representing a rotation about the angle a


Returns an angle a normalized to the range [0,2pi]