Curvature
In MembraneCurvature, we calculate Gaussian and mean curvature from a cloud of points.
Gaussian curvature is defined by
Mean curvature is defined by
Notes
Since the mean curvature calculates the arithmetic mean of two principal curvatures, the default units of \(H\) are Å-1. On the other hand, Gaussian curvature calculates the geometric mean of the two principal curvatures. Therefore, the default units of \(K\) are Å-2. In general, units of mean curvature are [length] -1, and units of Gaussian curvature are [length] -2.
Warning
Numpy cannot calculate the gradient for arrays with inner array of length==1 unless axis=0 is specified. Therefore in the functions here included for mean and Gaussian curvature, shape of arrays must be at least (2,2). In general, to calculate a numerical gradients shape of arrays must be >=(edge_order + 1).
Functions
- membrane_curvature.curvature.gaussian_curvature(Z)[source]
Calculate Gaussian curvature from Z cloud points.
- Parameters:
Z (np.ndarray.) – Multidimensional array of shape (n,n).
- Returns:
K – The result of Gaussian curvature of Z. Returns multidimensional array object with values of Gaussian curvature of shape (n, n).
- Return type:
np.ndarray.
- membrane_curvature.curvature.mean_curvature(Z)[source]
Calculates mean curvature from Z cloud points.
- Parameters:
Z (np.ndarray.) – Multidimensional array of shape (n,n).
- Returns:
H – The result of mean curvature of Z. Returns multidimensional array object with values of mean curvature of shape (n, n).
- Return type:
np.ndarray.