Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 -*-*-*-*-*-*-*-*
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MysticAngel




PostPosted: Sat Mar 22, 2003 10:49 pm   Post subject: -*-*-*-*-*-*-*-*

can u give me some points and tips on how to make julia sets.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Mar 22, 2003 11:29 pm   Post subject: (No subject)

first - Post subject: -*-*-*-*-*-*-*-* is NOT very descriptive. In future people may just ignore the post and it will take a while until someone answers it.

second - what exactly are julia sets?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Catalyst




PostPosted: Sat Mar 22, 2003 11:38 pm   Post subject: (No subject)

they are a fractal set
MysticAngel




PostPosted: Sun Mar 23, 2003 12:12 am   Post subject: julia sets

julia sets are a type of fractals.
Asok




PostPosted: Sun Mar 23, 2003 2:51 am   Post subject: (No subject)

What's a fractal set? Shocked
Dan




PostPosted: Sun Mar 23, 2003 11:38 am   Post subject: (No subject)

i shucred the web for some info on this and i fownd the flowing infomation wich may be help full:

Quote:

How can I build a Julia set?
Pick a point on the complex plane (let's call it C). The corresponding complex number has the form: x_coordinate + i*y_coordinate. The following algorithm produces the Julia set associated with C: given a generic point Z on the complex plane, this algorithm determines whether or not it belongs to the Julia set associated with C, and thus determines the color that should be assigned to it.
In order to see if Z belongs to the set, we must iterate the function Zn+1 = Z2n + C using Z0 = Z. What happens to the initial point Z when the formula is iterated? Will it remain near to the origin or will it go away from it, increasing its distance from the origin without limit? In the first case, it belongs to the Julia set; otherwise it goes to infinity (infinity is an attractor for the point) and we assign a colour to Z depending on the speed the point "escapes" from the origin. In order to produce an image of the whole Julia set associated with C, we must repeat this process for all the points Z whose coordinates are included in this range: -2 < x_coordinate < 2 ; -1.5 < y_coordinate < 1.5


Note that while the Mandelbrot set is connected (i.e. it is a single piece), a Julia set is connected only if it is associated with a point inside the Mandelbrot set. This is just one example of the relationships between the Mandelbrot set and Julia sets.
Example: the Julia set associated with C1 is connected; the Julia set associated with C2 is not connected (see image below).

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
MysticAngel




PostPosted: Tue Mar 25, 2003 6:55 pm   Post subject: (No subject)

k i dont know why it isnt working. the below code is the basic algorithim. i know that there is some error at the first exit statement. i tried everything but it doesnt seem, to ork. the count + 55 is the colors

var p : real
var q : real
var maxcount : int
var x, y : int := 1
var imaxx : real
var imaxy : real
var rx, rx2 : real
var ry, ry2 : real
var t : real

var iwin2 : int
var count : int := 0

put "Please enter a value for p"
get p
put "Please enter a callue for q"
get q
put "Please enter a range between 20 to 200)"
get maxcount
imaxx := p
imaxy := q
iwin2 := Window.Open ("graphics : 500; 500,nocursor")
Window.Select (iwin2)

loop
rx := 3.5 / imaxx * x - 1.75
ry := 3.5 / imaxy * y - 1.75

loop
loop
count := count + 1
rx2 := rx * rx - ry * ry + p
ry2 := 2 * rx - ry + q
rx := rx ** 2
ry := ry ** 2
exit when rx * rx + ry * ry < 4 or count = maxcount
if count < maxcount then
count := count + 55
else
count := 0
end if
Draw.Dot (x, y, count + 55)
end loop
end loop
end loop
Asok




PostPosted: Tue Mar 25, 2003 7:53 pm   Post subject: (No subject)

um... you seem to have a lot of loops in that, I haven't run the code but I'm going to assume that may be your problem
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Mar 25, 2003 8:33 pm   Post subject: (No subject)

no, not the loops... your values overflow and cause program to crash Confused Turing just cant handle that kind of numbers... You need to use a modern 32bit comiler like VC++.

also about drawdot(x,y,color)...

the values of X and Y never change Confused they always stay 1,1 no matter what.

and I dont see the use for rx2 and ry2 ether. I think you're missing something (or have extra?)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
MysticAngel




PostPosted: Tue Mar 25, 2003 9:15 pm   Post subject: (No subject)

ya i know that i am missing something. I get the values of maxx and maxy frlom the values that i input from p and q. but the problem is what are values of x and y. cuz i think that the dots that are ouputed into an image are in a loop. and for the dots to make an image the x and y values have keep changing. so x,y cant be 1,1. can u think a way to get the x and y values ?? Question
Asok




PostPosted: Tue Mar 25, 2003 9:20 pm   Post subject: (No subject)

put x
put y

Very Happy

simple but if u want to know the value of a variable it works
MysticAngel




PostPosted: Tue Mar 25, 2003 9:26 pm   Post subject: (No subject)

yeah but if the values of x and y are always 1 ,1 as i declared them... what's the point in oputping them.
MysticAngel




PostPosted: Tue Mar 25, 2003 10:20 pm   Post subject: (No subject)

Do u know any way to get the values for x and y
Tony




PostPosted: Tue Mar 25, 2003 10:46 pm   Post subject: (No subject)

what MysticAngel is trying to say is "how to calculate X and Y values?" which I dont know. Sad

I tried looking up some info from internet, but i cant understand their formulas. I dont see the relation between all those numbers and where does i come from? I'm very Confused
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Catalyst




PostPosted: Tue Mar 25, 2003 10:54 pm   Post subject: (No subject)

i have created a working julia set generator that i will post soon, maybe that will help
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: