function y = sim9b_car_halfcircle(u)
x = u(1);
r = u(2);
delay = u(3);

x = x - r;

x = x - delay; % delay before the half circle starts

if (x > r)
    x = r;
end

if (x < -r)
    x = -r;
end

y = sqrt(r*r - x*x);