Logo by Fiery - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 19, 2024, 09:00:24 AM


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]   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: help: how was polar exponentiation exactly ?!  (Read 1174 times)
0 Members and 1 Guest are viewing this topic.
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« on: February 06, 2010, 08:15:13 PM »

i am right now sitting on implementing some function in glsl, but as always, i have problems getting the complex exponentiation ( complex number with complex numbers )
running, i use the following function, but it is only working correctly for positive real exponents, as soon as the exponent gets negative, or an imaginary parts comes into
play, the function returns invalid values, can someone look at it, and tell me what i am doing wrong ??!


Code:
vec2 complexPot(vec2 x,vec2 y){

float a=x.x;
float b=x.y;
float c=y.x;
float d=y.y;


vec2 p1=cartesianToPolar(x);
float r=p1.y;
float t=p1.x;

float re = pow(r,c)*exp(-d*t)*cos(c*t + d*log(r));
float im = pow(r,c)*exp(-d*t)*sin(c*t + d*log(r));

return vec2(re,im);

}
Logged

---

divide and conquer - iterate and rule - chaos is No random!
jehovajah
Global Moderator
Fractal Senior
******
Posts: 2749


May a trochoid in the void bring you peace


WWW
« Reply #1 on: February 09, 2010, 03:23:59 AM »

A point in the [[polynomial plane]] can be represented by a polynomial number written in
[[Coordinates (elementary_mathematics)#Cartesian coordinates|cartesian coordinates]].  Euler's formula provides a means of conversion between cartesian coordinates and [[coordinates (elementary mathematics)#Polar coordinates|polar coordinates]].  The polar form reduces the number of [[Term (mathematics)|term]]s from two to one, which simplifies the mathematics when used in multiplication or powers of polynomial numbers.  Any p0lynomial number z= x + iy can be written as

z = x + iy = |z| (\cos \phi + i\sin \phi ) = |z| e^{i \phi} \,
 \bar{z} = x - iy = |z| (\cos \phi - i\sin \phi ) = |z| e^{-i \phi} \,

where
 x = \mathrm{Re}\{z\} \, the real part
 y = \mathrm{Im}\{z\} \, the imaginary part
|z| = \sqrt{x^2+y^2} the [[magnitude (mathematics)|magnitude]] of ''z''
\phi = \, [[atan2]](''y'', ''x'').

\phi \, is the ''[[arg (mathematics)|argument]]'' of 'z'-i.e., the angle between the ''x'' axis and the vector ''z'' measured counterclockwise and in [[radian]]s-which is defined [[up to]] addition of 2π.
                  
Now, taking this derived formula, we can use Euler's formula to define the [[logarithm]] of a polynomial number. To do this, we also use the definition of the logarithm (as the inverse operator of exponentiation) that

a = e^{\ln (a)}\,

and that

e^a* e^b = e^{a + b}\,

both valid for any polynomial numbers ''a'' and ''b''.

Therefore, one can write:

 z = |z| e^{i \phi} = e^{\ln |z|} e^{i \phi} = e^{\ln |z| + i \phi}\,


for any ''z''≠0. Taking the logarithm of both sides shows that:

ln z= \ln |z| + i \phi.\,

and in fact this can be used as the definition for the [[polynomial logarithm]]. The logarithm of a polynomial number is thus a [[multi-valued function]], because \phi is multi-valued.

Finally, the other exponential law

(e^a)^k = e^{a k}, \,

which can be seen to hold for  all integers ''k'', together with Euler's formula, implies several [[trigonometric identity|trigonometric identities]] as well as [[de Moivre's formula]].

Based on wikipedia.
« Last Edit: February 09, 2010, 03:27:29 AM by jehovajah, Reason: wikipedia edits » Logged

May a trochoid of ¥h¶h iteratively entrain your Logos Response transforming into iridescent fractals of orgasmic delight and joy, with kindness, peace and gratitude at all scales within your experience. I beg of you to enrich others as you have been enriched, in vorticose pulsations of extravagance!
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
mandelbrot in polar coords, log scale from zoom video Exotic Projection / Rendering of Fractals « 1 2 » makc 20 17251 Last post December 06, 2014, 11:40:01 PM
by Chillheimer
Generalizations of Complex Numbers by Circular Functions and Exponentiation (new) Theories & Research scientiaesthete 1 585 Last post December 01, 2011, 04:41:50 AM
by s31415
Quaternion Exponentiation Introduction to Fractals and Related Links JVillella 11 6368 Last post January 03, 2012, 11:55:49 PM
by DarkBeam
polar coord on polar plane Mathematics arturv 3 3728 Last post March 30, 2012, 02:01:15 AM
by arturv
giant leaps? fast exponentiation for iteration Mandelbrot & Julia Set claude 0 1513 Last post September 26, 2013, 01:09:36 AM
by claude

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.155 seconds with 25 queries. (Pretty URLs adds 0.006s, 2q)