Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pre-alpha vector field DLA, with point-and-click attractors...

17 views
Skip to first unread message

Chris M. Thomasson

unread,
Sep 25, 2017, 12:56:45 AM9/25/17
to
Fwiw, here is a rendering of a DLA cluster that was grown online:

https://plus.google.com/101799841244447089430/posts/LjJesbaokGd

in the following pre-alpha highly experimental program I created:

http://funwithfractals.atspace.cc/ct_fdla_anime_dynamic_test

The code can be streamlined quite a bit, but it should go ahead and work
for now.

It starts off with a single strong attracting agent in the center of a
parametric square with an equation of:

x = cos(t) * abs(cos(t))
y = sin(t) * abs(sin(t))

Particles are released from this square, and are immediately influenced
by the center point attractor. They will hit the point and start to
build a DLA cluster. This is all animated.

If you let the program run, it will try to fill the square with this
single DLA cluster. However, I added the ability to click on a point,
and create an attractor with a weaker influence than the center. You
should be able to let it run for a little while, then click some points
in the square and watch particles be dynamically attracted to, and hit
them. Each hit creates a new attractor. This is how it grows.

My source code is all there.

Can anybody get it to work? Thanks.

Evertjan.

unread,
Sep 25, 2017, 4:01:02 PM9/25/17
to
"Chris M. Thomasson" <invalid_chr...@invalid.invalid> wrote on 25
Sep 2017 in comp.lang.javascript:

> Fwiw, here is a rendering of a DLA cluster that was grown online:
>
> https://plus.google.com/101799841244447089430/posts/LjJesbaokGd
>
> in the following pre-alpha highly experimental program I created:
>
> http://funwithfractals.atspace.cc/ct_fdla_anime_dynamic_test
>
> The code can be streamlined quite a bit, but it should go ahead and work
> for now.

Nice!

What about a 3-dimensional one?

<https://youtu.be/eAB5ZyG4KWE>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Chris M. Thomasson

unread,
Sep 25, 2017, 4:25:15 PM9/25/17
to
On 9/25/2017 1:00 PM, Evertjan. wrote:
> "Chris M. Thomasson" <invalid_chr...@invalid.invalid> wrote on 25
> Sep 2017 in comp.lang.javascript:
>
>> Fwiw, here is a rendering of a DLA cluster that was grown online:
>>
>> https://plus.google.com/101799841244447089430/posts/LjJesbaokGd
>>
>> in the following pre-alpha highly experimental program I created:
>>
>> http://funwithfractals.atspace.cc/ct_fdla_anime_dynamic_test
>>
>> The code can be streamlined quite a bit, but it should go ahead and work
>> for now.
>
> Nice!

Thank you for giving it a go Evertjan. :^)


> What about a 3-dimensional one?
>
> <https://youtu.be/eAB5ZyG4KWE>

Ahhh! Very nice indeed. I can do it, just need a little more time.
Adding the z vector to my program is actually not all that hard at all.
WebGL can be used to rendering everything. I already have some crude 3d
vector field work in WebGL online:

http://funwithfractals.atspace.cc/ct_gfield_test/ct_3dgfield_anime_test

http://funwithfractals.atspace.cc/ct_gfield_test

Fwiw, check this out:

https://plus.google.com/101799841244447089430/posts/PU1rRsaEUzK

Equipotential lines in 3d. ;^o

Evertjan.

unread,
Sep 25, 2017, 4:36:56 PM9/25/17
to
Wow, you have been buzy for a long time.

Une Bévue

unread,
Sep 25, 2017, 11:50:21 PM9/25/17
to
Le 25/09/2017 à 06:56, Chris M. Thomasson a écrit :
>
> in the following pre-alpha highly experimental program I created:
>
> http://funwithfractals.atspace.cc/ct_fdla_anime_dynamic_test
>
> The code can be streamlined quite a bit, but it should go ahead and work
> for now.

it runs on Safari Developer Preview

Chris M. Thomasson

unread,
Sep 27, 2017, 4:19:52 PM9/27/17
to
Thank you for giving it a go Une! I can make it better wrt a different
way of programming. This tends to overwhelm the cpu with computation and
the use of the garbage collector. Wrt GC, the JavaScript engines tend to
create new object for every array passed to a function. For instance, I
can pass two 3d points and a radius like this wrt the style of my
current code:

foo([-1, 0, 0], [1, 0, 0], 1);

Each array index is mapped to (a[0] = x), (a[1] = y) and (a[2] = z).

This will create two damn arrays for each call! And those go into the
GC. Read here for some further information:

https://groups.google.com/d/topic/comp.lang.javascript/dgakiMzhgv0/discussion

Also, it can burn CPU because DLA points never die off! I need to allow
them to die off and leave the per-field-line segment vector field
summation. The more points, the slower it goes. I wonder if changing the
color of the field lines to grey, or some color that designates turning
"brown/yellow", or the interpolation of the death cycle wrt specific
colors. The act of death would take pressure off the core field logic
wrt reducing iterations.

Chris M. Thomasson

unread,
Sep 27, 2017, 4:38:16 PM9/27/17
to
;^) Actually, if you look at my code in here:

http://funwithfractals.atspace.cc/ct_fdla_anime_dynamic_test/ct_field.js

Well, I forgot that its already using a 3d vector. Notice how the dif
variable is calculated in:
____________________
var dif = [e[0] - p[0], e[1] - p[1], e[2] - p[2]];
____________________
dif, e and p have three parts. Therefore, its 3d. Cannot believe I did
not notice this. Wrt the 2d canvas, this z-axis is not needed at all!
Damn it.

Performing the iterative summation to get a normalized vector for use on
a per-line-segment basis:
____________________
if (mass > ESP && ! isNaN(mass) && isFinite(mass))
{
g[0] = g[0] + e[3] * dif[0] / mass;
g[1] = g[1] + e[3] * dif[1] / mass;
g[2] = g[2] + e[3] * dif[2] / mass;
}
____________________
g has three parts! I accidentally put my 3d vector field into a 2d
scenario. It still works, but its using unnecessary calculations that
have no bearing on the actual 2d plotting logic.

Sorry about that.
0 new messages