sym.rot2 module

class Rot2(z=None)[source]

Bases: object

Autogenerated Python implementation of symforce.geo.rot2.Rot2.

Group of two-dimensional orthogonal matrices with determinant +1, representing rotations in 2D space. Backed by a complex number.

Parameters:

z (T.Union[T.Sequence[float], numpy.ndarray, None]) –

data: List[float]
classmethod random()[source]
Return type:

Rot2

compose_with_point(right)[source]

Left-multiplication. Either rotation concatenation or point transform.

Parameters:

right (Rot2) –

Return type:

ndarray

static from_angle(theta)[source]

Create a Rot2 from an angle theta in radians

This is equivalent to from_tangent([theta])

Parameters:

theta (float) –

Return type:

Rot2

to_rotation_matrix()[source]

A matrix representation of this element in the Euclidean space that contains it.

Return type:

ndarray

static from_rotation_matrix(r)[source]

Create a Rot2 from a 2x2 rotation matrix.

Returns the closest Rot2 to the input matrix, by the Frobenius norm. Will be singular when r[0, 0] == -r[1, 1] and r[0, 1] == r[1, 0] are both true.

See notebooks/rot2_from_rotation_matrix_derivation.ipynb for the derivation.

Parameters:

r (ndarray) –

Return type:

Rot2

static random_from_uniform_sample(u1)[source]

Generate a random element of SO2 from a variable uniformly sampled on [0, 1].

Parameters:

u1 (float) –

Return type:

Rot2

static storage_dim()[source]
Return type:

int

to_storage()[source]
Return type:

List[float]

classmethod from_storage(vec)[source]
Parameters:

vec (Sequence[float]) –

Return type:

Rot2

classmethod identity()[source]
Return type:

Rot2

inverse()[source]
Return type:

Rot2

compose(b)[source]
Parameters:

b (Rot2) –

Return type:

Rot2

between(b)[source]
Parameters:

b (Rot2) –

Return type:

Rot2

static tangent_dim()[source]
Return type:

int

classmethod from_tangent(vec, epsilon=1e-08)[source]
Parameters:
Return type:

Rot2

to_tangent(epsilon=1e-08)[source]
Parameters:

epsilon (float) –

Return type:

ndarray

retract(vec, epsilon=1e-08)[source]
Parameters:
Return type:

Rot2

local_coordinates(b, epsilon=1e-08)[source]
Parameters:
Return type:

ndarray

interpolate(b, alpha, epsilon=1e-08)[source]
Parameters:
Return type:

Rot2