Skip to contents

Class for the special orthogonal group \(\mathrm{SO}(2)\) in vector form, i.e. the Lie group of planar rotations. This class is specific to the vector representation of rotations. For the matrix representation, use the SpecialOrthogonal class and set n = 2.

See also

Author

Nicolas Guigui and Nina Miolane

Super classes

rgeomstats::PythonClass -> rgeomstats::Manifold -> rgeomstats::LieGroup -> rgeomstats::SpecialOrthogonalVectors -> SpecialOrthogonal2Vectors

Methods

Inherited methods


Method new()

The SpecialOrthogonal2Vectors class constructor.

Usage

SpecialOrthogonal2Vectors$new(epsilon = 0, py_cls = NULL)

Arguments

epsilon

A numeric value specifying the precision to use for calculations involving potential division by 0 in rotations. Defaults to 0.

py_cls

A Python object of class SpecialOrthogonal2Vectors. Defaults to NULL in which case it is instantiated on the fly using the other input arguments.

Returns

An object of class SpecialOrthogonal2Vectors.


Method rotation_vector_from_matrix()

Converts rotation matrix (in 2D) to rotation vector (axis-angle) getting the angle through the atan2() function.

Usage

SpecialOrthogonal2Vectors$rotation_vector_from_matrix(rot_mat)

Arguments

rot_mat

A numeric array of shape \([\dots \times 2 \times 2]\) specifying one or more 2D rotation matrices.

Returns

A numeric array of shape \([\dots \times 1]\) storing the corresponding axis-angle representations.

Examples

if (reticulate::py_module_available("geomstats")) {
  so2 <- SpecialOrthogonal(n = 2, point_type = "vector")
  so2$rotation_vector_from_matrix(diag(1, 2))
}


Method matrix_from_rotation_vector()

Convert a 2D rotation from vector to matrix representation.

Usage

SpecialOrthogonal2Vectors$matrix_from_rotation_vector(rot_vec)

Arguments

rot_vec

A numeric array of shape \(... \times 1\) specifying one or more 2D rotations in vector representation.

Returns

A numeric array of shape \(... \times 2 \times 2\) storing the corresponding 2D rotation matrices.

Examples

if (reticulate::py_module_available("geomstats")) {
  so2 <- SpecialOrthogonal(n = 2, point_type = "vector")
  so2$matrix_from_rotation_vector(array(0))
}


Method random_uniform()

Samples in \(\mathrm{SO}(2)\) from a uniform distribution.

Usage

SpecialOrthogonal2Vectors$random_uniform(n_samples = 1)

Arguments

n_samples

An integer value specifying the sample size. Defaults to 1L.

Returns

A numeric array of shape \(... \times 1\) storing a sample of 2D rotations in axis-angle representation uniformly sampled in \(\mathrm{SO}(2)\).


Method clone()

The objects of this class are cloneable with this method.

Usage

SpecialOrthogonal2Vectors$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `SpecialOrthogonal2Vectors$rotation_vector_from_matrix`
## ------------------------------------------------

if (reticulate::py_module_available("geomstats")) {
  so2 <- SpecialOrthogonal(n = 2, point_type = "vector")
  so2$rotation_vector_from_matrix(diag(1, 2))
}

## ------------------------------------------------
## Method `SpecialOrthogonal2Vectors$matrix_from_rotation_vector`
## ------------------------------------------------

if (reticulate::py_module_available("geomstats")) {
  so2 <- SpecialOrthogonal(n = 2, point_type = "vector")
  so2$matrix_from_rotation_vector(array(0))
}