Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 115 results for
koch
- Page 1
Koch Curve in Python
Programming
Software Development
17 Years Ago
by mcenley
…I am trying to write a program for drawing a
Koch
curve in Python. The Pseduocode is given as follows and… length x/3 2. Turn left 60degrees. 3. Draw
Koch
curve with length x/3 4. Turn right 120 degrees… the curve: [code=python] from TurtleWorld import * TurtleWorld() def
Koch
(t,length): t=Turtle() t.delay=0.01 if length…
Re: Koch Curve in Python
Programming
Software Development
17 Years Ago
by mcenley
… an extra function called "snowflake" which draws three
Koch
curves to make the outline of the snowflake. I hope…. Thanks once again ! [code=python] from TurtleWorld import * TurtleWorld() def
Koch
(t,length): if length<=2 : fd(t,length) return…
Re: Koch Curve in Python
Programming
Software Development
14 Years Ago
by vegaseat
…code]import turtle as tu def
Koch
(length): """draw a
Koch
fractal curve recursively"""….fd(length) return
Koch
(length/3) tu.lt(60)
Koch
(length/3) tu.rt(120)
Koch
(length/3) tu.lt…(length/2.0) tu.pendown() tu.title('
Koch
fractal curve')
Koch
(length) # keep showing until window corner x…
Re: Koch Curve in Python
Programming
Software Development
17 Years Ago
by BearofNH
… move the [ICODE]t=turtle()[/ICODE] line from inside
Koch
() and do it separately. Otherwise you get a new… turtle() instance every time you re-enter
Koch
(). Replace [CODE=Python]
Koch
("bob",540)[/CODE] with [CODE=…turtle() # And remove from inside
Koch
() t.delay=0.01 # And remove from inside
Koch
()
Koch
(t, 540)[/CODE], although I …
Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
… write a program that draws the next iteration if a
koch
snowflake, when a button is clicked. It begins with a…[l] = ((Integer)obj2[l]).intValue(); } Polygon
koch
= new Polygon(xPoints, yPoints, vertex); path = new GeneralPath(
koch
); path.moveTo(xPoints[0], yPoints[0…
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by Ezzaral
… code to draw the actual poly // Polygon
koch
= new Polygon(); // for (Point p : points){ //
koch
.addPoint(p.x, p.y); // }… // g2.draw(
koch
); // This just draws unconnected points // for…
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
… } Graphics2D g2 = (Graphics2D)g; Polygon
koch
= new Polygon(); for (Point p : points){
koch
.addPoint(p.x, p.y); } g2.draw…(
koch
); } /** Generate the points to …
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
…} Graphics2D g2 = (Graphics2D)g; Polygon
koch
= new Polygon(); for (Point p : points){
koch
.addPoint(p.x, p.y); } g2….draw(
koch
); } /** Generate the points to…
Re: Koch Snowflake
Programming
Software Development
15 Years Ago
by Aarex
… write a program that draws the next iteration if a
koch
snowflake, when a button is clicked. It begins with a…[l] = ((Integer)obj2[l]).intValue(); } Polygon
koch
= new Polygon(xPoints, yPoints, vertex); path = new GeneralPath(
koch
); path.moveTo(xPoints[0], yPoints[0…
Koch Snowflake using Stacks and Queues
Programming
Software Development
13 Years Ago
by Hypnos_16
…and stack data structure implemented with linked lists. The
Koch
snowflake can be implemented without recursion by using a…create four new segments according to the rules for
Koch
snowflakes add these new segments to L[/CODE] Four… 500 k3.png 6 5 creates a 6 level
Koch
snowflake starting with a pentagon (5 corners). The …
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by Alex Edwards
What algorithm is necessary to generate the points for the
Koch
Snowflake? Are you omitting lines in the KochSnowflake? Also, by …. As long as you understand the algorithm for generating this
Koch
Snowflake, you can code around the problem or start from…
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
An idea that failed miserably. I can't seem to get the rotate(double) method to work at all. It tells me it can't find the method. I thought it was part of the Graphics2D package? I'm probably implementing it wrong though, as I'm trying to do
koch
.rotate(theta);. Theta being the angle of course.
Koch Curve Help Please
Programming
Software Development
18 Years Ago
by Kurosaki
… that uses DrawingTool and provides a drawKochCurve method for drawing
Koch
curves. Each drawKochCurve method can take the number of levels…
[Help] Koch snowflake from Python 2.5 [Turtle]
Programming
Software Development
15 Years Ago
by Oldguy1
…, and what i am trying to do is produce a
Koch
Snowflake via turtle from python2.5. this is what I…
writing a turtle class and drawing koch snowflake
Programming
Software Development
14 Years Ago
by jum2011
Hi, I just received a project in my class where i have to write my own turtle class in python which I will have to use to draw a
Koch
snowflake. Currently I have no idea on how to get started on the turtle class? If anyone knows or has any tip please reply! Thanks.
Re: writing a turtle class and drawing koch snowflake
Programming
Software Development
14 Years Ago
by ZZucker
For the basics of a
Koch
snowflake see: [url]http://ecademy.agnesscott.edu/~lriddle/ifs/ksnow/ksnow.htm[/url]
Re: writing a turtle class and drawing koch snowflake
Programming
Software Development
14 Years Ago
by jum2011
Well, now I understand
koch
snowflake, but how would I write the turtle class to …
getting linking error while implementing Koch Snowflake pattern
Programming
Software Development
10 Years Ago
by Sunil_12
Hello All, I have writtern a c++ code to implement
Koch
Snowflake pattern using recursion. The code written compiled well but …
Re: Koch Curve in Python
Programming
Software Development
14 Years Ago
by lolcat
Remember that when dividing by an integer in Python (in this case dividing by 3) you get an integer as a result. Change 3 to 3.0 and you will see it works. Hope this helps.
Re: Koch Curve in Python
Programming
Software Development
14 Years Ago
by richieking
Its turtleworld your own written module or what. ;)
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
your vertex variable is holding a number too high, i am trying to figure out why
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
vertex is actually the right number, found it, your trying to draw with the new number of points before making the points, put your paintComponent(g); at the end of the method
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
ok... the problem is right, i think, but the solution causes the same problem
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
Yeah, I think you're right. That is why I mentioned the arrays. Is there a simpler way to convert arraylists to an array?
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
well, i would re-arrange the two paint methods, to avoid using the arrays before making them. i don't know whether it would make a difference to the returned array, but i would also try adding a call to trimToSize() call before toArray() another thing you could do to avoid the casting to array type, you could look into the [URL="http://java.…
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
I placed int variables in the draw method, and the paint method that are derived from the size of arrylist x. After draw is done being called, the size is 6. After the program moves on to paint, the size is 0. This is where the problem lies.
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
that's weird.
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
Very. I can't for the life of me see why it does this.
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by sciwizeh
[QUOTE=LevelSix;653793]I placed int variables in the draw method, and the paint method that are derived from the size of arrylist x. After draw is done being called, the size is 6. After the program moves on to paint, the size is 0. This is where the problem lies.[/QUOTE] [QUOTE=LevelSix;653846]I can't for the life of me see why it does this.[/…
Re: Koch Snowflake
Programming
Software Development
16 Years Ago
by LevelSix
Your code here seems to use a class Point. Yes?
1
2
3
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC