I am hoping someone may be able to dispel a doubt I have. I am working on an application where I have a digital representation of a terrain. I generate a spherical representation of the terrain around a location on this terrain (i.e. I end up radial distance, azimuthal angle, and polar angle). Putting aside the fact that I am going to have many 'discontinuities' (due to the presence of horizons), I would like to find the first and second derivatives... in order to characterize the curvature. What formulae would I use? Would it suffice to numerically differentiate as you would in the cartesian planes? or would I need to adjust this differentiation based the formulae found for gradient differentiation here.
I hope this makes sense.
Here is an image where the color represents depth and the x and y axis represent angular values. enter image description here
M
Too long for a comment:
Discrete data $f(x_1^i,\dots,x_n^i)$ on $\mathbb R^n$ can reasonably be differentitated only in the following way: $$ \partial_jf(x_1^i,\dots\dots,x_n^i)\approx \frac{f(x_1^i,\dots,x_{j-1}^i, x_j^{i+1},x_{j+1}^i,\dots,x_n^i)- f(x_1^i,\dots\dots,x_n^i)}{x_j^{i+1}-x_j^i}\,. $$ This is a difference quotient known in numerical mathematics. If you like you can make this symmetric by using $x_j^{i+1}$ and $x_j^{i-1}\,.$ The write up of a mixed second partial derivative should be straightforward.