An algorithm since the vector approach in Mathematica to generate the Von Koch curve and islands in a general way Segundo B. Correa-Erazo1 , Ricardo Velezmoro-Leรณn1 and Robert Ipanaquรฉ-Chero1 1 Universidad Nacional de Piura, Urbanizaciรณn Miraflores s/n, Piura, Perรบ Abstract In this paper, the Von Koch curve is generated in a general way from a vector approach without using the classic system of iterated functions. This approach also allows constructing different Koch islands based on any regular polygon; to do this, a Koch curve is drawn on each of the sides of the regular polygon, taking into account that if the vertices of the polygon are traversed counterclockwise, An island will be generated inside the polygon, but if the vertices are traversed clockwise, an island outside the polygon will be developed. Given the versatility of the method, an interior island and an exterior island are also united, giving origin to a new fractal. To visualize the results, Mathematica scientific software was used. Keywords Von Koch curve, Von Koch Island, algorithm, new focus 1. Introduction The system of iterated functions that generates the classical Von Koch curve is given by: ๐‘†1 (๐‘ฅ, ๐‘ฆ) = ( 13 ๐‘ฅ, 13 ๐‘ฆ) โŽง โŽช โŽช โŽช โŽช โˆš โˆš โŽช โŽช โŽจ ๐‘†2 (๐‘ฅ, ๐‘ฆ) = ( 16 ๐‘ฅ โˆ’ 63 ๐‘ฆ + 31 , 63 ๐‘ฅ + 16 ๐‘ฆ) โŽช โŽช โŽช โˆš โˆš โˆš 1 3 1 3 1 3 โŽช โŽช โŽช โŽช โŽช ๐‘† 3 (๐‘ฅ, ๐‘ฆ) = ( 6 ๐‘ฅ + 6 ๐‘ฆ + 2 , โˆ’ 6 ๐‘ฅ + 6 ๐‘ฆ + 6 ) โŽช โŽช โŽช โŽช ๐‘†4 (๐‘ฅ, ๐‘ฆ) = ( 13 ๐‘ฅ + 23 , 13 ๐‘ฆ) โŽฉ It has the limitation of using the segment whose ends are {(0, 0), (1, 0)} and, when applied to any pair of points in the plane, converges towards the classical Koch curve [1]. This is 4 due to the action of Banachโ€™s fixed point theorem, since the operator ๐‘†(๐ด) = ๐‘†๐‘– (๐ด) is a โ‹ƒ๏ธ€ ๐‘–=1 CISETC 2023: International Congress on Education and Technology in Sciences, December 04โ€“06, 2023, Zacatecas, Mรฉxico $ scorreae@unp.edu.pe (S. B. Correa-Erazo); rvelezmorol@unp.edu.pe (R. Velezmoro-Leรณn); ripanaquec@unp.edu.pe (R. Ipanaquรฉ-Chero) ย€ https://www.unp.edu.pe/pers/ripanaque (R. Ipanaquรฉ-Chero)  0000-0002-0147-2048 (S. B. Correa-Erazo); 0000-0002-2582-8264 (R. Velezmoro-Leรณn); 0000-0002-3873-6780 (R. Ipanaquรฉ-Chero) ยฉ 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings (a) Start. (b) First iteration. (c) second iteration. (d) Fourth iteration. (e) Seventh iteration. Figure 1: Convergence towards the operatorโ€™s fixed point. Table 1 Convergence of the evaluation of the transformations ๐‘†1 and ๐‘†4 of the classical Con Koch curve. Iteration ๐‘†1 ๐‘†4 Start (2, 3) (2, 3) 1 (0 ยท 666667, 1.) (1 ยท 66667, 0 ยท 666667) 2 (0 ยท 222222, 0 ยท 333333) (1 ยท 22222, 0 ยท 222222) 3 (0 ยท 0740741, 0 ยท 111111) (1 ยท 07407, 0 ยท 0740741) 4 (0 ยท 0246914, 0 ยท 037037) (1 ยท 02469, 0 ยท 0246914) 5 (0 ยท 00823045, 0 ยท 0123457) (1 ยท 00823, 0 ยท 00823045) 6 (0 ยท 00274348, 0 ยท 00411523) (1 ยท 00274, 0 ยท 00274348) 7 (0 ยท 000914495, 0 ยท 00137174) (1 ยท 00091, 0 ยท 000914495) 8 (0 ยท 000304832, 0 ยท 000457247) (1 ยท 0003, 0 ยท 000304832) 9 (0 ยท 000101611, 0 ยท 000152416) (1 ยท 0001, 0 ยท 000101611) 10 (0 ยท 0000338702, 0 ยท 0000508053) (1 ยท 00003, 0 ยท 0000338702) contractive operator with the Hausdorff metric and has a single fixed point [2]. This means that if we take any arbitrary ends segment of the plane and apply the above IFS to it, is obtained as a final result the classic Von Koch curve as can be seen in the figure 1. As described above, numerically, it can be observed that effectively when evaluating the transformations ๐‘†1 , ๐‘†2 , ๐‘†3 and ๐‘†4 starting at any pair of points in the plane, the values converge to the points of the classical Von Koch curve defined in the interval [0, 1]. In table 1 it can be seen that if we recursively evaluate the transformations ๐‘†1 and ๐‘†4 at the point (2, 3) using ten iterations, the first transformation converges to (0, 0), while ๐‘†4 does so towards (1, 0) which are the extremes of the classical Von Koch curve. The big question is how to generate the Von Koch curve by taking a segment with arbitrary ends {๐‘ƒ, ๐‘„} of the plane. We want the Koch curve obtained to be located on the segment Figure 2: Transformations that generate the Von Koch curve. ๐‘ƒ ๐‘„. The interest in searching for different variants of the Von-Koch curve is because there are exciting applications in the field of communications because, due to its shape, multiple resonances can be obtained when the angle is modified from 600 to a different one [3]. In this article, an algorithm is built to generate the Von Koch curve generally based on three operations, obtaining the five necessary points to develop the first iteration. This algorithm has the power to draw the Koch curve on any segment of the plane that is taken; in addition, it allows the generation of Koch islands based on any regular polygon, and the versatility of the algorithm offers the possibility of generating an island inside the polygon and another outside the polygon depending on whether the vertices are taken in a counterclockwise and clockwise direction respectively. 2. Mathematical and computational foundations 2.1. About the Von Koch curve classical The Von Koch curve classical is obtained from the following description algorithm [4]: โ€ข step 1: In the first iteration, we divide the unit segment into three equal parts; โ€ข Step 2: Above the central part, we build an equilateral triangle; โ€ข Step 3: Now, we eliminate the base of the triangle, thus obtaining four segments of length 13 ; that is, the length of the curve is now 43 ; โ€ข Step 4: For the second iteration, we construct equilateral triangles in each of the four segments and apply step 3. From this algorithm, the four transformations are obtained using the scheme in figure 2: The first transformation contracts the segment of length one to its third part; that is to say, ๐‘†1 (๐‘ฅ, ๐‘ฆ) = 3 ๐‘ฅ, 3 ๐‘ฆ (๏ธ€. To )๏ธ€obtain the second transformation rotate ๐‘†1 an angle of 600 and we (๏ธ€ 1 1 )๏ธ€ move it to the point 13 , 0 . Therefore: โŽž โŽ›1 โŽž โŽ›1โŽž โŽ›1 โˆš โŽž 3 1 cos(600 ) โˆ’ sin(600 ) โŽ› 3 ๐‘ฅ 3 6 ๐‘ฅ โˆ’ 6 ๐‘ฆ + 3โŽŸ ๐‘†2 (๐‘ฅ, ๐‘ฆ) = โŽ โŽ .โŽ โŽ  + โŽ โŽ  = โŽœ โŽ โˆš โŽ  1 sin(600 ) cos(600 ) 3 ๐‘ฆ 0 3 ๐‘ฅ + 1 ๐‘ฆ 6 6 Similarly, to determine (๏ธ the transformation ๐‘†3 we must rotate ๐‘†1 an angle of โˆ’600 and โˆš )๏ธ translate it to the point 12 , 63 . Therefore: โŽž โŽ›1 โŽž โŽ› 1 โŽž โŽ› 1 โˆš โŽž 3 1 cos(โˆ’600 ) โˆ’ sin(โˆ’600 ) โŽ› 3 ๐‘ฅ 2 6 ๐‘ฅ + 6 ๐‘ฆ + 2 โŽŸ ๐‘†3 (๐‘ฅ, ๐‘ฆ) = โŽ โŽ .โŽ โŽ  + โŽ โŽ  = โŽœ โˆš โŽ โˆš โˆš โŽ  1 sin(โˆ’600 ) cos(โˆ’600 ) 3 ๐‘ฆ 6 3 โˆ’ ๐‘ฅ+ ๐‘ฆ+ 3 3 1 6 6 6 Finally the transformation is a translation from to the point ; that is to say )๏ธ€ (๏ธ€ 2 ๐‘†4 ๐‘† 1 3 , 0 ๐‘†4 (๐‘ฅ, ๐‘ฆ) = 3 ๐‘ฅ + 3 , 3 ๐‘ฆ . (๏ธ€ 1 2 1 )๏ธ€ Among the peculiarities of this curve is that it has infinite length because if we calculate its length in stages, it has that in the first stage, its length will be(๏ธ€ ๐ฟ)๏ธ€1 = 4( 31 ), in the second stage is ๐‘› have ๐ฟ2 = 16( 91 ); and in the ๐‘›โˆ’th iteration it result ๐ฟ๐‘› = 43 . Therefore, the length of the Von Koch curve will be: (๏ธ‚ )๏ธ‚๐‘› 4 lim =โˆž ๐‘›โ†’โˆž 3 On the other hand, it is a continuous curve everywhere but differentiable in none of them [5] since it has a corner at each of its points and can be used as an example in the classroom of the differential calculus course to explain the characteristics of a curve that is not differentiable at any of its points. When a cognitive conflict is created when explaining differentiability, a test is offered in [6]. Its dimension is calculated using the formula: log ๐‘› dim = log 1๐‘  (๏ธ€ )๏ธ€ Where ๐‘› is the number of boxes with which the curve is covered and ๐‘  is the scale that, in this case, will be 13 . Therefore the dimension of the Von Koch curve will be dim = log (๏ธ‚ 4 )๏ธ‚ = 1 ยท 26186 [3] and can be interpreted as a dimension of capacity; That is, the 1 log 1 3 Koch curve has a capacity of 1 ยท 26186 to occupy the space R2 . One of the variants offered by the Koch curve is that a significant mathematical curve called a snowflake or Koch island can be constructed from it. This curve has acquired a lot of importance because it is being used as an antenna in wireless communications [7] in antennas for satellites [8]. It is constructed by starting with an equilateral triangle, removing the inner third of each side, making another equilateral triangle where the side was removed, and then repeating the process indefinitely [9]. The different stages of the construction are shown in the figure 3. In the same way, the snowflake can be generated starting with a square and, in general, from any polygon. This range of possibilities leads us to think of an algorithm that is simple to handle, given that if we use a system of iterated functions, twelve transformations would be needed when we start with a triangle. In the case of starting with a square sixteen and generally for a polygon with ๐‘› sides, 4๐‘› transformations with ๐‘› โ‰ฅ 3 are required. (a) Start. (b) First iteration. (c) Second iteration. (d) Third iteration. Figure 3: Construction of the Koch snowflake. Figure 4: Graph obtained with the first variant. 2.2. Standard Mathematica tools for generating the Von Koch curve classical Mathematica incorporates the KochCurve function to generate the Von Koch curve classical. The variants of this function are: KochCurve[๐‘›] which gives the line segments representing the ๐‘›(๐‘กโ„Ž) -step Koch curve, KochCurve[๐‘›, {๐œƒ1 , ๐œƒ2 , . . .}] which takes a series of steps of unit length at successive relative angles ๐œƒ๐‘– , and KochCurve[๐‘›, {{๐‘Ÿ1 , ๐œƒ1 }, {๐‘Ÿ2 , ๐œƒ2 }, . . .}] which takes successive steps of lengths proportional to ๐‘Ÿ๐‘– . Below are examples for each variant. In[1]:= Graphics[KochCurve[3]] Out[1]:= See figure 4. In[2]:= Graphics[KochCurve[3,{0,85 Degree,-85 Degree, -85 Degree,85 Degree}]] Out[2]:= See figure 5. In[3]:= Graphics[KochCurve[3,{{1,0},{1,90 Degree},{1,-90 Degree}, {2,-90 Degree},{1,90 Degree},{1,90 Degree}, {1,-90 Degree}}]] Figure 5: Graph obtained with the second variant. Figure 6: Graph obtained with the third variant. Out[3]:= See figure 6. It is worth mentioning that the standard Mathematica function does not obtain the Von Koch curve in a general way as proposed in this paper. 2.3. Algorithm It is known that the IFS that generates the Koch curve has four transformations, and if we start with a segment of extremes ๐‘ƒ (๐‘1 , ๐‘2 ) and ๐‘„(๐‘ž1 , ๐‘ž2 ) when evaluating the IFS in the first iteration will be obtained 8 points; for the second 32 points; for the third 128 and so on, which would require more computational time. This algorithm consists of three operations for which 5 points are obtained in the first iteration, 20 points for the second, 80 for the third, and so on. The tools that will be used to describe the algorithm are obtained from the following analysis. Consider the scheme proposed in figure 7. The points ๐‘ƒ and ๐‘„ remain fixed, and the only thing we would need are the points ๐‘ƒ1 , ๐‘ƒ2 and ๐‘ƒ3 . Indeed: ๐‘ƒ1 is obtained through: 1 2๐‘ƒ + ๐‘„ ๐‘ƒ1 = ๐‘ƒ + (๐‘„ โˆ’ ๐‘ƒ ) โ‡’ ๐‘ƒ1 = 3 3 To get to ๐‘ƒ2 we use the complex transformation ๐ฝ : R2 โ†’ R2 defined by ๐ฝ(๐‘1 , ๐‘2 ) = (โˆ’๐‘2 , ๐‘1 ) [10], given that the segment ๐‘€ ๐‘ƒ2 is perpendicular to the segment ๐‘ƒ ๐‘„, where ๐‘€ is Figure 7: Graphic scheme for the construction of the algorithm. the midpoint of the segment ๐‘ƒ ๐‘„. Therefore: โˆš โˆš ๐‘ƒ +๐‘„ 3 ๐ฝ(๐‘„ โˆ’ ๐‘ƒ ) ๐‘ƒ +๐‘„ 3 ๐‘ƒ2 = + โ€–๐‘„ โˆ’ ๐‘ƒ โ€– โ‡’ ๐‘ƒ2 = + ๐ฝ(๐‘„ โˆ’ ๐‘ƒ ) 2 6 โ€–๐ฝ(๐‘„ โˆ’ ๐‘ƒ )โ€– 2 6 Finally: 2 ๐‘ƒ + 2๐‘„ ๐‘ƒ3 = ๐‘ƒ + (๐‘„ โˆ’ ๐‘ƒ ) โ‡’ ๐‘ƒ3 = 3 3 From this, the algorithm consists of the following steps: โ€ข step 1: To consider two arbitrarily different points of the plane; โ€ข Step 2: To calculate the points {๐‘ƒ1 , ๐‘ƒ2 , ๐‘ƒ3 } and add the points ๐‘ƒ y ๐‘„, obtaining the list {๐‘ƒ, ๐‘ƒ1 , ๐‘ƒ2 , ๐‘ƒ3 , ๐‘„}, which corresponds to the first iteration; โ€ข Step 3: Partition the previous list two by two, leaving: {{๐‘ƒ, ๐‘ƒ1 }, {๐‘ƒ1 , ๐‘ƒ2 }, {๐‘ƒ2 , ๐‘ƒ3 }, {๐‘ƒ3 , ๐‘„}} And to apply step 2 to each of the partitions; โ€ข Step 4: Re-partition the resulting list and apply step 2 again, as often as the desired iteration indicates; โ€ข Step 5: Draw the traverse from the points obtained in the required iteration; this traverse will be the Von Koch curve at the desired stage. 2.4. About code in Mathematica The coding of the above algorithm in the scientific software Mathematica is based on simple commands offered by the software [11], which are detailed below: The Flatten command removes the grouping signs corresponding to the braces from any list. For example: In[1]:= Flatten[{{2,4,6},{2,1},{8}}] Out[1]:= {2,4,6,2,1,8} The Partition command partitions a list into a set of lists according to the userโ€™s convenience. It can be two by two, three by three, etc. For example: In[2]:= Partition[{2,4,6,2,1,8},2] Out[2]:= {{2,4},{6,2},{1,8}} If in the previous entry after option 2, we add option 1; it results in a consecutive partition increasing the number of lists. This is: In[3]:= Partition[{2,4,6,2,1,8},2,1] Out[3]:= {{2,4},{4,6},{6,2},{2,1},{1,8}} Using the previous commands defined the command IniKoch as follows: Command1 In[4]:= IniKoch[P:{_,_},Q:{_,_}]:=Module[{J,PuntP1,PuntP2,PuntP3}; J[x1_,x2_]:={-x2,x1}; PuntP1[{P_,Q_}]:=(2P+Q)/3; PuntP2[{P_,Q_}]:=(P+Q)/2+(sqrt3/6)J[Q-P]; PuntP3[{P_,Q_}]:=(P+2Q)/3; {P,PuntP1[{P,Q}],PuntP2[{P,Q}],PuntP3[{P,Q}],Q}] The command IniKoch defined above has the mission of generating the five points {๐‘ƒ, ๐‘ƒ1 , ๐‘ƒ2 , ๐‘ƒ3 , ๐‘„} corresponding to the first iteration of the curve Von Koch. It should be noted that the command input corresponds to any two points of the plane {๐‘ƒ, ๐‘„} and the points {๐‘ƒ1 , ๐‘ƒ2 , ๐‘ƒ3 } are calculated based on as mentioned in the description of the algorithm. Using the IniKoch command, the KochCurveGeneral command is defined that will generate the Von Koch curve in a general way as follows: Command2 In[5]:= CurvaVonKochGeneral[P:{_,_},Q:{_,_},n_,Opts___]:=Module[{}, vk[1]:={P,Q}; vk[2]:=N[IniKoch[vk[1],6]; vk[3]:=IniKoch/@Partition[vk[2],2,1]; vk[i_]:=IniKoch/@Partition[Partition[Flatten[vk[i-1]],2],2,1]; Graphics[{Hue[color],Line[vk[n]]},Opts] To increase the variants of the Koch curve, we can think about applying the previous com- mands to the sides of a regular polygon; however, determining the vertices of a regular polygon without computational help is very laborious. This difficulty is resolved by the command in Mathematica PoliRG2P detailed below. Letโ€™s think of a point ๐ถ on the plane as the center of Figure 8: Graphic scheme for the construction of a regular polygon from the center and an arbitrary point. Figure 9: Regular hexagon formed from the center ๐ถ(0, 2) and a vertex ๐‘ƒ (3, 4). the polygon; then, from any other point ๐‘ƒ on the plane, we can construct any regular polygon using a rotation matrix as indicated in the figure 8. From this idea, the command that will generate the vertices of the regular polygon is: Command3 In[6]:= PoliRG2P[Cen:{_,_},P:{_,},nlados_]:=Module[{a,pun,Rotxy}, Rotxy[t_]:={{Cos[t],-Sin[t]},{Sin[t],Cos[t]}}; a=P-Cen; Tras[R_]:=R+Cen; pun=Table[Rotxy[t].a,{t,0,2Pi-2Pi/nlados,2Pi/nlados}]; Tras/@pun] If we execute the previous command for the points ๐ถ(0, 2) and ๐‘ƒ (3, 4) for ๐‘› = 6 is obtained: (a) Start. (b) First iteration. (c) Second iteration. (d) Fifth iteration. Figure 10: Von Koch curve with initial segment of points ๐‘ƒ (0, 1), ๐‘„(2, 0). (a) First iteration. (b) Second iteration. (c) third iteration. (d) Sixth iteration. Figure 11: Von Koch curve with initial segment of points ๐‘ƒ (2, 0), ๐‘„(0, 1). Out[6]:= {{3,4},{3/2-sqrt[3],3/2(2+sqrt[3])}, {-3/2-sqrt[3],1+3sqrt[3]/2},{-3,0},{-3/2+sqrt[3], 1-3sqrt[3]/2},{3/2+sqrt[3],3-3sqrt[3]/2}} (a) Start. (b) First iteration. (c) Second iteration. (d) Sixth iteration. Figure 12: Von Koch curve with initial segment of points ๐‘ƒ (2, 1), ๐‘„(5, 5). the which are the vertices of a regular hexagon, see figure 9. By combining commands 2 and 3, we can create a new command IslaKochGeneralInt that will draw the Koch curve internally on each side of the regular polygon. The command is defined as follows: Command4 Out[7]:= IslaKochGeneralInt[Cen:{_,_},P:{_, _},nlados_,iter_, Opts___]:= Module[{vv,ll}, vv=PoliRG2P[Cen,P,nlados]; ll=Append[vv,vv[[1]]]; Show[Table[CurvaVonKochGeneral[ll[[i]], ll[[i + 1]], iter, 0.65], i, 1,Length[ll] - 1], Axes -> True, AxesLabel -> {X,Y}] ] (a) Start. (b) First iteration. (c) Second iteration. (d) Seventh iteration. Figure 13: Interior Koch Island with an equilateral triangle with center at ๐ถ(0, 2) and vertex at ๐‘ƒ (3, 4). To draw the Koch curve externally on the sides of the polygon, we reverse the list of vertices using the Mathematica command Reverse; this will cause the command to traverse the vertices of the polygon clockwise; thus, command 4 is slightly modified by internally adding the option to invert the list, being defined as follows: Command5 Out[8]:= IslaKochGeneralExt[Cen:{_,_},P:{_, _},nlados_,iter_, Opts___]:= Module[{vv,ll}, vv=PoliRG2P[Cen,P,nlados]; vvr= Reverse[vv]; ll=Append[vvr,vvr[[1]]]; Show[Table[CurvaVonKochGeneral[ll[[i]], ll[[i + 1]], iter, 0.65], i, 1,Length[ll] - 1], Axes -> True, AxesLabel -> {X,Y}] ] Another advantage of this method is that the input list of command 2 consists of only two points, namely ๐‘ƒ and ๐‘„. However, it can be generalized so that the input is more than two (a) Start. (b) First iteration. (c) Fourth iteration. (d) Seventh iteration. Figure 14: Exterior Koch Island with an equilateral triangle with center at ๐ถ(0, 2) and vertex at ๐‘ƒ (3, 4). points so that Koch curves can be graphed in one polygonal. Having said this, the command will be: Command6 In[9]:= CurvaVonKochPoligonal[list_,n_,Opts___]:= Module[{Newlist,Pol}, Newlist=Partition[list,2,1]; Pol[i_] := CurvaVonKochGeneral[Newlist[[i]], n, color]; Table[Pol[i], {i, 1, Length[Newlist]}]; Show[Table[Pol[i], {i, 1, Length[Newlist]}], Opts] ] 3. Results From the code proposed above, the following results are obtained: (a) First iteration. (b) Second iteration. (c) Fifth iteration. (d) Seventh iteration. Figure 15: Union of the interior and exterior Koch curve to an equilateral triangle with a center at ๐ถ(2, 3) and a vertex at ๐‘ƒ (4, 1). Example 1. for the segment whose ends are {(0, 1), (2, 0)}, is obtain the results of figure 10. Example 2. If we want the rotation to be downwards, we change the order of the points; that is, we take in the order {(2, 0), (0, 1)} and obtain the graphic of the figure 11. Example 3. For the segment of extremes {(2, 1), (5, 5)}, is obtained (see figure 12): Example 4. If we apply command 4 to the points ๐ถ(0, 2) y (3, 4) for an equilateral triangle is obtain (see figure 13): Example 5. If in the previous example we apply command 5 we obtain the island in the figure 14. Example 6. If we apply commands 5 and 6 for the same center and vertex and then join them, we obtain a fascinating island, the same one formed by drawing the internal and external Koch curves on the sides of a polygon. For ๐ถ(2, 3) y ๐‘ƒ (4, 1), is obtained (see figure 15): Ejemplo 7. For the comannd 6, when entering points {{0, 0}, {2, 2}, {4, 2}, {5, 0}} is ob- (a) Initial polygonal. (b) First iteration. (c) Second iteration. (d) Sixth iteration. Figure 16: The Koch curve in a polygonal. tained the images of the figure 16: Ejemplo 8. If we apply command 6 to the list of points {{0, 0}, {2, 2}, {4, 0}, {0, 0}}, That is, to the vertices of a triangle traveled counterclockwise, is obtained the images in the figure 17: 4. Conclusions This article shows an algorithm described based on simple computational operations extracted from a vector point of view. The importance lies in the versatility of the algorithm since it is possible to construct a Koch curve simply by taking any initial segment without the need to build a system of iterated functions for each case. It was also shown that from this vector approach, it is possible to construct two Koch islands, one interior, and one exterior, from any regular polygon and generate a new fractal as the union of the two islands inherent to each polygon. In addition to this, a command was also implemented with the power to graph a Koch curve in each of the segments of a polygonal, giving rise to a new generalized Koch curve; it is recommended to computationally implement the approach proposed in this article for when the points belong to a sphere given that the world in which we live has a spherical shape. Acknowledgments Thanks to the National University of Piura authorities for purchasing the Mathematica scientific software license with which the different results were obtained. (a) Initial polygonal. (b) First iteration. (c) Second iteration. (d) Sixth iteration. Figure 17: When the polygonal is a triangle, a Koch island is obtained. References [1] S. Plaza, Fractales y generaciรณn computacional de imรกgenes, Pontificia Universidad Catรณlica del Perรบ, 2000. [2] J. E. Hutchinson, Fractals and self similarity, Indiana University Mathematics Journal 30 (1981) 713โ€“747. [3] K. Vinoy, J. K. Abraham, V. K. Varadan, On the relationship between fractal dimension and the performance of multi-resonant dipole antennas using koch curves, IEEE Transactions on Antennas and Propagation 51 (2003) 2296โ€“2303. doi:10.1109/tap.2003.816352. [4] S. Pool-Domรญnguez, Introducciรณn a la geometrรญa fractal y su relaciรณn con la naturaleza, Abstraction and Application Magazine 7 (2014). [5] T. Keleti, E. Paquette, The trouble with von koch curves built from n gons, The American Mathematical Monthly 117 (2010) 124โ€“137. doi:10.4169/000298910x476040. [6] v. Ungar, The koch curve: A geometric proof, The American Mathematical Monthly 114 (2007) 61โ€“66. URL: http://dx.doi.org/10.1080/00029890.2007.11920392. doi:10.1080/ 00029890.2007.11920392. [7] M. Rani, R. U. Haq, D. K. Verma, Variants of koch curve: A review, Int. J. Comput. Appl 2 (2012) 20โ€“24. [8] O. F. G. Palacios, R. E. D. Vargas, J. A. H. Perez, S. B. C. Erazo, S-band koch snowflake fractal antenna for cubesats, in: 2016 IEEE ANDESCON, IEEE, 2016, pp. 1โ€“4. doi:10.1109/ andescon.2016.7836227. [9] E. W. Weisstein, Koch snowflake, https://mathworld. wolfram. com/ (2008). [10] E. Abbena, S. Salamon, A. Gray, Modern differential geometry of curves and surfaces with Mathematica, CRC press, 2017. [11] J. W. Gray, Mastering Mathematicaยฎ: Programming Methods and Applications, Academic Press, 2014.