curvature(S)
[K,H] = CURVATURE(S) computes the gaussian and mean curvatures of the
surface S defined by S = f(x,y), where (x,y) is the
rectangular grid on which f is defined.
Example: Define gaussians on a rectangular grid, and find its
curvatures:
f = @(mu1,mu2,s1,s2,x,y) exp(-(x-mu1).^2/(s1.^2)-(y-mu2).^2/(s2.^2));
[X,Y] = meshgrid(linspace(-5,5,200));
S = f(-2,0,2,2,X,Y) - f(2,0,2,2,X,Y)
figure; mesh(S);
[K,H] = curvature(S);
figure;mesh(K); title('Gaussian Curvature','FontSize',20);
figure;mesh(H); title('Mean Curvature','FontSize',20);
Cite As
Thomas Atta-Fosu (2023). curvature(S) (https://www.mathworks.com/matlabcentral/fileexchange/51013-curvature-s), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | Screenshot of some result added |