[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGO-L> Sierpinski Curves]



Andrzej Baczynski wrote:

> > I have found in Demo1_.lgo something like that. It's substantialy shorter
> > then Your program and I'm afraid it does the same.
> >
>
While the pattern each produces is similar there seems to be one major
difference between the programs.

In my code as the recursion level gets larger the size of the overall
square bounding the curve remains the same. The individual segments of
the pattern get smaller.

When I ran the code you supplied, as the recursion level increased the
size of the square also increased. The pattern pieces remained constant
sized.

The attached gif shows images generated by my code on the left your code
on the right.  The arguments '10 0' for the bottom gif and '10 1' for
the top gif.  The two gif's on the right were generated by your code
with '10 1' for the bottom and '10 2' for the top.  You can see what I
mean about the level changing the size of your images.  

As I understand it a true Sierpinski curve will fit into the unit square
at any level of recursion. So while the code you supplied creates the
right pattern, because it grows in size it's not a Sierpinski curve.

I feel however that my code isn't optimal. It is a literal translation
of the algorithm to draw the curve. As each side of the square is
similar it should be possible to take the code for say the top side of
the square and rotate it to produce the other sides. But for now this
will do.
-- 
Frank Caggiano
caggiano@atlantic.net
http://www.atlantic.net/~caggiano

-- BEGIN included message

Andrzej Baczynski wrote:

> > I have found in Demo1_.lgo something like that. It's substantialy shorter
> > then Your program and I'm afraid it does the same.
> >
>
While the pattern each produces is similar there seems to be one major
difference between the programs.

In my code as the recursion level gets larger the size of the overall
square bounding the curve remains the same. The individual segments of
the pattern get smaller.

When I ran the code you supplied, as the recursion level increased the
size of the square also increased. The pattern pieces remained constant
sized.

The attached gif shows images generated by my code on the left your code
on the right.  The arguments '10 0' for the bottom gif and '10 1' for
the top gif.  The two gif's on the right were generated by your code
with '10 1' for the bottom and '10 2' for the top.  You can see what I
mean about the level changing the size of your images.  

As I understand it a true Sierpinski curve will fit into the unit square
at any level of recursion. So while the code you supplied creates the
right pattern, because it grows in size it's not a Sierpinski curve.

I feel however that my code isn't optimal. It is a literal translation
of the algorithm to draw the curve. As each side of the square is
similar it should be possible to take the code for say the top side of
the square and rotate it to produce the other sides. But for now this
will do.

regards
-- 
Frank Caggiano
caggiano@atlantic.net
http://www.atlantic.net/~caggiano

GIF image

-- END included message

GIF image



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home