Function lupnt::AngleBetweenVecs(const MatX&, const MatX&)

Function Documentation

VecX lupnt::AngleBetweenVecs(const MatX &x, const MatX &y)

Row-wise angle between corresponding rows of x and y [rad].

Matrix overload of AngleBetweenVecs; computed via acos of the row-wise dot-product of normalized rows (clamped to [-1, 1]).

Parameters:
  • x – Matrix whose rows are vectors to compare

  • y – Matrix whose rows are vectors to compare (same shape as x)

Returns:

Vector of per-row angles [rad], in [0, pi]