({{, (RefLink[MandelbrotSetDistance, paclet:ref/MandelbrotSetDistance])[c] 
estimates the distance from c to the nearest point in the Mandelbrot set.}, {, (RefLink[MandelbrotSetDistance, paclet:ref/MandelbrotSetDistance])[c,"Interior"]
estimates the distance from c to the nearest point in the complement of the Mandelbrot set.}})

OpenersNotesSection(Spacer1)Details and Options

The Mandelbrot set is the set of all complex numbers c for which the sequence (Subscript[z, n])=(Subscript[z, n-1]^2)+c does not diverge to infinity when starting with (Subscript[z, 0])=0.

With the option (RefLink[MaxIterations, paclet:ref/MaxIterations])->n, the sequence (Subscript[z, n])=(Subscript[z, n-1]^2)+c will be iterated at most n times to determine the distance. The default setting is (RefLink[MaxIterations, paclet:ref/MaxIterations])->100.

As (RefLink[MaxIterations, paclet:ref/MaxIterations]) approaches infinity, (RefLink[MandelbrotSetDistance, paclet:ref/MandelbrotSetDistance])[c] will converge on a number that is guaranteed to be at least the true distance.

OpenersPrimaryExamplesSection(Spacer1)Examples  (11)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Estimate the distance from 1+i to the Mandelbrot set:

MandelbrotSetDistance[1+I]

(RefLink[MandelbrotSetDistance, paclet:ref/MandelbrotSetDistance]) is useful for making stark binary images of the Mandelbrot set:

data=Table[MandelbrotSetDistance[x+I*y],{y,-1.5,1.5,.005},{x,-2,1,.005}];

ArrayPlot[data/.{_?(0<#<0.008&)->1,_?(#>0.008&)->0}]

OpenersExampleSection1(Spacer1)Scope  (2)

Estimate the distance from 0.73` -0.9` i to the Mandelbrot set:

MandelbrotSetDistance[.73-.9*I]

The origin is in the Mandelbrot set so the distance is zero:

MandelbrotSetDistance[0]

Estimate the distance from the origin to the boundary of the Mandelbrot set:

MandelbrotSetDistance[0,"Interior"]

OpenersExampleSection2(Spacer1)Options  (2)

OpenersExampleSubsection0(Spacer1)MaxIterations  (1)

Sometimes (RefLink[MaxIterations, paclet:ref/MaxIterations]) needs to be increased to get a nonzero distance:

{MandelbrotSetDistance[25745/100000,MaxIterations->30],MandelbrotSetDistance[25745/100000,MaxIterations->50000]}

OpenersExampleSubsection1(Spacer1)WorkingPrecision  (1)

Increase (RefLink[WorkingPrecision, paclet:ref/WorkingPrecision]) to get a more precise answer:

MandelbrotSetDistance[9/7]

MandelbrotSetDistance[9/7,WorkingPrecision->50]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

MandelbrotSetDistance[100]

MandelbrotSetDistance[101]

OpenersExampleSection4(Spacer1)Neat Examples  (4)

Combine interior and exterior distance information:

data=Table[Max[MandelbrotSetDistance[#,"Interior"],MandelbrotSetDistance[#]/4]&[x+I*y],{y,-1,1,.02},{x,-2,.6,.02}];

ListPlot3D[data]

Display the distance to the Mandelbrot set from points on one-quarter of the unit circle:

data=Table[MandelbrotSetDistance[E^(I t Pi),MaxIterations->120],{t,0,Pi/2,.001}];

ListPlot[data]

Represent the distance to the complement of the Mandelbrot set as height:

data=Table[MandelbrotSetDistance[x+I*y, "Interior",MaxIterations->100],{x,-2.,1.,.031},{y,-1.5,1.5,.031}];

ListPlot3D[data,Mesh->None,PlotRange->Full]

Display distance to the Mandelbrot set as height:

data=Table[MandelbrotSetDistance[x+I*y, MaxIterations->120],{y,-1.5,1.5,.01},{x,-2,1,.01}];

ListPlot3D[data,Mesh->None]

Display the distance from the exterior of the Mandelbrot set using color:

Graphics@Raster[data/.{_?(#<=0.&)->.9},ColorFunction->Hue]

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

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