angles_to_polysph: Conversion between the angular and Cartesian coordinates of...

View source: R/angles.R

angles_to_polysphR Documentation

Conversion between the angular and Cartesian coordinates of the polysphere

Description

Obtain the angular coordinates of points on a polysphere \mathcal{S}^{d_1}\times\cdots\times\mathcal{S}^{d_r}, and vice versa.

Usage

angles_to_polysph(theta, d)

polysph_to_angles(x, d)

Arguments

theta

matrix of size c(n, sum(d)) with the angles.

d

vector with the dimensions of the polysphere.

x

matrix of size c(n, sum(d + 1)) with the Cartesian coordinates on \mathcal{S}^{d_1}\times\cdots\times\mathcal{S}^{d_r}. Assumed to be of unit norm by blocks of coordinates in the rows.

Value

  • angles_to_polysph: the matrix x.

  • polysph_to_angles: the matrix theta.

Examples

# Check changes of coordinates
polysph_to_angles(angles_to_polysph(rep(pi / 2, 3), d = 2:1), d = 2:1)
angles_to_polysph(polysph_to_angles(x = c(0, 0, 1, 0, 1), d = 2:1), d = 2:1)

polykde documentation built on April 16, 2025, 1:11 a.m.