estimates the distance from c to the nearest point in the Mandelbrot set.
MandelbrotSetDistance[c,"Interior"]
estimates the distance from c to the nearest point in the complement of the Mandelbrot set.
MandelbrotSetDistance
estimates the distance from c to the nearest point in the Mandelbrot set.
MandelbrotSetDistance[c,"Interior"]
estimates the distance from c to the nearest point in the complement of the Mandelbrot set.
Details and Options
- The Mandelbrot set is the set of all complex numbers c for which the sequence
does not diverge to infinity when starting with
. - MandelbrotSetDistance takes the following options:
-
MaxIterations 100 maximum number of iterations to use WorkingPrecision Automatic the precision used in internal computations - With the option MaxIterations->n, the sequence
will be iterated at most n times to determine the distance. The default setting is MaxIterations->100. - As MaxIterations approaches infinity, MandelbrotSetDistance[c] will converge on a number that is guaranteed to be at least the true distance.
Examples
open all close allBasic Examples (2)
Estimate the distance from
to the Mandelbrot set:
MandelbrotSetDistance[1 + I]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}]Scope (2)
Estimate the distance from
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"]Options (2)
MaxIterations (1)
Sometimes MaxIterations needs to be increased to get a nonzero distance:
{MandelbrotSetDistance[25745 / 100000, MaxIterations -> 30], MandelbrotSetDistance[25745 / 100000, MaxIterations -> 50000]}WorkingPrecision (1)
Increase WorkingPrecision to get a more precise answer:
MandelbrotSetDistance[9 / 7]MandelbrotSetDistance[9 / 7, WorkingPrecision -> 50]Properties & Relations (1)
MandelbrotSetDistance[100]MandelbrotSetDistance[101]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]Related Guides
History
Text
Wolfram Research (2014), MandelbrotSetDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/MandelbrotSetDistance.html.
CMS
Wolfram Language. 2014. "MandelbrotSetDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MandelbrotSetDistance.html.
APA
Wolfram Language. (2014). MandelbrotSetDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MandelbrotSetDistance.html
BibTeX
@misc{reference.wolfram_2026_mandelbrotsetdistance, author="Wolfram Research", title="{MandelbrotSetDistance}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MandelbrotSetDistance.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mandelbrotsetdistance, organization={Wolfram Research}, title={MandelbrotSetDistance}, year={2014}, url={https://reference.wolfram.com/language/ref/MandelbrotSetDistance.html}, note=[Accessed: 13-June-2026]}