Function lupnt::AngleBetweenVecs(const MatX&, const MatX&)¶
Defined in File math_utils.cc
Function Documentation¶
-
VecX lupnt::AngleBetweenVecs(const MatX &x, const MatX &y)¶
Compute the angle between two vectors.
Row-wise angle between corresponding rows of
xandy[rad].Matrix overload of
AngleBetweenVecs; computed viaacosof the row-wise dot-product of normalized rows (clamped to[-1, 1]).- Parameters:
x – First vector
y – Second vector
x – Matrix whose rows are vectors to compare
y – Matrix whose rows are vectors to compare (same shape as
x)
- Returns:
Angle between the two vectors in radians
- Returns:
Vector of per-row angles [rad], in
[0, pi]