function [z,th]=Rule1g(L,TS) %calculates gaussian variations theta and z of 2D size variation to obey Rule #1 a=randn*2*TS/3*L; b=randn*TS/3; c=abs(a)+(2/L)*abs(b); if c<2*TS/L th=a; z=b; else th=0; z=0; end %[x,y]=Rule1(1,.005) %a(i)=x %b(i)=y %plot(a,b,'gx')