473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

koch curve

how can we solve koch curve prog in c
Sep 19 '07 #1
5 8790
sicarie
4,677 Expert Mod 4TB
how can we solve koch curve prog in c
Developing an algorithm
Developing pseudocode from the algorithm
Coding the pseudocode
Sep 19 '07 #2
Developing an algorithm
Developing pseudocode from the algorithm
Coding the pseudocode
i need its code in c
Sep 19 '07 #3
sicarie
4,677 Expert Mod 4TB
i need its code in c
And if you follow those steps, you can create it yourself!

Maybe the Posting Guidelines will help?
Sep 19 '07 #4
JosAH
11,448 Expert 8TB
Here's all you want to know about the Koch snowflake. All the rest is just an
implementation detail. Please try to do something on your own and don't just
whine for code. If you can't succeed we're happy to give you a helping hand.

kind regards,

Jos
Sep 19 '07 #5
RRick
463 Expert 256MB
The Koch curve takes a triangle and replaces each straight edge with _/\_. You have a couple of ways of doing this.

You can keep a list of edges and replace each of them with _/\_ . This will delete the existing edge and add 4 more edges. You do this until you reach the level of detail you need. Once you have enough information, you draw all the edges.

A second method is to use recursion. Here you take an existing edge and pass it to a sub that breaks it into the 4 pieces. For each of the new segments you call the same subroutine to break that segment into 4 piecies again and again and again. Once the lowest level is reached, you draw the segment and return.

You don't have to start with a triangle, any polygon will do. Also, the replacement value doesn't have to be _/\_, it could be _| |_ (i.e. a square on a line), etc. Once you get the basic algorithm to work its not too hard to make new patterns.
Sep 19 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Vinodh Kumar | last post by:
Number One: ========= I know its a 100% offline post.But seeing the diversity of the domain from which people are participating, I would like to post this question here.Pardon me.At the least, u...
5
by: reagan | last post by:
I am trying to get a program(in visual C++) to draw a sine curve (from 0 to 2pi). It takes 8 lines to draw the complete curve. However, the user can choose to use up to 100 lines to make the curve...
2
by: MLH | last post by:
This question, I apologize, is more of a math question than it is an Access question - I'm almost certain. The bell curve is another name for the normal distribution, which is a common type of...
4
by: nmukh1 | last post by:
Hey guys, I'm trying to optimize a program that measures the length of a curve. Suppose I define a function f and I have two bounds and am trying to find the arc length. The familiar calculus...
8
by: scorpion53061 | last post by:
Hi, I am a vb.net guy......(I know boo hiss LOL) I was thinking of learning C# as well. Can I expect a hard road of it as far as a learning curve? As as side note, what made you choose...
2
by: Jeremy S. | last post by:
I know these questions can have no objective and definitive/correct answer - but I'm looking for some general insight, non specific as it may be. So, from those of you who have actually worked...
4
by: babyinc | last post by:
Please help me. I am totally beginner of C++ and my tutor give us these huge program to solve within 20 days. As a MSc student I am really gonna cry. Please anyone can help me. sumon1in1@yahoo.com ...
2
by: Peter Morris | last post by:
Hi all I want to draw a line as if it were being drawn in real-time by a person. To save lots of data I think that storing 4 points in memory and drawing a bezier curve would be efficient. What...
0
by: sa6113 | last post by:
Hello there, I have a problem on curve fitting , would you please help me ?! I want to to develop a application that reads a text file with 2 columns of floating point data (as x and y) and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.