Author Topic: The FBcomplex lib from FreeBasic  (Read 6320 times)

0 Members and 1 Guest are viewing this topic.

jack

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #15 on: May 11, 2015, 10:07:32 AM »
RobbeK
I experimented with your fractal program a little, I copied fbcomplex.bas and fbcomplex.bi to fbcomplex-s.bas and fbcomplex-s.bi and edited them to use single instead of double
then compiled using: fbc -c -gen gcc -Wc -Ofast fbcomplex-s.bas
and compiled your fractal program using the same switches, it's roughly twice as fast, but there is a visible dot in the yellow disk


.

jack

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #16 on: May 11, 2015, 10:44:29 AM »
the included library has issues, when using factor 5 it's distortion is severe.

RobbeK

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #17 on: May 11, 2015, 12:43:03 PM »
Hi Jack,

a lot of thanks

don't worry about that black hole on 0,0 -- it should be there , it's a (near) by zero division ...

"distortion is severe"  -- maybe you have to change the loop escape mechanism  (I wrote this with double floats in mind)
(residu > 0.0000001)  replace->   (residu > 0.00001).  it's possible with such a small value , the single floats become "bouncing"

The idea of scaling the coefficients is not so bright , I'll include a coordinate system scaling/transformation. 

best, Rob

jack

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #18 on: May 11, 2015, 03:34:36 PM »
RobbeK
I changed the resedue as suggested and it fixed the strange result when using scaling factor 5 :)

Aurel

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #19 on: May 11, 2015, 10:10:18 PM »
hi Rob
Your example of Mandelbrot is interesting because fractal is created from
outside to inside ..nice effect.. :)

RobbeK

  • Guest
Re: The FBcomplex lib from FreeBasic
« Reply #20 on: May 11, 2015, 11:52:48 PM »
Thanks Aurel

Hi Jack,  yes I suspected that value was too small for single floats.  I added the viewport width now ....

now embedding Newlisp into freebasic , could be vary handy sometimes

best , Rob

.