1 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].

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.

2 Preliminaries

In this section, we give some basic definitions, notations and facts from the literature for the completeness of the paper.

Definition 2.1

(Julia set [8]) The filled Julia set \(F_{T_r}\) of a function \(T_r: {\mathbb {C}} \rightarrow {\mathbb {C}}\), where \(r \in {\mathbb {C}}\) is a parameter, is the set of points in the complex plane whose orbits are bounded, i.e.,

$$\begin{aligned} F_{T_r} = \{ z \in {\mathbb {C}}: \{|T_{r}^j(z)| \}_{j = 0}^{\infty } \text { is bounded} \}, \end{aligned}$$
(1)

where \(T_{r}^{j}\) denotes the jth iteration of the function \(T_r\). The boundary of the filled Julia set \(F_{T_r}\) is said to be the Julia set \(J_{T_r}\) of the function \(T_r\), i.e., \(J_{T_r} = \partial F_{T_r}\).

In 1975, Mandelbrot [27] defined the Mandelbrot set as follows:

Definition 2.2

(Mandelbrot set [8]) The collection of all complex numbers \(r \in {\mathbb {C}}\) for which the filled Julia set \(F_{T_r}\) remains connected is known as Mandelbrot set M, i.e.,

$$\begin{aligned} M = \{ r \in {\mathbb {C}}: F_{T_r} \text { is connected} \}. \end{aligned}$$
(2)

Equivalently,

$$\begin{aligned} M = \{ r \in {\mathbb {C}}: |T_{r}^j(0)| \not \rightarrow \infty \}. \end{aligned}$$
(3)

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:{\mathbb {C}}\rightarrow {\mathbb {C}}\) be a complex map. For an initial point \(z_{0}\in {\mathbb {C}}\), consider the following sequence \(\{z_{j}\}\) of iterates

$$\begin{aligned} z_{j + 1} = \alpha _{j} g(z_{j}) + (1 - \alpha _{j}) T(z_{j}), ~~~~ \quad j \ge 0, \end{aligned}$$
(4)

