Dimension independent sign correction.
Trig math.