R/maths_functions.R
median_quaternion.RdTakes a matrix of 4-element quaternion vectors, unifies their hemispherical
signs to handle the double-cover property, and finds the geometric median
rotation using Weiszfeld's algorithm via the pracma library.
median_quaternion(q_matrix)A normalized 4-element numeric vector representing the median quaternion.