where \(\alpha _{j} \in (0, 1)\) and \(g: {\mathbb {C}} \rightarrow {\mathbb {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 \in {\mathbb {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} \in {\mathbb {C}}\), the sequence \(\{z_{j}\}\) generated by

$$\begin{aligned} z_{j+1}= & {} J_{\rho _{j}}^{B_{1}}T_{k}^{j}T_{k-1}^{j}\cdots T_{1}^{j}y_{j},\nonumber \\ y_{j}= & {} \alpha _{j} g(z_{j}) + (1 - \alpha _{j}) J_{\mu _{j}}^{B_{2}}V_{j}z_{j}, \quad j \ge 0, \end{aligned}$$
(5)

where g is a contraction, \(V_{j}=(1-\beta _{j})I+\beta _{j} V\)\(T_{i}^{j}=(1-\gamma _{j}^{i})I+\gamma _{j}^{i}T_{i}\) for \(i=1,2, \cdots , k\) with \(\alpha _{j},\beta _{j},\gamma _{j}^{i} \in (0,1)\), the resolvent operators \(J_{\rho _{j}}^{B_{1}}=(I+\rho _{j}B_{1})^{-1}\) and \(J_{\mu _{j}}^{B_{2}}=(I+\mu _{j}B_{2})^{-1}\) are associated with monotone operators \(B_{1}\) and \(B_{2}\), respectively, with \(\rho _{j}, \mu _{j}\in (0,\infty )\).

3 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.,

$$\begin{aligned} T(z) = z^n + p z + r, \end{aligned}$$
(6)

where \(n \ge 2\) and \(p, r \in {\mathbb {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 \(\alpha _j = \alpha \), \(\beta _j = \beta \), \(\gamma _{j}^{1} = \gamma \), \(\rho _j = \rho \), \(\mu _j = \mu \), where \(\alpha , \beta , \gamma \in (0, 1)\) and \(\rho , \mu \in (0, \infty )\). Moreover, let us assume that \(g(z) = a z+b \) is a complex contraction with \(a, b \in {\mathbb {C}}\) and \(|a| < 1\), and that \(B_{1}(z)=m z\) and \(B_{2}(z)=qz\), where \(m, q \in {\mathbb {R}}\). Thus, \(J_{\rho }^{B_{1}}(z)=\frac{z}{1+m\rho }\) and \(J_{\mu }^{B_{2}}(z)=\frac{z}{1+q\mu }\). Also, let \(T_{1} = V = T\) where T is given in (6). For such parameters the iteration (5) takes the following form:

$$\begin{aligned} z_{j+1}= & {} J_{\rho }^{B_1} T_{\gamma } y_j, \nonumber \\ y_j= & {} \alpha g(z_j) + (1 - \alpha ) J_{\mu }^{B_2} V_{\beta } z_j, \end{aligned}$$
(7)

where

$$\begin{aligned} T_{\gamma }&= (1 - \gamma ) I + \gamma T, \nonumber \\ V_{\beta }&= (1 - \beta ) I + \beta T. \end{aligned}$$
(8)

Theorem 3.1

Let \( |z_{0}|\ge \max \{ |r|, |b|\}>\max \big \{ \big (\frac{(1+\alpha (1+|a|))|1+q \mu | + (1-\alpha )(1+\beta |p|)}{\beta (1-\alpha )}\big )^{\frac{1}{n-1}}, \big (\frac{|1+m \rho |+1+\gamma |p|}{\gamma }\big )^{\frac{1}{n-1}}\big \}\). Then \(|z_j| \rightarrow \infty \) as \(j \rightarrow \infty \) where \(\{z_{j}\}\) is defined in (7).

Proof

From the construction of \(V_{\beta }\), we have

$$\begin{aligned} |V_{\beta } z_{j}|=|((1-\beta )I + \beta T)z_{j}|, ~~~j\ge 0. \end{aligned}$$

For \(j = 0\), we have

$$\begin{aligned} |V_{\beta } z_{0}|= & {} |((1-\beta )I + \beta T)z_{0}| \\= & {} |(1-\beta )z_{0} + \beta T z_{0}|\\= & {} |(1-\beta )z_{0}+\beta ({z_{0}}^{n}+p z_{0}+r)| \\\ge & {} |\beta z_{0}^{n}+\beta p z_{0}+\beta r|-|(1-\beta )z_{0}|\\\ge & {} \beta |z_{0}^{n}|-\beta |p||z_{0}|-\beta |r|-(1-\beta )|z_{0}|. \end{aligned}$$

The assumption \(|z_{0}|\ge \max \{|r|,|b|\}\) implies \(-|r|\ge -|z_{0}|\), therefore, we obtain

$$\begin{aligned} |V_{\beta } z_{0}|\ge & {} \beta |z_{0}^{n}|-\beta |p||z_{0}|-\beta |z_{0}|-(1-\beta )|z_{0}| \\= & {} \beta |z_{0}^{n}|-\beta |p||z_{0}|-|z_{0}| \\= & {} |z_{0}|(\beta |z_{0}|^{n-1}- (1+\beta |p|)). \end{aligned}$$

Thus,

$$\begin{aligned} |V_{\beta } z_{0}| \ge |z_{0}|(\beta |z_{0}|^{n-1}- (1+\beta |p|)). \end{aligned}$$
(9)

From (7), consider

$$\begin{aligned} |y_{0}|= & {} |\alpha g(z_{0})+(1- \alpha )J_{\mu }^{B_{2}}(V_{\beta } z_{0})| \\= & {} \left| \alpha (a z_{0}+b)+(1- \alpha ) \frac{V_{\beta }z_{0}}{1 + q\mu } \right| \\\ge & {} (1 - \alpha ) \left| \frac{V_{\beta } z_{0}}{1 + q\mu } \right| - \alpha |a z_{0}| - \alpha |b|. \\ \end{aligned}$$

The assumption \(|z_{0}|\ge \max \{|r|,|b|\}\) yields \(-|b|\ge -|z_{0}|\), therefore, we have

$$\begin{aligned} |y_{0}| \ge (1 - \alpha ) \frac{|V_{\beta }z_{0}|}{|1 + q\mu |}-\alpha |a| |z_{0}|-\alpha |z_{0}|. \end{aligned}$$

Using (9), we get

$$\begin{aligned} |y_{0}|\ge & {} (1- \alpha ) \frac{|z_{0}|(\beta |z_{0}|^{n-1}-(1+\beta |p|))}{|1+q\mu |}-\alpha (1+|a|)|z_{0}| \\= & {} |z_{0}| \left( \frac{(1- \alpha ) \beta |z_{0}|^{n-1}-(1-\alpha )(1+\beta |p|)}{|1+q\mu |}-\alpha (1+|a|) \right) . \end{aligned}$$

Thus, we have

$$\begin{aligned} |y_{0}| \ge |z_{0}| \left( \frac{(1- \alpha ) \beta |z_{0}|^{n-1}-(1-\alpha )(1+\beta |p|)}{|1+q\mu |}-\alpha (1+|a|) \right) . \end{aligned}$$
(10)

Our assumption \(|z_{0}| > \left( \frac{(1 + \alpha (1+|a|)) |1 + q \mu | + (1-\alpha )(1+\beta |p|)}{\beta (1-\alpha )}\right) ^{\frac{1}{n-1}}\) gives

$$\begin{aligned} \frac{(1- \alpha ) \beta |z_{0}|^{n-1}-(1-\alpha )(1+\beta |p|)}{|1+q\mu |}-\alpha (|a| +1)>1. \end{aligned}$$
(11)

Using (11) in (10), we obtain

$$\begin{aligned} |y_{0}| > |z_{0}|. \end{aligned}$$
(12)

Now, from the construction of \(T_{\gamma }\), we have

$$\begin{aligned} T_{\gamma }(y_{j})= & {} ((1-\gamma )I+\gamma T)y_{j} \\= & {} (1-\gamma )y_{j}+\gamma T(y_{j}) \\= & {} (1-\gamma )y_{j}+\gamma (y_{j}^{n}+p y_{j}+r). \end{aligned}$$

Therefore,

$$\begin{aligned} T_{\gamma }(y_{j}) = (1 - \gamma )y_{j} + \gamma (y_{j}^{n} + p y_{j} + r). \end{aligned}$$
(13)

Further, from (7), consider

$$\begin{aligned} |z_{1}|=|J_{\rho }^{B_{1}}T_{\gamma }(y_{0})|. \end{aligned}$$

From (13), we have

$$\begin{aligned} |z_{1}|= & {} |J_{\rho }^{B_{1}} ((1-\gamma )y_{0}+\gamma (y_{0}^{n}+p y_{0}+r))| \\= & {} \left| \frac{(1-\gamma )y_{0}+\gamma (y_{0}^{n}+p y_{0}+r)}{1 + m\rho } \right| \\\ge & {} \frac{|\gamma (y_{0}^{n}+p y_{0}+r)|-(1-\gamma )|y_{0}|}{|1+m\rho |}\\\ge & {} \frac{\gamma |y_{0}^{n}|-\gamma |p| |y_{0}|-\gamma |r|-(1-\gamma )|y_{0}|}{|1+m\rho |}\\\ge & {} \frac{\gamma |y_{0}^{n}|-\gamma |p| |y_{0}|-\gamma |z_{0}|-(1-\gamma )|y_{0}|}{|1+m\rho |}\\= & {} \frac{|y_{0}|(\gamma |y_{0}^{n-1}|-\gamma |p|-(1-\gamma )) -\gamma |z_{0}|}{|1+m\rho |}. \end{aligned}$$

Now, from (12), we obtain

$$\begin{aligned} |z_{1}|> & {} \frac{|z_{0}|(\gamma |z_{0}^{n-1}|-\gamma |p|-1+\gamma ) -\gamma |z_{0}|}{|1+m\rho |} \\= & {} |z_{0}| \frac{(\gamma |z_{0}^{n-1}|-\gamma |p|-1)}{|1+m\rho |}. \end{aligned}$$

This gives

$$\begin{aligned} |z_{1}| > |z_{0}|\frac{(\gamma |z_{0}^{n-1}|-\gamma |p|-1)}{|1+m\rho |}. \end{aligned}$$
(14)

Our assumption \(|z_{0}| > \left( \frac{|1+m \rho |+1+\gamma |p|}{\gamma }\right) ^{\frac{1}{n-1}}\) gives

$$\begin{aligned} \frac{\gamma |z_{0}^{n-1}|-\gamma |p| - 1}{|1+m\rho |}>1. \end{aligned}$$
(15)

Thus, there exists a real number \(\lambda >0\) such that

$$\begin{aligned} \frac{\gamma |z_{0}^{n-1}|-\gamma |p| - 1 }{|1+m\rho |}> \lambda +1 >1. \end{aligned}$$
(16)

Using (16) in (14), we have

$$\begin{aligned} |z_{1}| > (\lambda +1)\ |z_{0}|. \end{aligned}$$

In particular \(|z_1| > |z_0|\), so we may apply the same argument repeatedly to obtain

$$\begin{aligned} |z_{j}|>(\lambda +1)^{j}|z_{0}|. \end{aligned}$$

Hence, \(|z_{j}| \rightarrow \infty \) as \(j \rightarrow \infty \). \(\square \)

We obtain the following corollary as a refinement of Theorem 3.1:

Corollary 3.2

Let

$$\begin{aligned}&|z_{0}|>\max \left\{ |r|,|b|, \left( \frac{(1 + \alpha (1 + |a|)) |1 + q \mu | + (1 - \alpha )(1 + \beta |p|)}{\beta (1 - \alpha )}\right) ^{\frac{1}{n - 1}}, \right. \nonumber \\&\qquad \qquad \qquad \left. \left( \frac{|1 + m \rho | + 1 + \gamma |p|}{\gamma } \right) ^{\frac{1}{n - 1}} \right\} , \end{aligned}$$
(17)

then \(|z_j| \rightarrow \infty \) as \( j\rightarrow \infty . \)

Corollary 3.3

Suppose that:

$$\begin{aligned}&|z_{k}|>\max \left\{ |r|,|b|, \left( \frac{(1 + \alpha (1 + |a|)) |1 + q \mu | + (1 - \alpha )(1 + \beta |p|)}{\beta (1 - \alpha )}\right) ^{\frac{1}{n - 1}}, \right. \nonumber \\&\qquad \qquad \qquad \left. \left( \frac{|1 + m \rho | + 1 + \gamma |p|}{\gamma } \right) ^{\frac{1}{n - 1}} \right\} , \end{aligned}$$
(18)

for some \(k \ge 0\). Then, there exists \(\lambda > 0\) such that \(|z_{k+j}| > (1 + \lambda )^j |z_k|\) and we have \(|z_j| \rightarrow \infty \) as \(j \rightarrow \infty \).

4 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} + p z + r\), where \(n\ge 2\) and \(p,~r\in {\mathbb {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:

$$\begin{aligned} R= & {} \max \left\{ |r|,|b|, \left( \frac{(1+\alpha (1+|a|))(|1+q \mu |)+(1-\alpha )(1+\beta |p|)}{\beta (1-\alpha )}\right) ^{\frac{1}{n-1}},\right. \nonumber \\&\qquad \left. \left( \frac{|1+m \rho |+1+\gamma |p|}{\gamma }\right) ^{\frac{1}{n-1}}\right\} , \end{aligned}$$
(19)

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 \subset {\mathbb {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.

figure a

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 \subset {\mathbb {C}}\) using the maximal K iterations and a given colour map.

figure b

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 \times 800\) pixels, and we used \(K = 50\).

Fig. 1
figure 1

Colour map used in the graphical examples

4.1 Examples of Julia sets

In the first example, we generated Julia sets for a quadratic function. The parameters used to generate these sets were the following: \(n = 2\), \(p = 0.09 - 0.09i\), \(r = 0.02 + 0.02i\), \(A = [-5.3, 3.7] \times [-4.5, 4.5]\), \(K = 50\), \(g(z) = 0.85 z + 2.07 - 6.92i\), \(m = 0.52\), \(q = 0.75\), \(\rho = 0.45\), \(\mu = 0.27\). In the example, we divided the images into three groups. In each group, we fix two parameters from \(\alpha , \beta , \gamma \) and vary the remaining one. In Fig. 2, we see images generated for fixed \(\beta = 0.89\), \(\gamma = 0.11\), and varying \(\alpha \): (a) 0.11, (b) 0.35, (c) 0.6. In Fig. 3, we fixed \(\alpha = 0.56\), \(\gamma = 0.44\) and varied \(\beta \): (a) 0.25, (b) 0.5, (c) 0.85. Finally, in Fig. 4, the images were generated for fixed \(\alpha = 0.33\), \(\beta = 0.67\) and varying \(\gamma \): (a) 0.2, (b) 0.55, (c) 0.85. 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.

Fig. 2
figure 2

Julia set for \(n = 2\), \(p = 0.09 - 0.09i\), \(r = 0.02 + 0.02i\) generated via (7) with \(\beta = 0.89\), \(\gamma = 0.11\) and varying \(\alpha \)

Fig. 3
figure 3

Julia set for \(n = 2\), \(p = 0.09 - 0.09i\), \(r = 0.02 + 0.02i\) generated via (7) with \(\alpha = 0.56\), \(\gamma = 0.44\) and varying \(\beta \)

Fig. 4
figure 4

Julia set for \(n = 2\), \(p = 0.09 - 0.09i\), \(r = 0.02 + 0.02i\) generated via (7) with \(\alpha = 0.33\), \(\beta = 0.67\) and varying \(\gamma \)

Fig. 5
figure 5

Julia set for \(n = 4\), \(p = -3.45 - 0.01i\), \(r = -0.01 - 0.01i\) generated via (7) with \(\beta = 0.67\), \(\gamma = 0.67\) and varying \(\alpha \)

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 = -3.45 - 0.01i\), \(r = -0.01 - 0.01i\), \(A = [-2.5, 2.5]^2\), \(K = 50\), \(g(z) = (-0.37 + 0.37i) z - 0.01 + 0.01i\), \(m = 0.13\), \(q = 0.61\), \(\rho = 0.54\), \(\mu = 1.12\). Like in the first example, the images are divided into three groups according to the varying parameter. In Fig. 5, we fixed \(\beta = 0.67\), \(\gamma = 0.67\) and vary the value of \(\alpha \): (a) 0.14, (b) 0.65, (c) 0.9. The values of \(\alpha \) and \(\gamma \) were fixed in Fig. 6, where \(\alpha = 0.33\), \(\gamma = 0.44\), and the values of \(\beta \) were the following: (a) 0.5, (b) 0.79, (c) 0.9. In the last figure in this example – Fig. 7 – we fixed \(\alpha = 0.89\), \(\beta = 0.67\) and varied \(\gamma \): (a) 0.45, (b) 0.67, (c) 0.95. In Fig. 5, we see that the generated Julia set becomes bigger and more complex with the increase in the value of \(\alpha \), whereas in Figs. 6, 7, we see an opposite tendency. The parameters also have influence on the symmetry of the sets. In most of the cases the sets have a rotational symmetry, but for some values of the parameters the symmetry is broken, see, for instance, Figs. 5c or 6b.

Fig. 6
figure 6

Julia set for \(n = 4\), \(p = -3.45 - 0.01i\), \(r = -0.01 - 0.01i\) generated via (7) with \(\alpha = 0.33\), \(\gamma = 0.44\) and varying \(\beta \)

Fig. 7
figure 7

Julia set for \(n = 4\), \(p = -3.45 - 0.01i\), \(r = -0.01 - 0.01i\) generated via (7) with \(\alpha = 0.89\), \(\beta = 0.67\) and varying \(\gamma \)

The shape of the set, except for the iteration parameters (\(\alpha \), \(\beta \), \(\gamma \)), 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 \(\alpha \), \(\beta \), \(\gamma \), but with various values of p. For the quadratic Julia set, we used \(\alpha = 0.33\), \(\beta = 0.67\), \(\gamma = 0.35\), whereas for the fourth order function we used \(\alpha = 0.45\), \(\beta = 0.65\), \(\gamma = 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.

Fig. 8
figure 8

Julia set for \(n = 2\), \(r = 0.02 + 0.02i\), \(\alpha = 0.33\), \(\beta = 0.67\), \(\gamma = 0.35\) generated via (7) with varying p

Fig. 9
figure 9

Julia set for \(n = 4\), \(r = -0.01 - 0.01i\), \(\alpha = 0.45\), \(\beta = 0.65\), \(\gamma = 0.56\) generated via (7) with varying p

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:

  1. (a)

    \(n = 3\), \(p = 4.89 - 0.2i\), \(r = 0.09 - 2.91i\), \(A = [-3, 3]^2\), \(K = 50\), \(g(z) = 0.58 z - 0.02 + 2.4i\), \(m = 0.65\), \(q = 0.75\), \(\rho = 0.45\), \(\mu = 2.05\), \(\alpha = 0.01\), \(\beta = 0.5\), \(\gamma = 0.36\),

  2. (b)

    \(n = 5\), \(p = 4.9 - 0.2i\), \(r = 0.09 - 0.09i\), \(A = [-2, 2]^2\), \(K = 50\), \(g(z) = (0.3 + 0.01i) z - 0.02 + 0.04i\), \(m = 0.95\), \(q = 0.95\), \(\rho = 0.45\), \(\mu = 1.05\), \(\alpha = 0.76\), \(\beta = 0.45\), \(\gamma = 0.67\),

  3. (c)

    \(n = 10\), \(p = -5.54 - 0.02i\), \(r = 0.02 - 0.09i\), \(A = [-1.25, 1.25]^2\), \(K = 50\), \(g(z) = (0.04 - 0.2i) z - 0.01 + 0.02i\), \(m = 0.41\), \(q = 0.86\), \(\rho = 1.85\), \(\mu = 0.62\), \(\alpha = 0.45\), \(\beta = 0.75\), \(\gamma = 0.36\).

Fig. 10
figure 10

Various Julia sets generated via (7)

Fig. 11
figure 11

Mandelbrot set for \(n = 2\), \(p = 4.62 - 0.002i\) generated via (7) with \(\beta = 0.56\), \(\gamma = 0.78\) and varying \(\alpha \)

4.2 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] \times [-5, 5]\), \(K = 50\), \(g(z) = 0.5 z + 0.01 + 0.02i\), \(m = 0.7\), \(q = 0.01\), \(\rho = 0.05\), \(\mu = 0.62\). In the example, we divided the images into three groups. In each group, we fix two parameters from \(\alpha , \beta , \gamma \) and vary the remaining one. In Fig. 11, we see images generated for fixed \(\beta = 0.56\), \(\gamma = 0.78\), and varying \(\alpha \): (a) 0.2, (b) 0.6, (c) 0.78. In Fig. 12, we fixed \(\alpha = 0.33\), \(\gamma = 0.11\) and varied \(\beta \): (a) 0.4, (b) 0.6, (c) 0.9. Finally, in Fig. 13, the images were generated for fixed \(\alpha = 0.78\), \(\beta = 0.67\) and varying \(\gamma \): (a) 0.4, (b) 0.65, (c) 0.9. From the figures, we see that the three parameters have a great impact on the size of the generated Mandelbrot set. In Fig. 11, the set grows when \(\alpha \) increases, whereas in Figs. 12 and 13, the set grows when \(\beta \) or \(\gamma \) 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.

Fig. 12
figure 12

Mandelbrot set for \(n = 2\), \(p = 4.62 - 0.002i\) generated via (7) with \(\alpha = 0.33\), \(\gamma = 0.11\) and varying \(\beta \)

Fig. 13
figure 13

Mandelbrot set for \(n = 2\), \(p = 4.62 - 0.002i\) generated via (7) with \(\alpha = 0.78\), \(\beta = 0.67\) and varying \(\gamma \)

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\), \(p = 3.4 + 0.01i\), \(A = [-2, 2]^2\), \(K = 50\), \(g(z) = (0.3 + 0.37i) z + 0.1 + 0.1i\), \(m = 0.21\), \(q = 0.91\), \(\rho = 1.44\), \(\mu = 0.72\). Like in the first example, the images are divided into three groups according to the varying parameter. In Fig. 14, we fixed \(\beta = 0.56\), \(\gamma = 0.44\) and varied the value of \(\alpha \): (a) 0.25, (b) 0.5, (c) 0.75. The values of \(\alpha \) and \(\gamma \) were fixed in Fig. 15, where \(\alpha = 0.11\), \(\gamma = 0.33\), and the values of \(\beta \) were the following: (a) 0.2, (b) 0.5, (c) 0.8. In the last figure in this example – Fig. 16 – we fixed \(\alpha = 0.56\), \(\beta = 0.33\) and varied \(\gamma \): (a) 0.25, (b) 0.45, (c) 0.85. In the three figures, we see that each of the three parameters has a great impact not only on the shape, like in all the previous examples, but also on the symmetry. Most of the presented sets do not possess symmetry, but there is one example of a set with rotational symmetry, see Fig. 15a. Moreover, we can notice that the shape changes in a very irregular way.

Fig. 14
figure 14

Mandelbrot set for \(n = 5\), \(p = 3.4 + 0.01i\) generated via (7) with \(\beta = 0.56\), \(\gamma = 0.44\) and varying \(\alpha \)

Fig. 15
figure 15

Mandelbrot set for \(n = 5\), \(p = 3.4 + 0.01i\) generated via (7) with \(\alpha = 0.11\), \(\gamma = 0.33\) and varying \(\beta \)

Fig. 16
figure 16

Mandelbrot set for \(n = 5\), \(p = 3.4 + 0.01i\) generated via (7) with \(\alpha = 0.56\), \(\beta = 0.33\) and varying \(\gamma \)

Similarly, as in the case of the Julia sets, we can change the shape of the Mandelbrot set by changing the value of p in \(T_r\). To show this effect, we generated Mandelbrot sets for fixed values of \(\alpha \), \(\beta \) and \(\gamma \) and various values of p. For the quadratic Mandelbrot set, we used \(\alpha = 0.78\), \(\beta = 0.56\), \(\gamma = 0.78\), whereas for the fifth order function \(\alpha = 0.15\), \(\beta = 0.91\) and \(\gamma = 0.01\). Figures 17, 18 present the obtained images of Mandelbrot sets in the quadratic 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.

Fig. 17
figure 17

Mandelbrot set for \(n = 2\), \(\alpha = 0.78\), \(\beta = 0.56\), \(\gamma = 0.78\) generated via (7) with varying p

Fig. 18
figure 18

Mandelbrot set for \(n = 5\), \(\alpha = 0.15\), \(\beta = 0.91\), \(\gamma = 0.01\) generated via (7) with varying p

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:

  1. (a)

    \(n = 4\), \(p = -3.04 - 0.01i\), \(A = [-1.6, 1.6]^2\), \(K = 50\), \(g(z) = (0.3 - 0.17i) z + 0.01 - 0.09i\), \(m = 0.05\), \(q = 0.51\), \(\rho = 0.64\), \(\mu = 1.42\), \(\alpha = 0.15\), \(\beta = 0.65\), \(\gamma = 0.56\),

  2. (b)

    \(n = 10\), \(p = -5.54 - 0.02i\), \(A = [-1.4, 1.4]^2\), \(K = 50\), \(g(z) = (0.02 - 0.8i) z + 0.01 + 0.02i\), \(m = 0.41\), \(q = 0.86\), \(\rho = 1.85\), \(\mu = 0.62\), \(\alpha = 0.45\), \(\beta = 0.75\), \(\gamma = 0.36\),

  3. (c)

    \(n = 15\), \(p = -2.97 - 0.01i\), \(A = [-1.2, 1.2]^2\), \(K = 50\), \(g(z) = (0.05 - 0.05i) z + 0.01 - 0.01i\), \(m = 0.05\), \(q = 0.51\), \(\rho = 0.54\), \(\mu = 1.42\), \(\alpha = 0.15\), \(\beta = 0.65\), \(\gamma = 0.59\).

Fig. 19
figure 19

Various Mandelbrot sets generated via (7)

5 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 \(\alpha , \beta , \gamma \). 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].