An Application of Viscosity Approximation Type Iterative Method in the Generation of Mandelbrot and Julia Fractals

In this paper, we present an application of the viscosity approximation type iterative method introduced by Nandal et al. (Iteration Process for Fixed Point Problems and Zeros of Maximal Monotone Operators, Symmetry, 2019) to visualize and analyse the Julia and Mandelbrot sets for a complex polynomial of the type T(z)=zn+pz+r\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$T(z) = z^{n} + p z + r$$\end{document}, where p,r∈C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p, r\in {\mathbb {C}}$$\end{document}, and n≥2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n \ge 2$$\end{document}. This iterative method has many applications in solving various fixed point problems. We derive an escape criterion to visualize Julia and Mandelbrot sets via the proposed viscosity approximation type method. Moreover, we present several graphical examples of the fractals generated with the proposed iteration method.


Introduction
Fractal geometry provides a general framework to study those natural objects which can not be easily described using Euclidean geometry. Usually, fractals are used for self-similar complex objects [39]. Nowadays, fractals have been applied for various purposes, for example, in cryptography [1], image encryption [44] or compression [2], art and design [33], pattern recognition [10]. The industry of security control systems, capacitors, radar systems, radio and antennas for wireless systems [6,18] were revolutionized with the applications of fractal theory. Fractals were also used in biology and medicine to study the culture of micro-organisms, the nervous system, etc. [9]. Moreover, architects and engineers applied fractal theory to sketch and design the maps of different projects [13].
Before the invention of computers, the figures of attractive objects, patterns and geometries had been sketched manually. Initially, the investigators of classical fractals like the Cantor set, the Koch curve, Sierpinski's triangle, and the Koch snowflake sketched graphs of these fractals manually. The French mathematician Gaston Julia [16] was the first to use an iteration process to define a new fractal named Julia set for the complex map T r (z) = z 2 + r where z is a complex variable, and r is a complex parameter. Thereafter, in 1975, Mandelbrot [27] used a computer for the first time to extend the work of Julia. He generated beautiful graphics for complex polynomials known as Mandelbrot sets. He defined a fractal as "a fragmented geometric shape that can be subdivided into congruent pieces, each of which is a reduced-size copy of the original one". Julia and Mandelbrot sets were extended from the complex numbers to quaternions [7], bicomplex numbers [43], tricomplex numbers [34] etc. Fractals have been analysed and visualized with various techniques (see, [4,16,[19][20][21][22]27]). The escape criterion plays a prominent role in the generation of fractals (especially, Julia and Mandelbrot sets) which is a stopping criterion depending on the number of iterations required to determine whether the orbit of an initial point escapes to infinity or not. This criterion has been proved to be an appropriate mechanism to demonstrate the features of dynamical systems using various iterative procedures.
Fixed point iterative methods have been used as a milestone to generate and visualize fractals (especially Julia and Mandelbrot sets). These methods provide a unified treatment for finding the fixed points of non-linear operators. Generally, there are two main types of these fixed point iterative methods -one is the Mann type iterative method and the other is the Halpern type iterative method. The Mann iterative method was introduced by Mann [28] which is an averaged iterative method. However, this method does not converge strongly in general (see [11,38]). Many modified forms of the Mann iteration method have been investigated to achieve strong convergence.
In 1967, Halpern [12] introduced one of the most important iterative methods for finding a fixed point of nonexpansive type mappings. In 2000, Moudafi [29] introduced a famous generalization of the Halpern method, that is, the viscosity approximation method which is widely used to approximate a fixed point of a nonexpansive mapping and other classes of non-linear mappings (see [15,[30][31][32]35] and the references therein).
In the literature, the Mann and similar types of fixed point iterative methods have been used so far for generating these fractals. For example, the explicit type of iterations: Mann iteration [36,37], Picard-Mann iteration [45], Picard-Mann iteration with s-convexity [40], Ishikawa iteration [5], Noor iteration [3], SP iteration with s-convexity [23], and the implicit ones: Jungck-CR iteration [41], Jungck-CR iteration with s-convexity [26], Jungck-SP iteration [25], Jungck-SP iteration with s-convexity [24]. Vol. 97 (2023) An Application of Viscosity Approximation Type 259 In [32], Nandal et al. introduced a generalized form of viscosity approximation type iterative methods in the framework of a Hilbert space. They used their method to solve various problems, including a general system of variational inequalities, convex feasibility problems, zero point problems of inverse strongly monotone and maximal monotone mappings, split common null point problems, split feasibility problems, split monotone variational inclusion problems and split variational inequality problems. Due to the large number of applications of the proposed iterative method in the field of fixed point theory, we realized that this method also has a potential to generate fractals. Motivated by this fact, our paper used this new type of viscosity approximation method for generating fractals (Julia and Mandelbrot sets).
The rest of the paper is organized as follows: Sect. 2 deals with the basic definitions, facts and notations. In Sect. 3, we derive the escape criterion which is used to draw Julia and Mandelbrot sets. Next, in Sect. 4, we present pseudocodes of escape time algorithms for generating Mandelbrot and Julia sets via the proposed iteration method. Moreover, we present some graphical examples of the sets obtained with those algorithms. Finally, we conclude our findings in Sect. 5.

