Mandelbrot conversion, Java to c#

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2009
Posts: 13
Reputation: fawkman is an unknown quantity at this point 
Solved Threads: 0
fawkman fawkman is offline Offline
Newbie Poster

Mandelbrot conversion, Java to c#

 
0
  #1
19 Days Ago
Hi guys,

I am working on a conversion of the Mandelbrot Fractal from Java to C# and my programming skills are lacking quite a bit. I am desperately trying to improve but I have come across some errors that are stumping me. I have attached a txt file with the code I have so far and below is the segment of code I am getting errors with.

  1. private void mandelbrot() // calculate all points
  2. {
  3. int x, y;
  4. float h, b, alt = 0.0f;
  5.  
  6. action = false;
  7. setCursor(c1);}
  8. public function setCursor;
  9. float System.WriteLine("Mandelbrot-Set will be produced - please wait...");
  10. //float showStatus("Mandelbrot-Set will be produced - please wait...");
  11. for (int x = 0; x < x1; x += 2)
  12. for (int y = 0; y < y1; y++)
  13. {
  14. h = pointcolour(xstart + xzoom * (double)x, ystart + yzoom * (double)y); // color value
  15. if (h != alt)
  16. {
  17. b = 1.0f - h * h; // brightnes
  18. ///djm added
  19. ///HSBcol.fromHSB(h,0.8f,b); //convert hsb to rgb then make a Java Color
  20. ///Color col = new Color(0,HSBcol.rChan,HSBcol.gChan,HSBcol.bChan);
  21. ///g1.setColor(col);
  22. //djm end
  23. //djm added to convert to RGB from HSB
  24.  
  25. g1.setColor(Color.getHSBColor(h, 0.8f, b));
  26. //djm test
  27. Color col = Color.getHSBColor(h, 0.8f, b);
  28. int red = col.getRed();
  29. int green = col.getGreen();
  30. int blue = col.getBlue();
  31. //djm
  32. alt = h;
  33. }
  34. g1.drawLine(x, y, x + 1, y);
  35. }
  36. showStatus("Mandelbrot-Set ready - please select zoom area with pressed mouse.");
  37. setCursor(c2);
  38. action = true;
  39. }

If anyone can offer me some advice on how to resolve some of these issues that would be great. I know there are quite a few, but if anyone can give me some tips on the best way of tackling a conversion like this or point me in the direction to resolving this, then I would really appreciate it. Thnks a lot for your time and help.

regards
Attached Files
File Type: txt ConversionMandelbrot.txt (4.4 KB, 3 views)
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,937
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 278
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso
 
0
  #2
19 Days Ago
Click on this thread (a collegue of you?) http://www.daniweb.com/forums/thread236306.html
to find out more. Good luck!
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 13
Reputation: fawkman is an unknown quantity at this point 
Solved Threads: 0
fawkman fawkman is offline Offline
Newbie Poster
 
0
  #3
18 Days Ago
Hi, thanks very much for this, I apprciate the help, I'll take a loook at the link and see what I can do.

regards
Reply With Quote Quick reply to this message  
Reply

Tags
mandelbrot, math

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC