({{, (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount])[f,z,p]
returns the number of iterations, beginning with the complex number z==p, of the function f(z) needed to determine whether p is in the Julia set of f.}, {, (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount])[c,p] 
returns the number of iterations, beginning with the complex number z==p, of the function f(z)==(z^2)+c needed to determine whether p is in the Julia set of f(z)==(z^2)+c.}, {, (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount])[f,z,{(Subscript[p, 1]),(Subscript[p, 2]),…}]
returns a list of the number of iterations required to determine whether each member of {(Subscript[p, 1]),(Subscript[p, 2]),…} is in the Julia set of f.}, {, (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount])[c,{(Subscript[p, 1]),(Subscript[p, 2]),…}]
returns a list of the number of iterations required to determine whether each member of {(Subscript[p, 1]),(Subscript[p, 2]),…} is in the Julia set of f(z)==(z^2)+c.}})

OpenersNotesSection(Spacer1)Details and Options

The Julia set of a function f is the closure of the set of all repelling fixed points of f.

(RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount]) uses the same "\"OrbitDetection"" algorithm as (RefLink[JuliaSetPlot, paclet:ref/JuliaSetPlot]).

With (RefLink[MaxIterations, paclet:ref/MaxIterations])->n, where n is a positive integer, the function f(z) will be iterated at most n times to determine if z lies outside of the Julia set. If z is not found to lie outside the Julia set, (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount]) returns n+1. The default setting is (RefLink[MaxIterations, paclet:ref/MaxIterations])->1000.

With (RefLink[WorkingPrecision, paclet:ref/WorkingPrecision])->n, each iteration is internally calculated to n digits of precision. Without this option, the amount of precision used is determined based on the precision of p and the value of (RefLink[MaxIterations, paclet:ref/MaxIterations]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Four iterations are needed to determine that 0.1` -0.2` i is not in the Julia set of f(z)==(z^2)-1:

JuliaSetIterationCount[z^2-1,z,.1-.2*I]

Calculate the iterations for a list of numbers:

JuliaSetIterationCount[z^2-1,z,{0,0.5 +0.5I,1+I,1.5 +1.5I,2 +2I}]

OpenersExampleSection1(Spacer1)Scope  (6)

Find the iteration count of 0.1` -0.2 i for the Julia set of f(z)==(z^2)+c where c==-1:

JuliaSetIterationCount[-1,.1-.2*I]

JuliaSetIterationCount[z^2-1,z,.1-.2*I]

Find the iteration count of 0 for the Julia set of a polynomial:

JuliaSetIterationCount[z^3-z-1,z,0]

Find the iteration count of 0 for the Julia set of a rational function:

JuliaSetIterationCount[z^2/(z^2-1),z,0]

Find the iteration counts for a list of numbers:

JuliaSetIterationCount[z^2/(z^2-1),z,{0,1,2,3,4,5,6,7}]

Find the iteration counts for an array of numbers:

Shallow[JuliaSetIterationCount[-1,Table[x+I*y,{y,-.01,.01,.0001},{x,.61,.63,.0001}]]]

MatrixPlot[%]

(RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount]) works on all kinds of numbers:

JuliaSetIterationCount[z^3-z+1,z,{-2,-1.979,1/4,0.26,I,1+I,1/Pi}]

OpenersExampleSection2(Spacer1)Options  (2)

OpenersExampleSubsection0(Spacer1)MaxIterations  (1)

(RefLink[MaxIterations, paclet:ref/MaxIterations]) must be increased if the number of iterations needed exceeds 1000:

{JuliaSetIterationCount[0,I+10^-309],JuliaSetIterationCount[0,I+10^-309,MaxIterations->2000]}

OpenersExampleSubsection1(Spacer1)WorkingPrecision  (1)

Increasing (RefLink[WorkingPrecision, paclet:ref/WorkingPrecision]) can increase accuracy, at the cost of more time:

{JuliaSetIterationCount[0,I+10^-309,MaxIterations->2000],JuliaSetIterationCount[0,I+10^-309,MaxIterations->2000,WorkingPrecision->1000]}

Setting (RefLink[WorkingPrecision, paclet:ref/WorkingPrecision]) too low can result in the iteration entering a false loop:

z0=.618147895647545764;
{JuliaSetIterationCount[z^2-1,z,z0,WorkingPrecision->3],JuliaSetIterationCount[z^2-1,z,z0]}

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

(RefLink[ArrayPlot, paclet:ref/ArrayPlot]) applied to (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount])[c] is essentially (RefLink[JuliaSetPlot, paclet:ref/JuliaSetPlot])[c]:

JuliaSetPlot[z^2-1,z,Method->"OrbitDetection"]

The red dot in the middle comes from taking the (RefLink[Log, paclet:ref/Log]) after (RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount]) returns 0:

ArrayPlot[Log@Transpose@JuliaSetIterationCount[z^2-1,z,Table[Complex[x,y],{x,-2,2,.01},{y,-1,1,.01}]],PlotRange->All]

(RefLink[JuliaSetIterationCount, paclet:ref/JuliaSetIterationCount]) can accept lists, which is faster than applying it to each member of a list:

First@AbsoluteTiming@
JuliaSetIterationCount[z^2-1,z,Table[Complex[x,y],{x,-2,2,.05},{y,-2,2,.05}]]

First@AbsoluteTiming@
Table[JuliaSetIterationCount[z^2-1,z,Complex[x,y]],{x,-2,2,.05},{y,-2,2,.05}]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

The precision of a point may affect the result:

{JuliaSetIterationCount[z^2-1,z,N[3/5,1]],JuliaSetIterationCount[z^2-1,z,N[3/5,100]]}

OpenersExampleSection5(Spacer1)Neat Examples  (2)

Display the iteration count as height:

ListPlot3D[Log[1+JuliaSetIterationCount[z^2-1-I/3,z,Table[Complex[x,y],{x,-2,2,.01},{y,-1,1,.01}]]]]

Create a three-dimensional image by varying a parameter:

data = Table[JuliaSetIterationCount[(z^2+c),z,Table[Complex[x,y],{y,-1,1,.03},{x,-2,2,.03}]],{c,-1,1,1/19}];

Image3D[Rescale[Log[Clip[data,{1,Infinity}]]]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[JuliaSetPlot, paclet:ref/JuliaSetPlot])  ▪  (RefLink[MandelbrotSetIterationCount, paclet:ref/MandelbrotSetIterationCount])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Mathematical Functions, paclet:guide/MathematicalFunctions])}, {▪(RefLinkPlain[Iterated Maps & Fractals, paclet:guide/IteratedMapsAndFractals])}})}})