mathy stuff to prevent jump discontinuities in animations and to impose uniqueness on matrix decomposition