Compares column directions of two loading matrices and returns a diagonal matrix
of +1/-1 signs. If the angle between corresponding columns exceeds 90 degrees,
the sign is -1 (flip), otherwise +1 (keep). Input dot products are clamped to
[-1, 1] before acos to avoid NaN from floating-point overshoot.
flipSigns(V1, V2)Diagonal matrix (ncol x ncol) with +1 or -1 on the diagonal
matrix with reference vectors as columns (e.g. global loadings)
matrix with vectors to align as columns (e.g. local loadings)