function y = sim9_halfcircle_3params(x, r, offset)

x = x - r - offset;

if(x > r)
    x = r;
end;

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

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