c \;\; & b{\end{array}\right]}{\left[\begin{array}{c}}x\\y{\end{array}\right]}= z_0 + {\boldsymbol{X}}^\intercal {\boldsymbol{A}} {\boldsymbol{X}}
$$ with $$a = \frac12{\frac{\partial^2{z}}{\partial{x}^2}}, \quad b = \frac12{\frac{\partial^2{z}}{\partial{y}^2}}, \quad c = \frac12\frac{\partial^2 z}{\partial x\partial y}.$$ To determine the surface principal curvatures and their orientation, we seek for such rotation $\varphi$ of $\{x,y\}$ coordinates $${\boldsymbol{X}} = {\boldsymbol{Q}} {\boldsymbol{X}}',\quad {\boldsymbol{X}} =  {\left[\begin{array}{c}}x\\y{\end{array}\right]},\quad {\boldsymbol{X}}' =  {\left[\begin{array}{c}}x'\\y'{\end{array}\right]},\quad {\boldsymbol{Q}} =  {\left[\begin{array}{cc}}\cos(\varphi) & \sin(\varphi)\\ -\sin(\varphi) & \cos(\varphi) {\end{array}\right]}$$ that the resulting form is diagonal: $$z(x,y) = z_0 + {\boldsymbol{X}}'^\intercal {\boldsymbol{Q}}^\intercal {\boldsymbol{A}} {\boldsymbol{Q}} {\boldsymbol{X}}', \quad {\boldsymbol{Q}}^\intercal {\boldsymbol{A}} {\boldsymbol{Q}} = {\left[\begin{array}{cc}}\lambda_1 \;\; & 0 \\ 0\;\; & \lambda_2 {\end{array}\right]}.$$ The angle $\varphi$ that ensures the diagonality should verify the following equation: $$(a - b) \cos(\varphi)\sin(\varphi) + c (\cos^2(\varphi) - \sin^2(\varphi))  = 0,$$ which after dividing by $(c\cos^2(\varphi))$ gives a quadratic equation for $\tan(\varphi)$: $$\tan^2(\varphi) - \frac{a-b}{c}\tan(\varphi)  - 1 = 0,$$ therefore the two solutions are given by : $$\varphi_{i} = \mathrm{arctan}\left(\frac{a-b}{2c} \pm \sqrt{\left(\frac{a-b}{2c}\right)^2+1}\,\right),
 \label{eq:angle}$$ which correspond to eigenvalues $$\lambda_{i} = \frac12\left(a+b \pm \sqrt{(a-b)^2 + 4c^2}\right),$$ therefore the principal curvatures and principal radii are given by: $$\kappa_{i} = \left(a+b \pm \sqrt{(a-b)^2 + 4c^2}\right),\quad R_{i} = 1\left/\left(a+b \pm \sqrt{(a-b)^2 + 4c^2}\right)\right.
  \label{eq:curvatures}$$

Rough surface measurements are inevitably of discrete nature, therefore the question of asperity identification is relevant [@paggi2010w]. Numerically 