I want to calculate the cosine distance $$\text{cos}(x_i, x_j) := 1- \frac{x_i \cdot x_j}{\|x_i\|_2 \cdot \|x_j\|_2}$$ between arbitrary pairs of points $x_i, x_j \in \mathbb{R}^n \setminus 0$.
What I can calculate quickly is the euclidean distance
$$d(x_i, x_j) := \|x_i - x_j\|_2$$
Is there a transformation $f: \mathbb{R}^n \setminus 0 \rightarrow \mathbb{R}^k$ so that $\text{cos}(x_i, x_j) = d \left (f(x_i), f(x_j) \right )$?
What I tried
First, I could project all points on a unit sphere:
$$g(x) := \frac{x}{\|x\|_2}$$
This projection should not change any cosine distance. But even with this simplified representation, I'm uncertain if such a function $f$ exists at all and how it would look like.