# Space-time (holiday) trees

No new math here, only new graphics. The following plot is from Collisions II, where it illustrates the process of contracting a 6-point planar set into a single point.

I remarked there that the trajectories cross in space, but not in space-time. The space-time plot of the contraction process is always a tree, but I never showed these trees to you.

Well, here they are. Time flows down, so that the trees have branches (initial points) above root.

The four points above were placed into the vertices of a rectangle. The plots below use points with random coordinates.

The Scilab command was

``gravity4(grand(1,10,"def"),grand(1,10,"def"),250)``

and the function itself is below.

``````function gravity4(vx,vy,Nsteps)
Npoints = length(vx);
h = 0.01/Npoints;
moving = ones(vx);
tolerance = h*(Npoints-1)/3;
x = zeros(Nsteps,Npoints);
y = zeros(Nsteps,Npoints);
z = zeros(Nsteps,Npoints);
x(1,:) = vx;
y(1,:) = vy;
for m = 1:(Nsteps-1)
x(m+1,:)= x(m,:);
y(m+1,:)= y(m,:);
z(m+1,:) = z(m,:);
for i = 1:Npoints
if moving(i)==0 then continue
end
z(m+1,i)=z(m,i)-h*Npoints;
for j = (i+1):Npoints
if moving(j)==0 then continue
end
v = [x(m,j),y(m,j)]-[x(m,i),y(m,i)];
if norm(v) < tolerance then
moving(j)=0;
else
x(m+1,i) = x(m+1,i) + h*v(1)/norm(v);
x(m+1,j) = x(m+1,j) - h*v(1)/norm(v);
y(m+1,i) = y(m+1,i) + h*v(2)/norm(v);
y(m+1,j) = y(m+1,j) - h*v(2)/norm(v);
end
end
end
end
clf();
param3d1(x(:,:),y(:,:),z(:,:));
a = get("current_axes");
curves = a.children.children;
for i=1:Npoints
curves(i).foreground = 2+modulo(i,5);
curves(i).thickness = 4;
end
endfunction ``````

I tried to replace `a.children.children` with `a.grandchildren`, but that did not work…

This site uses Akismet to reduce spam. Learn how your comment data is processed.