|  | Koch snowflakes |  | |
| | | conrad |  |
| Posted: Sun Sep 07, 2008 1:50 am Post subject: Koch snowflakes |  |
If I generate a Koch snowflake of an order higher than 1, then it conflicts with my recursive algorithm because: i) A Koch Snowflake of order 1 involves generating three triangles from the sides of the initial triangle. ii) All Koch Snowflakes of order >= 2 involves the creation of only two triangles. The third is not needed because the third side becomes non-existent.
How can I rectify this? I initially thought: keep it general in the sense that I should not treat the order = 1 case as special. In this way, I can check for an order >= 2 Koch Snowflake by determining which point generated ends up within the area of the polygon.
I'm only posting this because I'm curious if there is a different approach that someone would have taken.
-- conrad |
| |
| | | Gene |  |
| Posted: Sun Sep 07, 2008 3:13 am Post subject: Re: Koch snowflakes |  |
| |  | |
On Sep 6, 9:50 pm, conrad <con...@lawyer.com> wrote:
| Quote: | If I generate a Koch snowflake of an order higher than 1, then it conflicts with my recursive algorithm because: i) A Koch Snowflake of order 1 involves generating three triangles from the sides of the initial triangle. ii) All Koch Snowflakes of order >= 2 involves the creation of only two triangles. The third is not needed because the third side becomes non-existent.
How can I rectify this? I initially thought: keep it general in the sense that I should not treat the order = 1 case as special. In this way, I can check for an order >= 2 Koch Snowflake by determining which point generated ends up within the area of the polygon.
I'm only posting this because I'm curious if there is a different approach that someone would have taken.
|
I'm not sure what you're saying. Here's an alogorithm to return a list of all the star vertices:
function koch (k) let s = sqrt(3)/2 if k = 1 return [ [0, 1], [-s -1/2], [s, -1/2], [0, 1] ] rtn = []; for each adjacent pair [a, b] in koch(k - 1) let v = b - a c = a + 1/3 * v d = a + 2/3 * v e = s * perp(d - c) append [ a, c, e, d, b ] onto rtn return rtn
Note that
perp([x, y]) = [-y, x] |
| |
| | | CBFalconer |  |
| Posted: Sun Sep 07, 2008 6:23 am Post subject: Re: Koch snowflakes |  |
| |  | |
conrad wrote:
| Quote: | If I generate a Koch snowflake of an order higher than 1, then it conflicts with my recursive algorithm because: i) A Koch Snowflake of order 1 involves generating three triangles from the sides of the initial triangle. ii) All Koch Snowflakes of order >= 2 involves the creation of only two triangles. The third is not needed because the third side becomes non-existent.
How can I rectify this? I initially thought: keep it general in the sense that I should not treat the order = 1 case as special. In this way, I can check for an order >= 2 Koch Snowflake by determining which point generated ends up within the area of the polygon.
I'm only posting this because I'm curious if there is a different approach that someone would have taken.
|
What is a Koch snowflake? What is a Koch snowflake order? What is your recursive algorithm?
-- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. |
| |
| | | jellybean stonerfish |  |
| Posted: Sun Sep 07, 2008 6:50 am Post subject: Re: Koch snowflakes |  |
On Sun, 07 Sep 2008 04:23:54 -0400, CBFalconer wrote:
| Quote: | What is a Koch snowflake? Stop pretending your stupid. |
| Quote: | What is a Koch snowflake order? Stop pretending your stupid. |
| Quote: | What is your recursive algorithm?
|
Good guestion. |
| |
| | | Martin Eisenberg |  |
| Posted: Sun Sep 07, 2008 8:40 am Post subject: Re: Koch snowflakes |  |
conrad wrote:
| Quote: | If I generate a Koch snowflake of an order higher than 1, then it conflicts with my recursive algorithm because: i) A Koch Snowflake of order 1 involves generating three triangles from the sides of the initial triangle. ii) All Koch Snowflakes of order >= 2 involves the creation of only two triangles. The third is not needed because the third side becomes non-existent.
How can I rectify this?
|
If I understand well: Don't *count* the edges, just *walk* them.
Martin
-- Quidquid latine scriptum est, altum videtur. |
| |
| | | Richard Heathfield |  |
| Posted: Sun Sep 07, 2008 10:27 am Post subject: Re: Koch snowflakes |  |
CBFalconer said:
<snip>
| Quote: | What is a Koch snowflake?
|
Is this a joke?
| Quote: | What is a Koch snowflake order?
|
An equilateral triangle is a Koch snowflake of order 0.
To obtain a Koch snowflake S of order N, given a Koch snowflake K of order (N - 1):
for each straight line segment on K (as it existed before any mods): (a) identify C, the central third (33.3etc%) of the line segment (b) consider C to be the base of an equilateral triangle "pointing" away from the centre of the figure (c) complete the equilateral triangle by drawing two new line segments (d) remove C from the figure endfor
| Quote: | What is your recursive algorithm?
|
The Web contains many examples.
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| | | Willem |  |
| Posted: Sun Sep 07, 2008 11:11 am Post subject: Re: Koch snowflakes |  |
conrad wrote: ) If I generate a Koch snowflake of ) an order higher than 1, then it conflicts ) with my recursive algorithm because: ) i) A Koch Snowflake of order 1 involves ) generating three triangles from the sides ) of the initial triangle. ) ii) All Koch Snowflakes of order >= 2 ) involves the creation of only two ) triangles. The third is not needed ) because the third side becomes ) non-existent.
Doesn't a Koch Snowflake work by changing each edge of the current shape into four edges ? They just happen to be at 60-degree angles, and you just happen to start with a triangle.
How are you using triangles to do it ? As I see it, that would miss out a lot of sides.
SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT |
| |
| | | conrad |  |
| Posted: Sun Sep 07, 2008 12:48 pm Post subject: Re: Koch snowflakes |  |
| |  | |
On Sep 7, 6:11 am, Willem <wil...@stack.nl> wrote:
| Quote: | conrad wrote:
) If I generate a Koch snowflake of ) an order higher than 1, then it conflicts ) with my recursive algorithm because: ) i) A Koch Snowflake of order 1 involves ) generating three triangles from the sides ) of the initial triangle. ) ii) All Koch Snowflakes of order >= 2 ) involves the creation of only two ) triangles. The third is not needed ) because the third side becomes ) non-existent.
Doesn't a Koch Snowflake work by changing each edge of the current shape into four edges ? They just happen to be at 60-degree angles, and you just happen to start with a triangle.
How are you using triangles to do it ? As I see it, that would miss out a lot of sides.
SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT
|
Yeah, I only realized this after I had started to write the algorithm for it. The book that I was doing the problem from did not have a complete explanation of a Koch Snowflake and so I filled in some gaps with my own ideas. However, after having found a complete explanation I understand the problem.
And understanding the problem is half the battle.
-- conrad |
| |
| | | CBFalconer |  |
| Posted: Sun Sep 07, 2008 8:23 pm Post subject: Re: Koch snowflakes |  |
| |  | |
Richard Heathfield wrote:
| Quote: | CBFalconer said:
snip
What is a Koch snowflake?
Is this a joke?
|
No. I never heard of such.
| Quote: | What is a Koch snowflake order?
An equilateral triangle is a Koch snowflake of order 0.
|
Is it the only one?
| Quote: | To obtain a Koch snowflake S of order N, given a Koch snowflake K of order (N - 1):
for each straight line segment on K (as it existed before any mods): (a) identify C, the central third (33.3etc%) of the line segment (b) consider C to be the base of an equilateral triangle "pointing" away from the centre of the figure (c) complete the equilateral triangle by drawing two new line segments (d) remove C from the figure endfor
What is your recursive algorithm?
The Web contains many examples.
|
Thanks. Two seconds work with a triangle and piece of paper gives me the idea. What are they used for?
-- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. |
| |
| | | Richard Heathfield |  |
| Posted: Mon Sep 08, 2008 3:42 am Post subject: Re: Koch snowflakes |  |
CBFalconer said:
| Quote: | Richard Heathfield wrote: CBFalconer said:
snip
What is a Koch snowflake?
Is this a joke?
No. I never heard of such.
|
Sierpinksi carpet? Menger sponge? Mandelbrot set? Julia set?
| Quote: | What is a Koch snowflake order?
An equilateral triangle is a Koch snowflake of order 0.
Is it the only one?
|
Yes. Nevertheless, you could use some other figure to get a pseudoKoch snowflake. For example, Eric Haines has produced a "sphereflake".
<snip>
| Quote: | What are they used for?
|
What are Mandelbrot sets used for?
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| Page 1 of 2 .:. Goto page 1, 2 Next | |
|
|