Function lupnt::AngleBetweenVecs(const VecX&, const VecX&)¶
Defined in File math_utils.cc
Function Documentation¶
-
Real lupnt::AngleBetweenVecs(const VecX &x, const VecX &y)¶
Compute the angle between two vectors.
Angle between two vectors [rad], computed via the numerically robust
2*atan2(|n1-n2|, |n1+n2|)formula (avoids the precision loss ofacos(dot)near 0 and pi), wheren1,n2are the normalized inputs.- Parameters:
x – First vector
y – Second vector
x – First vector
y – Second vector
- Returns:
Angle between the two vectors in radians
- Returns:
Angle between
xandy[rad], in[0, pi]