function drawCantorSet(x,L,t)
% DRAWCANTORSET draws the Cantor Set on the vertical axis.
% at the point x with the length L.
% t is the number of iteration.
% Usage: drawCantorSet(x,L,t)

% Copyright(C) 2002 Tohru Ikeguchi, All Rights Reserved

% Default value setting
if nargin<1, x=0; end
if nargin<2, L=1; end
if nargin<3, t=0; end

% Main
% If t=0, just draw a line.
if t==0,
    drawLine(x,0,x+L,0);
% Else, draw two small lines.
else
    hold on
    drawCantorSet(      x, L/3, t-1);
    drawCantorSet(x+2*L/3, L/3, t-1);
    hold off
end

axis square
axis off