Preliminaries
In this section, we give some basic definitions, notations and facts from the literature for the completeness of the paper. where r ∈ C is a parameter, is the set of points in the complex plane whose orbits are bounded, i.e., where T j r denotes the jth iteration of the function T r . The boundary of the filled Julia set F Tr is said to be the Julia set J Tr of the function T r , i.e., J Tr = ∂F Tr .
In 1975, Mandelbrot [27] defined the Mandelbrot set as follows: The collection of all complex numbers r ∈ C for which the filled Julia set F Tr remains connected is known as Mandelbrot set M , i.e., M = {r ∈ C : F Tr is connected}. ( Equivalently, Initially, in 2000 Moudafi [29] investigated the viscosity approximation method. In the complex plane, this method can be defined as Definition 2.3. (Viscosity approximation method [29]) Let T : C → C be a complex map. For an initial point z 0 ∈ C, consider the following sequence {z j } of iterates where α j ∈ (0, 1) and g : C → C is a contraction mapping. The iterative method given in (4) is called the viscosity approximation method.
It is remarkable to note that if in (4), we consider the mapping g as a constant mapping, i.e., g(z) = b, where b ∈ C, then the sequence {z j } reduces to the Halpern iteration [12].
In [32], Nandal et al. considered a new generalized viscosity approximation type method. In the complex plane, this method can be defined as follows: starting with an arbitrary initial point z 0 ∈ C, the sequence {z j } generated by where g is a contraction,

Main result
In the literature, usually, the authors study the escape criterion for the function of the form z n + r. To gain more control over the shape of the generated set, we will consider a function that has a parameter controlling the linear part, i.e., where n ≥ 2 and p, r ∈ C. For this function, we prove a general escape criterion by using a form of the viscosity approximation type method given in (5). Let us assume that k = 1, and that we use constant sequences α j = α, where α, β, γ ∈ (0, 1) and ρ, μ ∈ (0, ∞). Moreover, let us assume that g(z) = az + b is a complex contraction with a, b ∈ C and |a| < 1, and that B 1 (z) = mz and where T is given in (6). For such parameters the iteration (5) takes the following form: where Thus, From (7), consider The assumption |z 0 | ≥ max{|r|, |b|} yields −|b| ≥ −|z 0 |, therefore, we have Using (9), we get Thus, we have Our Using (11) in (10), we obtain Now, from the construction of T γ , we have Further, from (7), consider Vol. 97 (2023) An Application of Viscosity Approximation Type 263 Now, from (12), we obtain This gives Our assumption |z 0 | > |1+mρ|+1+γ|p| Thus, there exists a real number λ > 0 such that Using (16) in (14), we have In particular |z 1 | > |z 0 |, so we may apply the same argument repeatedly to obtain We obtain the following corollary as a refinement of Theorem 3.1:

Graphical examples of mandelbrot and julia sets via the proposed iteration method
Corollaries 3.2 and 3.3 enable us to generate the Julia and Mandelbrot sets of the nth degree complex polynomial T 1 (z) = z n + pz + r, where n ≥ 2 and p, r ∈ C, via the iteration method given in (7) using the escape time algorithm. Namely, if for some j, the element z j lies outside the circle of radius: then the orbit of |z 0 | escapes to infinity. Which implies that the point z 0 does not lie in the filled Julia set. If z j does not exceed this bound, then by definition, z 0 lies in the filled Julia set. In Algorithm 1, we present the pseudocode of a method for generating Julia sets via the viscosity approximation type method given in (7). We generate Julia sets in the given area A ⊂ C and the given colour map. Since an infinite number of iterations cannot be performed, we fix the maximum number of iterations at K iterations. Using a very similar escape time algorithm, we can generate a Mandelbrot set via the viscosity approximation type method given in (7). The pseudocode of this algorithm is presented in Algorithm 2. The set is generated in the area A ⊂ C using the maximal K iterations and a given colour map.
The graphical examples in this section were obtained by a program written in Mathematica 12. In all the examples presented in this section, we used the colour map presented in Fig. 1. The resolution of the images was set to 800 × 800 pixels, and we used K = 50.
.K] -colour map with K + 1 colours. Output: Julia set for area A.
.K] -colour map with K + 1 colours. Output: Mandelbrot set for area A.   From the three figures, we clearly see that each of the three parameters has a great impact on the shape of the Julia set and its size. We also notice that when the value of the varying parameter increases, then the set loses its connectivity and tends to a dust-like set. Moreover, we see a great variety of shapes for the fixed function.
In the next example, we generated Julia sets for a fourth order function. The parameters used to generate these sets were the following: n = 4, p =      The shape of the set, except for the iteration parameters (α, β, γ), can be changed using the p parameter of T r . To show this, for both the examples used in this section, we generated Julia sets for fixed α, β, γ, but with various values of p. For the quadratic Julia set, we used α = 0.33, β = 0.67, γ = 0.35, whereas for the fourth order function we used α = 0.45, β = 0.65, γ = 0.56. Figures 8, 9 present the obtained images of Julia sets in the quadratic and the fourth order case, respectively. From the images, we see that the imaginary part of p plays an important role in obtaining the swirls in the pattern. In the quadratic case, the negative imaginary part of p caused that the swirls are smaller, whereas the positive value of the same magnitude caused that many swirls appeared, and that the set lost its connectivity. In the quartic case, we see a similar behaviour. However, this time for the negative values, we get more smaller swirls, and for the positive ones, the swirls disappear.   To show the variety of Julia sets that can be generated by the proposed method, in the last example we present various Julia sets. They are presented in Fig. 10, and the parameters used to generate them were the following:

