frechet_median_on_sphere: Compute the Spherical Frechet Median

View source: R/ETDQualitizer.R

frechet_median_on_sphereR Documentation

Compute the Spherical Frechet Median

Description

Finds the unit direction that minimizes the sum of angular distances to a collection of 3D direction vectors. Non-finite rows are ignored.

Usage

frechet_median_on_sphere(vectors, tol = 1e-12, max_iter = 128)

Arguments

vectors

Numeric matrix with three columns containing 3D direction vectors.

tol

Convergence tolerance (default: 1e-12).

max_iter

Maximum number of optimization iterations (default: 128).

Value

A numeric vector of length three containing the spherical Frechet median, or three NaNs if no finite vectors are provided.

Examples

frechet_median_on_sphere(rbind(c(0, 0, 1), c(0, 0, 1)))

ETDQualitizer documentation built on Oct. 19, 2026, 5:11 p.m.