%%
%  Author: Peter Polcz (ppolcz@gmail.com) 
%  Created on 2023. December 07. (2023a)
%

T = 1/3;

t = 0:0.001:1;
t1 = t(t < T);
t2 = t(t >= T);

x1 = 120*t1+80;
x2 = (30*t2.^2 - 60*t2 + 110 - 80)*3 + 80;

%%

T = 0.18;

t = 0:0.001:1;
t1 = t(t < T);
t2 = t(t >= T);

x1 = 360*t1+80;
x2 = (30*t2.^2 - 60*t2 + 110 - 80)*3.195 + 80;


x = [x1 x2(1:end-1)];

c = @(M) M(:);

N = 10;
t = c(repmat(t(1:end-1)',[1,N]) + (0:N-1));
x = repmat(x,[1,N]);

figure(1),plot(t1,x1,t2,x2)
% plot(t,x)

%%

tau = 1/3;

t1 = 2*tau:0.001:t(end);
t2 = tau:0.001:t(end)-tau;
t3 = 0:0.001:t(end)-2*tau;

plot3(interp1(t,x,t1),interp1(t,x,t2),interp1(t,x,t3))