Assume, one has a 3-D non-euclidean space of points $p_i = \left(x_i, y_i, z_i\right) \in \mathcal{R}^2 \times \mathcal{R}_{> 0}$ with the following "distance" function $d\left(p_1, p_2\right) = \log \left( \frac{\frac{z_1}{z_2} + \frac{z_2}{z_1}}{2} \right) + \frac{(x_2 - x_1)^2 + (y_2 - y_1)^2}{2(z_1^2 + z_2^2)}$ that does not satisfy the triangle law. So step $\Delta r$ in $xy$-plane is not interchangable with step $\Delta z = \Delta r$ in z-direction.

Further, some table $T$ of points like $(p_i, g(p_i))$, where $g$ is a parabolic function (a function that is at most quadratic in the $x,y,z$ coordinates), is given. How can I find a maximum of $g$ given table $T$ with respect to "distance" function $d$?

Thank you!