Applies the logarithmic map to send torus data in \([0,1)^d\)
into the tangent space \([-0.5, 0.5)^d\) at base point p: for
each coordinate, (x - p + 0.5) %% 1 - 0.5, i.e. the shortest
signed offset from p on that coordinate's circle. Points on the
cut locus of p map to -0.5 in the affected coordinates; see
is_valid_torus.
Examples
X <- matrix(runif(20), nrow = 10, ncol = 2)
log_map_torus(X, p = c(0.5, 0.5))
#> [,1] [,2]
#> [1,] -0.240181756 -0.4959180
#> [2,] -0.481093830 0.1568564
#> [3,] 0.221405048 -0.3490711
#> [4,] 0.452809649 -0.3008393
#> [5,] -0.059776696 -0.2603617
#> [6,] 0.004012379 0.1615740
#> [7,] -0.456443002 -0.2582112
#> [8,] 0.422474456 -0.4284503
#> [9,] 0.423789556 0.2046719
#> [10,] 0.105647714 -0.1846031
