473,382 Members | 1,658 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,382 software developers and data experts.

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

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.uk/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 9948
Banfa
9,065 Expert Mod 8TB
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
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 Expert Mod 8TB
Was typing "Koch snowflake" into the search box on Google too hard a task for you?
Nov 2 '06 #4
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(level-1,UP);
move(RIGHT);
hilbert_level(level-1,LEFT);
move(DOWN);
hilbert_level(level-1,LEFT);
move(LEFT);
hilbert_level(level-1,DOWN);
break;
case RIGHT:
hilbert_level(level-1,DOWN);
move(LEFT);
hilbert_level(level-1,RIGHT);
move(UP);
hilbert_level(level-1,RIGHT);
move(RIGHT);
hilbert_level(level-1,UP);
break;
case UP:
hilbert_level(level-1,LEFT);
move(DOWN);
hilbert_level(level-1,UP);
move(RIGHT);
hilbert_level(level-1,UP);
move(UP);
hilbert_level(level-1,RIGHT);
break;
case DOWN:
hilbert_level(level-1,RIGHT);
move(UP);
hilbert_level(level-1,DOWN);
move(LEFT);
hilbert_level(level-1,DOWN);
move(DOWN);
hilbert_level(level-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
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...
1
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...
1
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...
0
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...
1
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
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...
5
by: nikhila6101017 | last post by:
how can we solve koch curve prog in c
2
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.