• Remix
  • Share
  • New Entry

on 6 Oct 2022
  • 1
  • 23
  • 2
  • 0
  • 275
k=@(x)kron(x,[1;1;1]);
e=@(x)((sum(x.^2,2)).^.5-1).^.5+x(:,3).^4-1;
E=1e3;
x=[0,2,0];
V=[1,.25,1];
s=E;
for j = 0:E
p=x(end,:);
d=e(p);
if d>-1/E
n=(e(k(p)+eye(3)/E).'-d)*E;
n=n/norm(n);
V=V+(-2*dot(n,V)*n);
end
x=[x;p+V/10];
s=[s;randi(E)];
end
scatter(x(:,2),x(:,1),s,s,'.');
colormap(turbo);
axis equal off;
Remix Tree