# skbot.transform.Rotation¶

class skbot.transform.Rotation(u, v, *, axis=- 1)[source]

Planar rotation in N-D.

The plane of rotation is described by two vectors (u, v). The initial angle of rotation is twice the angle between u and v (measured from u to v) and can be modified by setting the angle explicitly, e.g. ```link.angle = np.pi```. The angle is measured in radians.

Parameters
uArrayLike

The first vector defining the plane of rotation. The angle is mesured from here.

vArrayLike

The second vector defining the plane of rotation. The angle is measured to here, i.e., from u to v.

Notes

Implements __inverse_transform__.

If you wish to initialize a rotation that rotates u onto v, and both are of same length, you can use `tf.Rotation(u+v, v)`.

Attributes

 `affine_matrix` The transformation matrix mapping the parent to the child frame. `angle` The magnitude of the rotation (in radians).

Method Summary

 `__call__`(parent[, child, add_inverse]) Add this link to the parent frame. Return a new Link that is the inverse of this link. Expresses the vector x (assumed to be given in the parent's frame) in the child's frame. Transform x (given in the child frame) into the parent frame.

Methods

Parameters
parentFrame

The Frame from which vectors originate.

childFrame

The Frame in which vectors are expressed after they were mapped by this link’s transform. If None, a new child will be created.

Also add the inverse link to the child if this Link is invertible. Defaults to `True`.

Returns
childFrame

The Frame in which vectors are expressed after they were mapped by this link’s transform.

Return type

`Frame`

invert()

Return type

`Frame`

transform(x)[source]

Expresses the vector x (assumed to be given in the parent’s frame) in the child’s frame.

Parameters
xArrayLike

The vector expressed in the parent’s frame

Returns
yArrayLike

The vector expressed in the child’s frame

Return type

`ndarray`

__inverse_transform__(x)[source]

Transform x (given in the child frame) into the parent frame.

Parameters
xArrayLike

The vector expressed in the childs’s frame

Returns
yArrayLike

The vector expressed in the parents’s frame

Return type

`ndarray`