Skip to contents

For the flat torus \(T^d\) with base point p, the cut locus is cut(p) = {q : (q_j - p_j) mod 1 = 0.5 for some j}. A sample point q is on the cut locus iff p_j = (q_j - 0.5) mod 1 for some coordinate j. To make the cut locus disjoint from the sample, the function chooses, independently for each coordinate j, a value p_j that is not equal to any of the forbidden values (q_ij - 0.5) mod 1, i.e., a point in the largest circular gap of the forbidden set. This yields a base point with zero cut-locus overlap (up to floating-point tolerance) by construction, rather than by search, but it is not centered on the data in any other sense.

Usage

auto_base_point_torus(X)

Arguments

X

A matrix or data frame of torus data in \([0,1)^d\); rows are samples, columns are coordinates.

Value

Numeric vector of length ncol(X): the chosen base point.

Examples

X <- matrix(runif(20), nrow = 10, ncol = 2)
auto_base_point_torus(X)
#> [1] 0.002664312 0.694142785