Examples of mandelbrot sets
In the first example in this section, we generated Mandelbrot sets for a quadratic function. The parameters used to generate these sets were the following: n = 2, p = 4.62 − 0.002i, A = [−9.5, 0.5] × [−5, 5], K = 50, g(z) = 0.5z + 0.01 + 0.02i, m = 0.7, q = 0.01, ρ = 0.05, μ = 0.62. In the example, we divided the images into three groups. In each group, we fix two parameters from α, β, γ and vary the remaining one. In Fig. 11, we see images generated for fixed β = 0.56, γ = 0.78, and varying α: the set grows when α increases, whereas in Figs. 12 and 13, the set grows when β or γ decreases. We also see that in each case the set has axial symmetry, and that using the viscosity approximation iteration (7) we can generate sets of various shapes for a fixed function.
In the next example, we generated Mandelbrot sets for a fifth order function. The parameters used to generate these sets were the following: n = 5,    (7) with varying p and the fifth order cases, respectively. For the quadratic Mandelbrot set, we see that the introduction of the imaginary part into p causes the set to rotate, and the direction of rotation depends on the sign of the imaginary part of p. In the quintic case, the imaginary part of p causes that the set loses its connectivity, and some rotation appears. For the negative value of the imaginary part, the rotation is in a clockwise direction, whereas for the positive one, the rotation is in a counter-clockwise direction.
To show the variety of Mandelbrot sets that can be generated by the proposed method, in the last example we present various Mandelbrot sets. They are presented in Fig. 19, and the parameters used to generate them were the following:

Conclusions
We conclude from our work that the viscosity approximation type method considered by Nandal et al. [32] has the capability of generating fascinating and attracting graphics of fractals (Julia and Mandelbrot sets), which proves the applicability of the proposed method. We have derived a result to obtain an escape criterion for the generation of these fractals using the proposed iterative method. Some tempting graphics of fractals have been generated by choosing different values of polynomials, contraction mappings, the resolvent operators associated with monotone operators and parameters α, β, γ. We have noticed that the parameters have a great impact not only on the shape, but also on the symmetry of the generated set. Due to their attractive nature in the field of design [17,42], we believe that the results of this research might be very useful for those who are interested in creating nice looking graphics and designer printing patterns. Moreover, the results of this paper might be used to expand the space for the initial keys used in image encryption [14].
Funding The authors declare that no funds, grants, or other support were received during the preparation of this manuscript.

Data availibility
The data and code that support the findings of this study are available from the corresponding author, upon reasonable request.

Conflict of interest
The authors declare that they have no conict of interest.
Open Access. This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creativecommons.org/licenses/by/4.0/.
Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.