Such a function would be conformal, and these functions are Mobius transformations. In dimension two, you obtain functions which are either holomorphic or antiholomorphic.