473,802 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please Help To Draw A Fractal For Peano/hilbert/koch Snowflake Curve Using C++

4 New Member
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

Here is added assignment:
http://eent3.lsbu.ac.u k/staff/dimitrsa/OOPN/Assignment/OOPN_assignment _2006-07.pdf

• Your Application
Example: You can either select to design one of the following recommended fractals:
1. Peano curve
2. Hilbert curve
3. Sierpinski gasket or the Koch snowflake.
Figure 1: Three iterations of the Peano curve, a space-filling curve
Figure 2: Six iterations of the Hilbert curve, a space-filling curve
E.g., for the third one, before giving an IFS description of the Sierpinski Gasket, describe
a simple procedure by which the fractal geometric object Sierpinski gasket can be
obtained.
• Algorithm
Draw structure diagrams (design the operations, documenting them using either
functional decomposition diagrams or UML diagrams).

And make a C++ program
Nov 1 '06 #1
4 9978
Banfa
9,065 Recognized Expert Moderator Expert
Right, do you know the algorithms to required to solve these fractal problems?

You will need to so if you don't go and get/buy a book on fractals or Google it. This is all well known stuff now so it isn't hard to find.

Once you have the algorithm the code is normally fairly simple to create.
Nov 1 '06 #2
babyinc
4 New Member
can you please tell me on which book or on which web site i can get informations and initialize the program.
Nov 2 '06 #3
Banfa
9,065 Recognized Expert Moderator Expert
Was typing "Koch snowflake" into the search box on Google too hard a task for you?
Nov 2 '06 #4
shiyamin
1 New Member
hi alll
i got some c++ codes for it if some one can compile it and try to make a programm for hillbirt curve it fantstic it would help ful for me as well


enum {
UP,
LEFT,
DOWN,
RIGHT,
};

void hilbert(int level,int direction=UP)
{
if (level==1) {
switch (direction) {
case LEFT:
move(RIGHT); /* move() could draw a line in... */
move(DOWN); /* ...the indicated direction */
move(LEFT);
break;
case RIGHT:
move(LEFT);
move(UP);
move(RIGHT);
break;
case UP:
move(DOWN);
move(RIGHT);
move(UP);
break;
case DOWN:
move(UP);
move(LEFT);
move(DOWN);
break;
} /* switch */
} else {
switch (direction) {
case LEFT:
hilbert_level(l evel-1,UP);
move(RIGHT);
hilbert_level(l evel-1,LEFT);
move(DOWN);
hilbert_level(l evel-1,LEFT);
move(LEFT);
hilbert_level(l evel-1,DOWN);
break;
case RIGHT:
hilbert_level(l evel-1,DOWN);
move(LEFT);
hilbert_level(l evel-1,RIGHT);
move(UP);
hilbert_level(l evel-1,RIGHT);
move(RIGHT);
hilbert_level(l evel-1,UP);
break;
case UP:
hilbert_level(l evel-1,LEFT);
move(DOWN);
hilbert_level(l evel-1,UP);
move(RIGHT);
hilbert_level(l evel-1,UP);
move(UP);
hilbert_level(l evel-1,RIGHT);
break;
case DOWN:
hilbert_level(l evel-1,RIGHT);
move(UP);
hilbert_level(l evel-1,DOWN);
move(LEFT);
hilbert_level(l evel-1,DOWN);
move(DOWN);
hilbert_level(l evel-1,LEFT);
break;
} /* switch */
} /* if */
}



shameen
Nov 9 '06 #5

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

Similar topics

3
3299
by: dimfox | last post by:
Hi, I am new to Python. What I need to do is to calculate a curve and display it at the same time. I don't want to use the gplt.plot() because I need to show the animation of the curving growing. Which package should I use? Which function? Thank you
1
1332
by: Paul Nathan | last post by:
Hello, I'm writing a program that draws 3D fractal trees (using recursive functions) on a fractal landscape which you can fly around in etc. The program has been a success until it came to drawing the leaves. For simplicity I decided to place them at the ends of each branch. Having stored each leaf position in an array, the vertices were then calculated as trianglelists and scaled/rotated/transformed into position and then put into the...
1
9661
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
0
983
by: david | last post by:
I want draw the statistical curve diagrams (such as density, probability) on web page or window form. I know how to use OWC10 for simple chart, but I do not know how to set the parameters for curves. Any body knows it. Thanks David
1
2582
by: coofucoo | last post by:
We need to draw a curve with javascript in different browser, like IE5+, firefox1+, mozilla1.2+. Is there any existed javascript framework or library we can use? Thank for your help!
0
1044
by: daves | last post by:
How to draw a shape from one panel to an other in GDI+?? I want to draw a curve, where the beginning point is in the form and the end point is in a panel. By default the curve is drawn below the panel, so I cant see a part of the curve which goes though the panel. I want to see the whole curve. Any help? Thanx in advance.
5
8822
by: nikhila6101017 | last post by:
how can we solve koch curve prog in c
2
5173
by: lavanya2284 | last post by:
Hi frnds. I am a VB 6.0 programmer.I have to draw a parabola or (U - shaped Curve ) on the picture box.its really urgent.Help me out. Thanks in advance. Latha.M
13
2843
mia023
by: mia023 | last post by:
hello everyone I have a project and just need ideas about it. This is the documentation: Develop the code for matrix multiplication in Peano‐Order and another one in roworder. The program should be able to read two matrices from a file, and output the multiplication of these two matrices using both orders. Use PAPI (Performance Application Programming Interface) to instrument your code. Your code should monitor the following: L1 cache...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10304
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.