Logo by slon_ru - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 24, 2024, 03:48:49 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2 3 4   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Not fractal but funny; general torus knots DE routine  (Read 7775 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: January 15, 2012, 06:10:04 PM »

Hi there, I found this thingy http://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page7.html

It opens an interesting question to me, hope you are able to find the answer.

In Mandelbulb, routines must be calculated pixel by pixel.
So we can manipulate x,y,z and the next iter will compute the function with those new values for x,y,z.

Okay! In DIFS mode, that is awesome, I can define a function R, that defines the estimation of the distance from the surface of the fractal of the given pixel.

How do I find such a distance in the case of the knot? Inverting the relationships is not easy because it is not a "function" so distance is not unique I think. I need to find the minimum distance of course... Any idea huh?

(For example ok, tan(2*t) = y/x but atan() is not unique. Same goes for asin(z/R) )

Direct relationship
Point (x,y,z) belongs to the "knot" if it is one of those infinitely^2  grin many points;

Code:
For 0<t<2pi and 0<R<1.5; (for example)
(or in alternative, -pi<t<+pi)
x=R*cos(2*t) * (3 - cos(3*t))
y=R*sin(2*t) * (3 - cos(3*t))
z=R*sin(3*t)

problem; How can I check if a point (x,y,z) belongs to the knot?
Better; Given a point (x,y,z) find the minimum possible positive value for R that satisfies the relationship using an efficient algorythm

Don't post approximate solutions like calculate the direct relationship 200 times and see what's the nearest point, because it is not really good... Thanks kiss
« Last Edit: January 18, 2012, 10:19:34 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: January 15, 2012, 09:05:16 PM »

Given the method for standard DE for Mandys and Julias I'd guess an analytical method using the derivatives may provide a solution ?

You have x = f(t), y= g(t) and z = h(t) therefore I'd guess something involving f', g' and h' might help ?

Of course the best solution to your problem which I presume is rendering 3D knots is not to test if a point is on the knot or to get the minimum distance to a point on the knot but rather to intersect a viewing ray directly with the knot, i.e. find (the smallest positive) a in

(x0,y0,z0)+a*(dx,dy,dz) = ( R*cos(2*t) * (3 - cos(3*t)), R*sin(2*t) * (3 - cos(3*t)), R*sin(3*t) )

given x0,y0,z0 and dx,dy,dz.

I'd guess there is a very quick way to render 3D knots given the quantities of such images (and animations) that Jos Leys has produced smiley

http://www.josleys.com/articles/ams_article/Lorenz3.htm
http://www.josleys.com/show_gallery.php?galid=306
http://www.josleys.com/show_gallery.php?galid=303

Unfortunately they aren't something I've looked into - as is probably obvious from this reply wink
« Last Edit: January 15, 2012, 09:17:07 PM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: January 15, 2012, 10:44:27 PM »

David I am wondering a simpler method, there must be smiley
Let us take a torus. Distance from a torus is;

pow(sqr(sqrt(xx + yy)-R1)+zz-R2, something)
if xx is sqr(x) and so on

So if i juggle a bit with this I can get many things wink

first of all using min and max instead of powers and roots gives us a squared tube.
I think that with a poly fold and a twist factor a knot will pop up wink
The reference plane is defined by; sqrt(xx+yy) and z. Rotations and folds must act in this plane. atan2(y,x) is the planar angle useful for 3d twists like mobius strips and knots wink

Will check more tomorrow cheers!
« Last Edit: January 15, 2012, 10:52:26 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: January 16, 2012, 11:23:16 AM »

The torus is done, with dIFS is easy to create crazy combinations. cheesy


* zzz.jpg (16.76 KB, 391x352 - viewed 2192 times.)
Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #4 on: January 16, 2012, 11:30:04 AM »

Four flavours of torus wink

Sorry for the flood but I can't enclose more than one image per post :smiley


* zzz.jpg (18.74 KB, 957x240 - viewed 776 times.)
Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #5 on: January 17, 2012, 06:01:11 PM »

I've completed the routine!  wink wink wink Whew very hard to find the correct one. cry

It needs a torsion factor;

Code:
Tfactor = (a + b/polyfoldOrder) * atan2(y,x)
x := sqrt(x^2+y^2)-R1
Rotate(x,z,Tfactor)

Then ... another angle;

Code:
Angle = (pi/2 - atan2(x,z)) * polyfoldOrder / twopi
Angle = roundInt(angle)
Angle = Angle / polyfoldOrder * twopi
Rotate(x,z,Angle)
x = x + R3

... plus other things shocked or it does not work. Anyway some plots enclosed. smiley smiley smiley

It plots very fast btw wink


* zzz.jpg (51.01 KB, 801x710 - viewed 752 times.)
« Last Edit: January 17, 2012, 06:09:47 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
knighty
Fractal Iambus
***
Posts: 819


« Reply #6 on: January 17, 2012, 06:51:38 PM »

the wave Awesome! the wave
 Repeating Zooming Self-Silimilar Thumb Up, by Craig
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #7 on: January 17, 2012, 07:35:23 PM »

the wave Awesome! the wave
 Repeating Zooming Self-Silimilar Thumb Up, by Craig

 embarrass embarrass embarrass Omg thanks so much.  smiley grin drinking beer together
Logged

No sweat, guardian of wisdom!
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #8 on: January 17, 2012, 08:43:20 PM »

Yes, very impressive, DarkBeam!

I tried to implement your formula, but there are many parameters...
What should the params for R1,R3,a,b, and polyfoldOrder be for something like the upper left corner picture?

And, indeed, what is a polyfold? A search on Wikipedia took me to some frightening places discussing symplectomorphisms and Floer homologies...


* db.jpg (11.86 KB, 400x249 - viewed 2092 times.)
Logged
bib
Global Moderator
Fractal Senior
******
Posts: 2070


At the borders...


100008697663777 @bib993
WWW
« Reply #9 on: January 17, 2012, 08:43:41 PM »

Cool!! shocked But are these done in M3D? If yes, where is the m3f ?
Logged

Between order and disorder reigns a delicious moment. (Paul Valéry)
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #10 on: January 17, 2012, 11:57:10 PM »

You see me impressed too, Darkbeam!
I was wondering if this would be even possible, but you already gave the answer  smiley
Also the DE's seems to be very good, respect!

ps:
bib, look here for formulas:
http://www.fractalforums.com/mandelbulb-3d/re-custom-formulas-and-transforms-release-t9810/



* knots.jpg (36.35 KB, 480x360 - viewed 2083 times.)
Logged
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #11 on: January 18, 2012, 12:10:57 AM »

DE for a trefoil knot?! i too am impressed, great work luca cheesy
Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #12 on: January 18, 2012, 09:49:31 AM »

 embarrass embarrass embarrass

You are confusing me... Too much honor Azn

Okay, let's have a look to the theorical blabla that made this possible, then I will try to decipher my own formula again for all the other people wink

And it's not a DE for the trefoil only, but for all sorts of torical knots cheesy

They all share the same principle dancing banana dancing chilli dancing banana

Don't look at the orientations and all other details, it's only a sketch for having a rough idea of what the f*** the transform does. If you can have it wink


* knottish.GIF (16.06 KB, 801x569 - viewed 766 times.)
« Last Edit: January 18, 2012, 11:05:01 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #13 on: January 18, 2012, 10:07:26 AM »

Code:
// we modify copies of the variables not the variables ;)
x = Vec.x; y = Vec.y; z = Vec.z;
// try any + or - integer for a & b. Neg values change the handedness
// If you are greedy use only b and set a = 1. Less user friendly btw
Mobius = (a + b/polyfoldOrder) * atan2(y,x)
x := hypot(x,y)-R1 // from now on we will not use y anymore - act on z-rho section
Rotate(x,z,Mobius)
// now do the magic polyfold. But polyfoldOrder must be integer too!
// I stole this transform from PolygonalBarnsleym in sam.ufm ! It generates those kaleidoscope things with ease
Angle = (pi/2 - atan2(x,z)) * polyfoldOrder / twopi
Angle = roundInt(angle)
Angle = Angle / polyfoldOrder * twopi
Rotate(x,z,Angle)
x = x - R3
// final steps now ... dun dun dunnn ...
Mag = hypot(x,z) - R2
// Done :D
return Mag;

// Replace hypot() with max() or min() and see what happens ... ;)

// My settings R1 = 2 , R2 = .4 , R3 = .5
// trefoil is of order 2, then a = b = 1 (the simplest knot)

I hope that it's all ... and that it works for everyone. Syntopia please try it wink
« Last Edit: January 18, 2012, 10:32:24 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #14 on: January 18, 2012, 10:48:30 AM »

nice, i like the 2 folded strings as well,  Smiling Mandelbrot




ehrm, when i see this right, we can now start to begin include DE's for any other shape ?
any chance for including a supershape-DE ? wink smiley horsie riding

and today is the no wikipedia day, we need to survive without, thanks to paul bourke
http://paulbourke.net/geometry/supershape3d/
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Pages: [1] 2 3 4   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
General introduction to Fractal Geometry General Discussion Jules Ruis 2 5094 Last post November 13, 2006, 05:17:10 PM
by Office_Shredder
3D Fractal Flame Animation - Torus function Best Fractal Animation doncasteel8587 0 6477 Last post November 19, 2006, 05:06:27 PM
by doncasteel8587
Conformally converting a square to a torus requires a fractal structure Fractal News across the World msltoe 0 1780 Last post December 27, 2013, 08:15:29 PM
by msltoe
Knitted Knest of Knighty Knots Mandelbulber Gallery mclarekin 1 974 Last post October 09, 2016, 01:25:23 PM
by paigan0

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.182 seconds with 24 queries. (Pretty URLs adds 0.013s, 2q)