PDA

View Full Version : Augustin Fresnel (and his fractals)



RobbeK
08-10-2014, 23:49
Hi all,

-- the same Fresnel as from the "compact" lens ---

Found something interesting in a math book, originally 2D , but I'm expanding it into 3D.
I wrote it first in Lisp, but as tB has an eval module , the input can be very interactive ...

It's based on irrational numbers and the patterns they create in a certain cyclus ...

the code is still in an embryonic state, and will be completed with O² ...

you can input a calculation in For I and For II -- already named are : pi , fi (the golden ratio) , e , pi2 ... but anything conform with the tB eval module will do ...

navigate with the arrow keys and PgUp / Dn ... try i.o. fi in the For I , pi ... a completely different image ...

will be updated ..

best Rob

ReneMiner
09-10-2014, 11:49
looks like snowflakes :)

RobbeK
09-10-2014, 16:03
Thanks, René .. cool not ?


attached another one (generated by a square root)

best , Rob

RobbeK
10-10-2014, 12:18
using O² now ---

Arrays are still static : max iteration level = 500.000


best , Rob

Charles Pegge
10-10-2014, 20:21
Hi Rob,

I have reconfigured your program to accept dynamic or static Vectors. You can call o2Compute with a new vector/coordinate base whenever required.

RobbeK
10-10-2014, 22:46
Ah, many thanks Charles ....



Dim as Vector3D *cov

You declare cov as being (how-to-say) "referenced" , and then it interacts with a tB ByRef declaration ?? (i think to remember dereferencing from FB , is it similar ? )

.. I wonder it is possible to set up (in O²) a GLlist that can be recognized by tB+TBGL , here the work is almost done twice .. (in speed, much more than twice ... )

best Rob

Charles Pegge
10-10-2014, 23:09
Yes I'll have have a go, Rob.

Meanwhile, a few more tricks:

Using striding pointers instead of indexes.

Turning your zeta functions into Macros.

Passing all params to o2Compute, instead of #-sharing them.

RobbeK
10-10-2014, 23:47
Hi Charles,


What's the benefit of using macro's in O² , .. they are expanded / compiled inside the functions/subs (which otherwise would) calling them ?
--- what if I declare locals inside a macro , are these protected or do they belong to the scope of the function/sub where the macro ends ?
or should I not declare variables inside a macro ??


( thetaz() must remain on its own for the moment , (unlike centerX,Y,Z) .. must find something better and different than the way it acts now).



best Rob

Charles Pegge
11-10-2014, 00:28
Rob,

Macros are slightly faster, without the overhead of a function's prolog and epilog.

You may declare variables inside a macro. You may also confine the visibility of such variables, if so desired, to the inside of the macro by specifying a scope.

macro foo(a,b,c)
scope
dim long v
...
end scope
end macro

In this version, Oxygen generates the glVertex3fv list, lifting the burden from TBGL :)

TBGL_NewList 1
TBGL_BeginPoly %GL_POINTS
'
'will compute then pass the vertexes to Opengl
'
O2Compute cov(1),Nr_Coor,ValA,ValB
'
TBGL_EndPoly
TBGL_EndList



I also reduced the vector array from double to single precision, since this type is native to graphics cards, and I can now pass vectors in one param by reference.

RobbeK
11-10-2014, 10:24
Thanks Charles !!! (just what i needed ;-)

cast is new to O² ?? (had to upgrade ) -- C-style casting ??



best , Rob

Charles Pegge
11-10-2014, 11:33
Hi Rob,

The cast syntax has changed recently:

These are accepted formats

a=cast float b

a=cast(float) b

a=(float) b




PS the sqrt 333 coefficient is extremely sensitive to small changes. Most intriguing!

RobbeK
11-10-2014, 12:41
Hi Charles,

Yep, textfields may somewhat wider then ....

I think I'll make a 2D animation about the impact of these small changes ....


attached : now, added the Feigenbaum and Euler constants. (used at start up)


best Rob

Billbo
12-10-2014, 01:50
RobbeK and Charles,

RobbeK, I downloaded your attached zip file
from your first post under this topic. AVG
will not let run the enclosed exe, because
of an unknown virus. In the process of
removal, AVG has't to reboot the system to
finish the removal. I did this twice and it's a
pain in you know where.

For both of you, I get none of the scripts to
to display anything other than opening a large
black window in the middle of the screen.

For both of you, again. I downloaded the last
two scripts posted. I tried to run them and I get
an error popup on each. See the attached
capture. This is after running the script from
page 2 (RobbeK's).

Note WORD: cast and LINE: 88. In thinAir, the
script has 'cast' one time and it is on line 120.
I didn't count; maybe thinAir doesn't count
line spacing.

Correct me if I'm wrong, I've been off programming
for a while due to health.

Bill

P.S. I don't know if it makes any difference, but the
popup displays whether I'm running thinBasic and
load the script, or not run thinBasic and double-click
the downloaded script and it run by association.

Charles Pegge
12-10-2014, 07:44
Hi Bill,

Virus checkers, especially AVG, have become totally paranoid. Best disabled when downloading and running from trusted sources. Windows Vista, and later OSes have basic protection anyway.

You can download the latest thinBasic_Oxygen here:

http://www.thinbasic.com/community/showthread.php?12175

The 2 DLLs need to be copied into thinBasic\lib

Hope this helps!

RobbeK
12-10-2014, 12:11
Hi Bill, Charles ...

Sorry to hear Bill, .. but when there is a mad dog on the run, there are two solutions : either you put the agressor in a kennel, or you put yourself into one (modern practise seems to prefer the second one) --sadly, it's not only about computer thechnology imo.

Yes, those Fresnel Frac's seem to have attractors/black holes -- sometimes the whole image is almost a single point and then it starts to expand till ...


attached , somewhat around sqrt(333)


best Rob

Charles Pegge
12-10-2014, 12:25
Magical and mysterious, numbers doing their thing. I wonder if this is how galactic clusters are created :)

mike lobanovsky
12-10-2014, 14:45
OMG, it does look half alive replicating itself on and on! :o

Billbo
12-10-2014, 19:06
RobbeK and Charles,

Charles, I downloaded and installed the new files.
They work fine.

RobbeK; your 'fr2dv a.tbasic' bundles just fine,
if I uncheck 'Obfuscate main script' and 'Delete
after run.' What do each of these stand for?
Anyway, it will execute with F5, and the exe
also runs okay.

Thanks,

Bill

RobbeK
13-10-2014, 16:39
Hi Bill, Charles, Mike ..
all

Obfuscate : encrypt the source , I think
the other option removes the files intalled by the exe (dll's etc..) from your disk.


A Fresnel black hole (a closer look) -- you can freeze and restart now ..


best Rob,

(Charles, I think the number is the mother of all abstractions-- 2 cows is an abstraction based on one cow -- we may have nothing else to describe such processes )

Billbo
13-10-2014, 18:32
RobbeK,

Thanks for the info and the update to your program. It's neat.

Bill

RobbeK
20-10-2014, 13:45
All,


now with local densities (measured on 8 neighbours).


best Rob

Billbo
20-10-2014, 15:22
RobbeK,

I cannot get to run. Gets an error
popup. See attachment.

Bill

RobbeK
20-10-2014, 16:11
Ah, ok,

You need the latest oxygen dlls/module --
the attached bundle should work


best, Rob

Billbo
20-10-2014, 16:43
RobbeK,

Yes, your exe runs.

There is a large difference in size between
your exe and mine.

Your's: 1,125,335
Mine: 783,669

My oxygen dll's are dated 10/15/2014.

I have attached my bundle window to show
lib files used.

Any other ideas?

Bill