/usr/lib/scilab-plotlib/macros/surfnorm.sci is in scilab-plotlib 0.42-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | function [nx,ny,nz]=surfnorm(varargin)
[lhs,rhs]=argn(0);
if rhs==1
Z=varargin(1);
s=size(argList(1));
X=1:s(1);
Y=1:s(2);
elseif rhs==3
[X,Y,Z]=varargin(1:3);
[ly,lx]=size(Z);
if isvector(X);
X=X(:);Y=Y(:);
[zx,zy]=nonParametricDiffData(X,Y,Z);
n=nonParametricNormals(zx,zy);
else
[xu,yu,zu,xv,yv,zv]=parametricDiffData(X,Y,Z);
n=parametricNormals(xu,yu,zu,xv,yv,zv);
end
nx=matrix(n(1,:),ly,lx);
ny=matrix(n(2,:),ly,lx);
nz=matrix(n(3,:),ly,lx);
elseif rhs==4
[nodes,x,y,z]=varargin(1:4);
end
endfunction
|