flat assembler
Message board for the users of flat assembler.
Index
> Heap > Some mathematical shenanigans :D(complex numbers & fract 
Author 

MHajduk
fredlllll
Have you seen this thread: Multithreaded Quaternion Julia Sets renderer? Fractals in 3D are created by use of quaternion numbers. 

08 May 2013, 21:04 

fredlllll
looks interesting. but i think calculation with quaternions is different isnt it?


08 May 2013, 21:09 

MHajduk
fredlllll wrote: looks interesting. but i think calculation with quaternions is different isnt it? 

08 May 2013, 21:17 

fredlllll
i already stated that i have 4 dimensions now and only can show a slice of the 4d object. but even if its "just" a slice it would be a better mandel representation than the mandelbulp (my point of view)
and as the title says, thats all shenanigans. hopefully the 3d will give me "sharper" objects than the quaternion julia thing. it really looks pretty smooth. just too smooth for a fractal. btw is it mathematical proven that there is no sqrt(1)? 

08 May 2013, 21:37 

MHajduk
fredlllll wrote: btw is it mathematical proven that there is no sqrt(1)? It's quite opposite, in maths we build a new class of numbers (i.e. complex numbers) assuming that sqrt(1) does exist in fact. 

08 May 2013, 21:44 

fredlllll
i mean if sqrt(1) exists in R1. i mean sqrt(i) exists in C. so if we say we just didnt find the sqrt(i) and call it j, my mathematics stuff would be correct XD


08 May 2013, 21:45 

MHajduk
fredlllll wrote: i mean if sqrt(1) exists in R1. i mean sqrt(i) exists in C. so if we say we just didnt find the sqrt(i) and call it j, my mathematics stuff would be correct XD 

08 May 2013, 21:52 

fredlllll
but is it proven that there is no sqrt(1) in R? someone just said " i dont know it, ill call it i" and complex numbers were born


08 May 2013, 22:27 

bitRAKE
There is prolly a mapping from quaternions to the 4D space you are using.
Lovely image here of 3D mandlebrot: http://blog.hvidtfeldts.net/index.php/2011/09/distanceestimated3dfractalsvthemandelbulbdifferentdeapproximations/ Mandlebrot fractal is difficult to see in the mandlebulb, but it's in there: http://upload.wikimedia.org/wikipedia/commons/b/b0/Mandelbulb_p2.jpg Here there is a programming error which was lost by Mandlebrot: http://www.bgc.bard.edu/gallery/galleryatbgc/pastexhibitions/focusgallery4/highlightsfocus.html If the order of values is reversed from zr²zi² to zi²zr²; in the calculation of next zr, then the following error is seen.


09 May 2013, 04:54 

fredlllll
i think i really should start with my 3d implementation XD
oh and does someone know how to render my formular in 3d? because i dont know how to really do it except voxels =/ 

09 May 2013, 09:52 

MHajduk
fredlllll wrote: but is it proven that there is no sqrt(1) in R? someone just said " i dont know it, ill call it i" and complex numbers were born Your questions are asked in a bit irritating manner but provoke to thinking and hence are valuable. I suspected that you may ask if sqrt(1) belong to the real numbers set (R) and thought about the possible proof. At first I even wanted to use axiom of Archimedes but after all I realized it isn't so much needed here (we can made far stronger assumption than that used in axiom of Archimedes). The proof is relatively easy and I'm sure that thousands of mathematicians before me made it. Here we go. Let's assume that a number sqrt(1) is real. We can name it with any symbol we choose but I think it'll be better to stay with "i" because it's used so long in maths and there is no reason to change it, anyway bear in mind it's only a naming convention. So, we assume that i = sqrt(1) is real. The number i has such a feature that if squared gives us 1: i^2 = 1 Okay. If i is real then it should have its place among other real numbers, in other words it should be greater than some real numbers and at the same time less than others. We can just check the relationship of i to zero:


09 May 2013, 18:32 

MHajduk
fredlllll wrote: lets say sqrt(i) = j. just like sqrt(1) = i . so i had my "new" complex number which looked like 1+1i+1j. fredlllll wrote: so if we say we just didnt find the sqrt(i) and call it j, my mathematics stuff would be correct XD You may ask what is the value of √¯i and what kind of number it is. Well, numbers such as 1, i, 1 and i belong to the unit circle on the complex plane and may be represented in the trigonometric form this way:
√¯i = i^(1/2) = [cos(3/2 * π) + i*sin(3/2 * π)] ^ (1/2) = cos(1/2 * 3/2 * π) + i*sin(1/2 * 3/2 * π) = cos(3/4 * π) + i*sin(3/4 * π) Because cos(3/4 * π) = √¯2/2 and sin(3/4 * π) = √¯2/2 we have that j = √¯i = √¯2/2 + i * √¯2/2 and it is a complex number. Hence also all "shenanigans" of form a + b*i + c*j = a + b*i + c*(√¯2/2 + i * √¯2/2) = (a  c*√¯2/2) + (b + c*√¯2/2) * i are complex too. 

09 May 2013, 19:59 

fredlllll
okay so no sqrt(1) in R got that.
ejup i already know that there is a complex representation of sqrt(i) but even if it is a part of a complex number, as shown above it does weird things to the fractal you cant do with a normal complex number as C (maybe because im just shoving them around, but my j presentation is much easier readable than the backconversion to a complex number.). as already stated its shenanigans and was just made to get a 3d representation of the mandelbrot, which in this case acts as a 4 dimensional object. okay its pseudo4 dimensional. but its "correct" mathematics. you could also represent a real number as a*3.14159+b*42 and you have 2 pseudo dimensions. and as complex numbers act a bit strange i get this asymmetric thing there. i just thought i could post it here because someone might want to tinker with the idea and as you see i get some "results" i really wonder how would the mandelbrot look like in 3d using this j stuff (using a line for the jpart) so maybe someone wants to test it and post a result, or ill test it when i have time for it ^__^ 

09 May 2013, 21:16 

typedef
Well check this out http://pastebin.com/9JLvNrVg


10 May 2013, 00:40 

tthsqe
fredlll, interesting ideas, but unfortunately these kinds of issues have been investigated before and are summed up in the Frobenious theorem (http://en.wikipedia.org/wiki/Frobenius_theorem_(real_division_algebras)).
I see that you are multiplying quadruples of real numbers (a,b,c,d) by identifying (a,b,c,d) with the symbol a + b i + c j + d i j and multiplying out using the distributive property. To give the result the same form as what you started with, you used the rules: Code: a) i*i = 1 b) j*j = i c) i*j = j*i The crucial observation is that assumption c) makes your whole multiplication operation commutative, and the Frobenious theorem guaranties that your field is going to be isomorphic to either R or C. Because of assumption a), your field cannot be R, so it is C. The fundamental theorem of algebra then says that b) implies that j has a solution in R+R*i. To sum it up Code: j > (1i)/Sqrt[2] provides an isomorphism of your field to the ordinary C. Now, I have one comment on your picture. It should be a simple affine transformation of the ordinary mandelbrot, but clearly it is not. When calculating the norm of (a,b,c,d) did you simply use a^2+b^2+c^2+d^2 instead of the proper norm obtained by j = (1i)/Sqrt[2]? Also, you were VERY close to discovering the quaternions  all you need are the rules Code: a) i*i = 1 b) j*j = 1 c) i*j = j*i 

10 May 2013, 04:18 

bitRAKE
Here are some awesome (i.e. lightweight and flexible) tools if you want to work on a shader...
Ken Silverman's update of Tigrou's Polydraw An OpenGL/GLSL scripting tool http://advsys.net/ken/download.htm Iñigo Quilez https://www.shadertoy.com/ Another example, GPU raymarcher of the Mandelbox fractal. http://rrrola.wz.cz/downloads.html 

10 May 2013, 06:46 

< Last Thread  Next Thread > 
Forum Rules:

Copyright © 19992020, Tomasz Grysztar.
Powered by rwasa.