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]

klampt.math.so2.from_matrix(R)[source]

Returns the rotation angle of a rotation matrix

klampt.math.so2.identity()[source]

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

klampt.math.so2.inv(a)[source]

The inverse rotation

klampt.math.so2.matrix(a)[source]

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

klampt.math.so2.normalize(a)[source]

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