资源简介
matlab求解曲面的高斯曲率、曲率的均值及最大值、最小值
代码片段和文件信息
function [KHPmaxPmin] = surfature(XYZ)
% SURFATURE - COMPUTE GAUSSIAN AND MEAN CURVATURES OF A SURFACE
% [KH] = SURFATURE(XYZ) WHERE XYZ ARE 2D ARRAYS OF POINTS ON THE
% SURFACE. K AND H ARE THE GAUSSIAN AND MEAN CURVATURES RESPECTIVELY.
% SURFATURE RETURNS 2 ADDITIONAL ARGUEMENTS
% [KHPmaxPmin] = SURFATURE(...) WHERE Pmax AND Pmin ARE THE MINIMUM
% AND MAXIMUM CURVATURES AT EACH POINT RESPECTIVELY.
% First Derivatives
[XuXv] = gradient(X);
[YuYv] = gradient(Y);
[ZuZv] = gradient(Z);
% Second Derivatives
[XuuXuv] = gradient(Xu);
[YuuYuv] = gradient(Yu);
[ZuuZuv] = gradient(Zu);
[XuvXvv] = gradient(Xv);
[YuvYvv] = gradient(Yv);
[ZuvZvv] = gradient(Zv);
% Reshape 2D Arrays into Vectors
Xu = Xu(:); Yu = Yu(:); Zu = Zu(:);
Xv = Xv(:); Yv = Yv(:); Zv = Zv(:);
Xuu = Xuu(:); Yuu = Yuu(:); Zuu = Zuu(:);
Xuv = Xuv(:); Y
评论
共有 条评论