<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Brothersit.net - книжный портал для программистов</title>
		<link>http://brothersit.net/</link>
		<description>Блог</description>
		<lastBuildDate>Wed, 25 May 2011 18:53:08 GMT</lastBuildDate>
		<generator>uCoz Web-Service</generator>
		<atom:link href="https://brothersinc.ucoz.net/blog/rss" rel="self" type="application/rss+xml" />
		
		<item>
			<title>Фрактал Дерево Пифагора</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Дерево Пифагора&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Дерево Пифагора — разновидность фрактала, основанная на фигуре, известной как «Пифагоровы штаны».&lt;br&gt;Если в классическом дереве Пифагора угол равен 45 градусам, то также можно построить и обобщённое дерево Пифагора при использовании других углов. Такое дерево часто называют обдуваемое ветром дерево Пифагора. Если изображать только отрезки, соединяющие каким-либо образом выбранны...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Дерево Пифагора&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Дерево Пифагора — разновидность фрактала, основанная на фигуре, известной как «Пифагоровы штаны».&lt;br&gt;Если в классическом дереве Пифагора угол равен 45 градусам, то также можно построить и обобщённое дерево Пифагора при использовании других углов. Такое дерево часто называют обдуваемое ветром дерево Пифагора. Если изображать только отрезки, соединяющие каким-либо образом выбранные &quot;центры&quot; треугольников, то получается обнаженное дерево Пифагора.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм :&lt;br&gt;1) Строим вертикальный отрезок&lt;br&gt;2) Из верхнего конца этого отрезка рекурсивно строим еще 2 отрезка под определенными углами&lt;br&gt;3) Вызываем функцию построения двух последующих отрезков для каждой ветви дерева&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#339900&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;conio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;graphics.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; Pi &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3.14159&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; n,m;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; max ;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; color;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; Draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; x, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; y, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; L, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;double&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// функция рисования фрактала&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;L &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; max&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 L&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.7&lt;/span&gt;;
 moveto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x,y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 lineto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;L&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;L&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 x&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;L&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;L&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// рекурсивный вызов&lt;/span&gt;
 Draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x,y,L,a&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;Pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x,y,L,a&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;Pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;m&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; main&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;Введите параметры : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;угол по X : Pi/&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// ввести числа от 1 до 10&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%lf&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;угол по Y : Pi/&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%lf&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;m&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;глубина рекурсии : &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// чем больше коэф. тем меньше шагов рекурсии // ввести 1 &lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;max&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; gdriver &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; DETECT, gmode, errorcode; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// подключаем графику&lt;/span&gt;
 initgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;gdriver, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;gmode, &lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 errorcode &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; graphresult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;errorcode &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; grOk&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;Graphics error: %s&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;, grapherrormsg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;errorcode&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;Press any key to halt:&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 Draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;320&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;460&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;200&lt;/span&gt;, Pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 closegraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/fraktal_derevo_pifagora/2011-05-25-8</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/fraktal_derevo_pifagora/2011-05-25-8</guid>
			<pubDate>Wed, 25 May 2011 18:53:08 GMT</pubDate>
		</item>
		<item>
			<title>Фрактал Минковского</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Минковского&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Эта программа производит замену либо одного горизонтального отрезка, либо каждой стороны правильного многоугольника фрактальной кривой Минковского&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм&lt;br&gt;1) Считываеться колличество сторон основной фигуры, глубина рукурсии, тип фрактала&lt;br&gt;2) Для каждой стороны основной фигуры вызывается построение заданного типа фрактальной кривой&lt;br&gt;3) Процесс повторяеться для каждой сторо...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Минковского&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Эта программа производит замену либо одного горизонтального отрезка, либо каждой стороны правильного многоугольника фрактальной кривой Минковского&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм&lt;br&gt;1) Считываеться колличество сторон основной фигуры, глубина рукурсии, тип фрактала&lt;br&gt;2) Для каждой стороны основной фигуры вызывается построение заданного типа фрактальной кривой&lt;br&gt;3) Процесс повторяеться для каждой стороны получившейся фигуры в зависимости от глубины рукурсии&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;conio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;graphics.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdlib.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; X_max, Y_max, foregrcolor, backgrcolor, colorsum;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; Xcur, Ycur;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x_max, y_max, horfact, vertfact;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; boundaries_uc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; w, h;
 getaspectratio&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;w, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;h &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Возвращает текущее отношение ширины изображения к его высоте&lt;/span&gt;
 y_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; h &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;X_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; w &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 horfact &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; X_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; x_max;
 vertfact &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; y_max;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; initgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; grdriver &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; DETECT, grmode;
&amp;nbsp;
 detectgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grdriver, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grmode &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Определяет графический драйвер и графический режим при проверке аппаратуры.&lt;/span&gt;
&amp;nbsp;
 initgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grdriver, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grmode, &lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Инициализирует графическую систему. Между &quot;&quot; должен быть написан путь к файлу egavga.bgi&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; graphresult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; grOk &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Error!&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 foregrcolor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getcolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает текущий цвет рисунка&lt;/span&gt;
 backgrcolor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getbkcolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает текущий цвет фона&lt;/span&gt;
 colorsum &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; foregrcolor &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; backgrcolor;
&amp;nbsp;
 X_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает максимальную координату х экрана&lt;/span&gt;
 Y_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает максимальную координату y экрана&lt;/span&gt;
&amp;nbsp;
 x_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;10.0&lt;/span&gt;;
&amp;nbsp;
 boundaries_uc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция перевода х координат из реальных в экранные&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; horfact &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция перевода y координат из реальных в экранные&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; vertfact &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; move&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция получает на вход реальные координаты, переводит их в экранные,&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//и переносит курсор в определяемую координатами точку&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 Xcur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Ycur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 moveto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; Xcur, Ycur &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Переводит курсор в точку, задаваемую координатами&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция получает на вход реальные координаты, переводит их в экранные,&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проводит линию из текущего положения курсора в точку, определяемую координатами, а затем переводит в эту точку курсор&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; X0 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Xcur, Y0 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Ycur;
 Xcur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Ycur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 line&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; X0, Y0, Xcur, Ycur &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Рисует линию между двумя указанными точками&lt;/span&gt;
 moveto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Xcur, Ycur&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; endgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 closegraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Прекращает работу графической системы&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;, yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xA, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; yA, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xB, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; yB, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; n &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Функция, рисующая фрактальную линию. Получает на вход реальные кооронаты начала и конца&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// отрезка, а так же параметр n определяющий глубину рекурсии&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, y, x1, y1, dx &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xB &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; xA, dy &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yB &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; yA;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; n &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 move&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xA, yA&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xB, yB&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xA;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yA;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; nmodel; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x1;
 y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y1;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xA &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dx &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; dy &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yA &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dy &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dx &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y, x1, y1, n &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; main&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 clrscr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; n, k, i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; pi, theta, r, x, y, x1, y1, xC, yC, sizefactor, xmargin, phi;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Vvedite kollichestvo storon figuri, berysiisya za osnovy: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Glubina rekyrsii: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Vvedite 1 elsu xotite yvidet&apos; kruvuy Minkovskogo, 0 esli dryguy: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; mod;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;mod&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.45&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.45&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.55&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.75&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.75&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
 nmodel&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;
&amp;nbsp;
 sizefactor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// коэффициент масштабирования&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/*
 Остальные элементы массива инициализируются нулями
 */&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;nmodel&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;;
&amp;nbsp;
 initgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; k &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// построение основной фигуры&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 xmargin &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; sizefactor &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xmargin, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y_max, x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; xmargin, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y_max, n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 xC &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x_max&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 yC &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y_max&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 r &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.9&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; sizefactor;
 pi &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;atan&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 theta &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;k;
 phi &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; theta;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; k; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; 
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x1;
 y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y1;
 phi &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; theta;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y, x1, y1, n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 endgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/fraktal_minkovskogo/2011-05-25-7</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/fraktal_minkovskogo/2011-05-25-7</guid>
			<pubDate>Wed, 25 May 2011 18:50:57 GMT</pubDate>
		</item>
		<item>
			<title>Фрактал Минковского</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Минковского&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Эта программа производит замену либо одного горизонтального отрезка, либо каждой стороны правильного многоугольника фрактальной кривой Минковского&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм&lt;br&gt;1) Считываеться колличество сторон основной фигуры, глубина рукурсии, тип фрактала&lt;br&gt;2) Для каждой стороны основной фигуры вызывается построение заданного типа фрактальной кривой&lt;br&gt;3) Процесс повторяеться для каждой сторо...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Минковского&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Эта программа производит замену либо одного горизонтального отрезка, либо каждой стороны правильного многоугольника фрактальной кривой Минковского&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм&lt;br&gt;1) Считываеться колличество сторон основной фигуры, глубина рукурсии, тип фрактала&lt;br&gt;2) Для каждой стороны основной фигуры вызывается построение заданного типа фрактальной кривой&lt;br&gt;3) Процесс повторяеться для каждой стороны получившейся фигуры в зависимости от глубины рукурсии&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;conio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;graphics.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdlib.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; X_max, Y_max, foregrcolor, backgrcolor, colorsum;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; Xcur, Ycur;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x_max, y_max, horfact, vertfact;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; boundaries_uc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; w, h;
 getaspectratio&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;w, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;h &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Возвращает текущее отношение ширины изображения к его высоте&lt;/span&gt;
 y_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; h &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;X_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; w &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 horfact &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; X_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; x_max;
 vertfact &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; y_max;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; initgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; grdriver &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; DETECT, grmode;
&amp;nbsp;
 detectgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grdriver, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grmode &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Определяет графический драйвер и графический режим при проверке аппаратуры.&lt;/span&gt;
&amp;nbsp;
 initgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grdriver, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;grmode, &lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Инициализирует графическую систему. Между &quot;&quot; должен быть написан путь к файлу egavga.bgi&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; graphresult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; grOk &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Error!&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 foregrcolor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getcolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает текущий цвет рисунка&lt;/span&gt;
 backgrcolor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getbkcolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает текущий цвет фона&lt;/span&gt;
 colorsum &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; foregrcolor &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; backgrcolor;
&amp;nbsp;
 X_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает максимальную координату х экрана&lt;/span&gt;
 Y_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Возвращает максимальную координату y экрана&lt;/span&gt;
&amp;nbsp;
 x_max &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;10.0&lt;/span&gt;;
&amp;nbsp;
 boundaries_uc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция перевода х координат из реальных в экранные&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; horfact &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция перевода y координат из реальных в экранные&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; Y_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; vertfact &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; move&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция получает на вход реальные координаты, переводит их в экранные,&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//и переносит курсор в определяемую координатами точку&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 Xcur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Ycur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 moveto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; Xcur, Ycur &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Переводит курсор в точку, задаваемую координатами&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Функция получает на вход реальные координаты, переводит их в экранные,&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проводит линию из текущего положения курсора в точку, определяемую координатами, а затем переводит в эту точку курсор&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; X0 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Xcur, Y0 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Ycur;
 Xcur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IX&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Ycur &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; IY&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 line&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; X0, Y0, Xcur, Ycur &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Рисует линию между двумя указанными точками&lt;/span&gt;
 moveto&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Xcur, Ycur&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; endgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 closegraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// Прекращает работу графической системы&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;, yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xA, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; yA, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; xB, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; yB, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; n &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Функция, рисующая фрактальную линию. Получает на вход реальные кооронаты начала и конца&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// отрезка, а так же параметр n определяющий глубину рекурсии&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; x, y, x1, y1, dx &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xB &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; xA, dy &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yB &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; yA;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; n &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 move&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xA, yA&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xB, yB&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xA;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yA;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; nmodel; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x1;
 y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y1;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xA &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dx &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; dy &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yA &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dy &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; dx &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y, x1, y1, n &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; main&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 clrscr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; n, k, i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; pi, theta, r, x, y, x1, y1, xC, yC, sizefactor, xmargin, phi;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Vvedite kollichestvo storon figuri, berysiisya za osnovy: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Glubina rekyrsii: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Vvedite 1 elsu xotite yvidet&apos; kruvuy Minkovskogo, 0 esli dryguy: &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; mod;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;mod&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.45&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.45&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.55&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.75&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.25&lt;/span&gt;;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.75&lt;/span&gt;; yy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 nmodel &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;7&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
 nmodel&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;
&amp;nbsp;
 sizefactor &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// коэффициент масштабирования&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/*
 Остальные элементы массива инициализируются нулями
 */&lt;/span&gt;
 xx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;nmodel&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;;
&amp;nbsp;
 initgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; k &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// построение основной фигуры&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 xmargin &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; sizefactor &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;xmargin, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y_max, x_max &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; xmargin, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y_max, n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 xC &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x_max&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 yC &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y_max&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 r &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.9&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; sizefactor;
 pi &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;atan&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 theta &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;k;
 phi &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; theta;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; k; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; 
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
&amp;nbsp;
 x &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x1;
 y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y1;
 phi &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; theta;
 x1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; yC &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;phi&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 side&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y, x1, y1, n&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 endgr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/fraktal_minkovskogo/2011-05-25-6</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/fraktal_minkovskogo/2011-05-25-6</guid>
			<pubDate>Wed, 25 May 2011 18:47:52 GMT</pubDate>
		</item>
		<item>
			<title>Простой &quot;квадратный&quot; фрактал</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Простой &quot;квадратный&quot; фрактал&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Простой &quot;квадратный&quot; фрактал - частный случай фракталов из многоугольников. Конечная картинка представляет собой&lt;br&gt;совокупность квадратов с уменьшающимеся размерами. Центр каждого квадрата является вершиной какого-то квадрата.&lt;br&gt;Основная задача состоит в том, чтобы избежать построения квадратов, чьими центрами являются вершиный квадратов лежащие внутри уже построеных квадратов.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм:&lt;br&gt;1. Создаём структуру , которая...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Простой &quot;квадратный&quot; фрактал&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Простой &quot;квадратный&quot; фрактал - частный случай фракталов из многоугольников. Конечная картинка представляет собой&lt;br&gt;совокупность квадратов с уменьшающимеся размерами. Центр каждого квадрата является вершиной какого-то квадрата.&lt;br&gt;Основная задача состоит в том, чтобы избежать построения квадратов, чьими центрами являются вершиный квадратов лежащие внутри уже построеных квадратов.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Алгоритм:&lt;br&gt;1. Создаём структуру , которая будет содержать координаты центров квадратов (Spoint).&lt;br&gt;2. По таймеру вызывается процедура Draw.&lt;br&gt;3. В процедуре Draw происходит рисование квадратов,центр которых - это точки, параметр draw которых равен true.&lt;br&gt;4. Увеличиваем счётчик num отвечающий за количество квадратов, которые будут построены на следующем шаге. num изменяется по степеням четвёрки.&lt;br&gt;5. В цикле &quot;while k меньше num” добавляются вершины построеных квадратов в массив точек.При этом если вершины принадлежат квадратам,которые не были нарисованы, то добавляемая точка будет иметь в параметре draw значение false.&lt;br&gt;Рассмотрим значение flag.Оно изменяется от 1 до 4. Если flag=1, тогда центр построенного при данном вызове процедуры Draw квадрата - это левая верхняя вершина квадрата построенного при предыдущем вызове процедуры Draw, если flag=2 - правая верхняя, flag=3 - правая нижняя, flag=4 - левая нижняя.&lt;br&gt;6. При добавлении в массив точки, которая является ЛЕВОЙ ВЕРХНЕЙ вершиной квадрата, проверяем , построенли этот квадрат &quot;вокруг&quot; ПРАВОЙ НИЖНЕЙ вершины квадрата, строившегося на предыдущем шаге процедуры Draw.Если да (т.е. flag=3), то парметр draw у добавляемой точки принимает занчение false.&lt;br&gt;7. При добавлении в массив точки, которая является ПРАВОЙ ВЕРХНЕЙ вершиной квадрата, проверяем , построенли этот квадрат &quot;вокруг&quot; ЛЕВОЙ НИЖНЕЙ вершины квадрата, строившегося на предыдущем шаге процедуры Draw.Если да (т.е. flag=4), то парметр draw у добавляемой точки принимает занчение false.&lt;br&gt;8. При добавлении в массив точки, которая является ПРАВОЙ НИЖНЕЙ вершиной квадрата, проверяем , построенли этот квадрат &quot;вокруг&quot; ЛЕВОЙ ВЕРХНЕЙ вершины квадрата, строившегося на предыдущем шаге процедуры Draw.Если да (т.е. flag=1), то парметр draw у добавляемой точки принимает занчение false.&lt;br&gt;9. При добавлении в массив точки, которая является ЛЕВОЙ НИЖНЕЙ вершиной квадрата, проверяем , построенли этот квадрат &quot;вокруг&quot; ПРАВОЙ ВЕРХНЕЙ вершины квадрата, строившегося на предыдущем шаге процедуры Draw.Если да (т.е. flag=2), то парметр draw у добавляемой точки принимает занчение false.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#339900&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;unit Unit1; 
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$mode objfpc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$H&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
interface
&amp;nbsp;
uses
 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,CRT,
 StdCtrls, ExtCtrls;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;const&lt;/span&gt;
 Min &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Минимальный размер квадрата&lt;/span&gt;
type
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 TForm1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;TForm&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 Button1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TButton;
 Button2&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TButton;
 PaintBox1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TPaintBox;
 Timer1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TTimer;
&amp;nbsp;
 procedure Button1Click&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 procedure Button2Click&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 procedure Draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; ;
 procedure PaintBox1DblClick&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 end; 
&amp;nbsp;
 type Spoint &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; record &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Структура данных для точек&lt;/span&gt;
 x,y&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Double;
 draw &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Boolean;
 end;
var
 Form1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TForm1; 
 size &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; real;
 num,i,j,k,t,flag &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; integer;
&amp;nbsp;
 a &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; array &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;..&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;66000&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; of Spoint; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Массив точек&lt;/span&gt;
implementation
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Button1Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
 i&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Номер последней точки, &quot;вокруг&quot; которой был построен квадрат&lt;/span&gt;
 j&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Номер последней точки в массиве&lt;/span&gt;
 num&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Количество точек, &quot;вокруг&quot; которых на данном шаге будут построены квадраты&lt;/span&gt;
 k&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Счётчик количества построеных квадратов на данном шаге&lt;/span&gt;
 t&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//&quot;Указатель&quot; на точку, которая &quot;пораждает&quot; новые точки (рассматриваемая точка)&lt;/span&gt;
 flag&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Особый маркер&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
&amp;nbsp;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;320&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//координаты первой точки массива&lt;/span&gt;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;240&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//&lt;/span&gt;
&amp;nbsp;
 size&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;120&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Размер первого квадрата&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
 Timer1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Enabled&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
&amp;nbsp;
end;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Button2Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
&amp;nbsp;
 close;
end;
&amp;nbsp;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; Size &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; Min then
 begin
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Brush&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;bsclear;
 t&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; k&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; to num &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt; begin &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//постороение квадратов &quot;вокруг&quot; точек&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;true&lt;/span&gt; then
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Rectangle&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;,Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 i&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
 end;
 num&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;num&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt;;
 j&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i;
 k&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; k&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;num &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt; begin &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// добавление новых точек в массив&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; flag&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then flag&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//На первом шаге в массив с точками добавляется левая верхняя вершина квадрата&lt;/span&gt;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; j &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; j &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt; j &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;false&lt;/span&gt; then a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если рассматриваемая точка пораждается точкой, &quot;вокруг&quot; которй не строился квадрат, то вокруг рассматриваемой точки также не строится квадрат (на последующих шагах повторяется данная проверка)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; flag&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если рассматриваемая вершина принадлежит квадрату, который построен &quot;вокруг&quot; ПРАВОЙ НИЖНЕЙ вершины другого квадрата,то &quot;вокруг&quot; рассматриваемой точки не нужно строить квадрат&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; num&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//На втором шаге в массив с точками добавляется правая верхняя вершина квадрата&lt;/span&gt;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;false&lt;/span&gt; then a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; flag&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если рассматриваемая вершина принадлежит квадрату, который построен &quot;вокруг&quot; ЛЕВОЙ НИЖНЕЙ вершины другого квадрата,то &quot;вокруг&quot; рассматриваемой точки не нужно строить квадрат&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; num&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//На третьем шаге в массив с точками добавляется правая нижняя вершина квадрата&lt;/span&gt;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;false&lt;/span&gt; then a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; flag&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если рассматриваемая вершина принадлежит квадрату, который построен &quot;вокруг&quot; ЛЕВОЙ ВЕРХНЕЙ вершины другого квадрата,то &quot;вокруг&quot; рассматриваемой точки не нужно строить квадрат&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; num&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//На четвёртом шаге в массив с точками добавляется левая нижняя вершина квадрата&lt;/span&gt;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; Size;
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;true;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;false&lt;/span&gt; then a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; flag&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если рассматриваемая вершина принадлежит квадрату, который построен &quot;вокруг&quot; ПРАВОЙ ВЕРХНЕЙ вершины другого квадрата,то &quot;вокруг&quot; рассматриваемой точки не нужно строить квадрат&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; num&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt; then
 a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
&amp;nbsp;
 flag&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;flag&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
&amp;nbsp;
 k&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+4&lt;/span&gt;;
 j&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+4&lt;/span&gt;;
 t&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;t&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
 end;
 size &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Size &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
 end;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; Size &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; Min then
 Timer1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Enabled&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;false;
&amp;nbsp;
end;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;PaintBox1DblClick&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Refresh&lt;/span&gt;;
end;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
initialization
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$I unit1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;lrs&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
end.&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/prostoj_quot_kvadratnyj_quot_fraktal/2011-05-25-5</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/prostoj_quot_kvadratnyj_quot_fraktal/2011-05-25-5</guid>
			<pubDate>Wed, 25 May 2011 18:46:00 GMT</pubDate>
		</item>
		<item>
			<title>Лист папоротника</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Лист папоротника&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Построение изображения листа папоротника при помощи фракталов.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Лист папоротника - один из тех объектов, которые удобно строить при помощи вероятностных распределений.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Основная идея этого метода заключается в том, чтобы, зафиксировав какую-либо начальную точку, далее циклически совершать афинное преобразование системы координат,в которой точка строится.То есть, если на определённом шаге цикла имеется точка точка А с координатами (х0...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Лист папоротника&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Построение изображения листа папоротника при помощи фракталов.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Лист папоротника - один из тех объектов, которые удобно строить при помощи вероятностных распределений.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Основная идея этого метода заключается в том, чтобы, зафиксировав какую-либо начальную точку, далее циклически совершать афинное преобразование системы координат,в которой точка строится.То есть, если на определённом шаге цикла имеется точка точка А с координатами (х0,y0), то при следующей итерации цикла изображается точка В, чьи координаты имеют вид ( а*х0+в*y0+с , d*х0+e*y0+f ). Таким образом наблюдается явное выражение &quot;новой&quot; системы координат(точка В) через &quot;старую&quot;(точка А).&lt;br&gt;В свою очередь коэффициенты преобразования систем координат выбираются в зависимости от попадения некоторой СЛУЧАЙНОЙ ВЕЛИЧИНЫ в соответствующий диапазон значений.&lt;br&gt;В данном примере случайная величина принимает значения из отрезка от 0 до 1.&lt;br&gt;Выбраны следующие диапазоны для этой случайной величины:&lt;br&gt;от 0 до 0.85 - соответствует преобразованию множества точек,отвечающих за &quot;густоту&quot; и &quot;высоту&quot; листа папоротника.&lt;br&gt;от 0.85 до 0.92 - рисует листики слева от стебля&lt;br&gt;от 0.92 до 0.99 - рисует листики справа от стебля&lt;br&gt;остальное - изображение стебля&lt;/p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#339900&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;unit Unit1; 
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$mode objfpc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$H&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
interface
&amp;nbsp;
uses
 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
 Buttons, ExtCtrls;
&amp;nbsp;
type
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 TForm1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;TForm&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 BitBtn1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TBitBtn;
 PaintBox1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TPaintBox;
 procedure BitBtn1Click&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 procedure draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 end; 
&amp;nbsp;
var
 Form1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TForm1; 
&amp;nbsp;
implementation
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;BitBtn1Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
 draw&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
end;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
procedure Tform1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;const&lt;/span&gt;
 iterations &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;50000&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Кол-во итераций&lt;/span&gt;
&amp;nbsp;
var
 t, x, y&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; real;
 p&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; real;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//CЛУЧАЙНАЯ ВЕЛИЧИНА&lt;/span&gt;
 k&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; longint;
 mid_x, mid_y, radius&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; integer;
&amp;nbsp;
begin
 mid_x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;width&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 mid_y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;height&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-100&lt;/span&gt; ;
 radius &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; trunc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.1&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; mid_y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 randomize;
 x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.0&lt;/span&gt;;
 y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.0&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; k &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt; to iterations &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 begin
 p &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; random;
 t &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; p &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.85&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Построение верхней части листа&lt;/span&gt;
 begin
 x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.84&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.045&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y;
 y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.045&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; t &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.86&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.6&lt;/span&gt;;
 end
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; p &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.92&lt;/span&gt; then &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Построение левого листа&lt;/span&gt;
 begin
 x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.26&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y;
 y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.23&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; t &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.25&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.6&lt;/span&gt;;
&amp;nbsp;
 end &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Построение правого листа&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; p &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.99&lt;/span&gt; then
 begin
 x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-0.135&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.28&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y;
 y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.26&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; t &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.245&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.44&lt;/span&gt;;
 end
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 begin &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Построение стебля&lt;/span&gt;
 x &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.0&lt;/span&gt;;
 y &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.16&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; y ;
 end;
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Pixels&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;mid_x&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;radius&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, mid_y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;radius&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+35&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;clGreen
 end
end;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
initialization
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$I unit1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;lrs&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
end.&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/list_paporotnika/2011-05-25-4</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/list_paporotnika/2011-05-25-4</guid>
			<pubDate>Wed, 25 May 2011 18:45:00 GMT</pubDate>
		</item>
		<item>
			<title>Фрактальное дерево</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактальное дерево&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Генерация фрактального дерева с помощью рекурсивной функции.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Сама генерация происходит при построении случайным образом листьев и веток дерева.&lt;br&gt;Для этого создаётся процедура Tree(x, y: Integer; a: Real; l: Integer).&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;На первом шаге эта процедура получает координаты начала дерева ((x, y: Integer), угол наклона ствола (a: Real) и длину основной ветви (l: Integer).&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Во время работы процедуры проверяется длина вновь сгенерированн...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактальное дерево&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Генерация фрактального дерева с помощью рекурсивной функции.&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Сама генерация происходит при построении случайным образом листьев и веток дерева.&lt;br&gt;Для этого создаётся процедура Tree(x, y: Integer; a: Real; l: Integer).&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;На первом шаге эта процедура получает координаты начала дерева ((x, y: Integer), угол наклона ствола (a: Real) и длину основной ветви (l: Integer).&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Во время работы процедуры проверяется длина вновь сгенерированной линии, при этом,если она слишком коротка, то мы будем считать её листом, а не веткой.&lt;br&gt;Координаты конца ветки вычисляются учитывая переданный угол &quot;a&quot;:&lt;br&gt;x1 := Round(x + l*cos(a));&lt;br&gt;y1 := Round(y + l*sin(a));&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Далее на основании длинны ветки, мы вводим дополнительную переменную и ее обработку для сохранения некоторых веток длинными. Те ветви, что будут признаны короткими следующим условием if p &lt; 40 будут дополнительно обрисованы листвой. При рисовании листвы мы случайно выбираем цвет из двух близких для листвы и циклом for i:=0 to 3 , где 3 - это ширина основания листа, отрисовываем лист на основании ранее вычисленных координат paintbox1.Canvas.Line(x+i,y,x1,y1)&lt;br&gt;Если же длина ветви оказалась большой, мы рисуем ветку вместо листа в цикле for i := 0 to (p div 6).Здесь толщина ветки зависит от её длины.&lt;br&gt;Далее в цикле for i := 0 to 9 - Random(9) создаётся случайное число веток или листьев из одного узла (от 0 до 9),&lt;br&gt;вычисляется коэфициент длины будущих веток s := Random(l - l div 6) + (l div 6) и угол наклона будущих побегов a1 := a + 1.6 * (0.5 - Random).На основании s и a1 вычисляются длины будущих побегов:&lt;br&gt;x1 := Round(x + s * cos(a));&lt;br&gt;y1 := Round(y + s * sin(a));&lt;br&gt;Далее следует рекурсивный вызов процедуры Tree для прорисовки новых листьев и веток согласно полученному случайному количеству.Припередаче данных в процедуру Tree изменяется случайным образом длина веток. Чем меньше будет число отнимаемое от длины ветки, тем больше будет ветвление: Tree(x1, y1, a1, p - 5 - Random(30))&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#339900&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;unit Unit1; 
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$mode objfpc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$H&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
interface
&amp;nbsp;
uses
 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
 StdCtrls, ExtCtrls;
&amp;nbsp;
type
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 TForm1 &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;TForm&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 Button1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TButton;
 PaintBox1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TPaintBox;
 procedure Button1Click&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 procedure Tree&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer; a&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Real; l&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; declarations &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 end; 
&amp;nbsp;
var
 Form1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TForm1;
 kount&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;integer;
&amp;nbsp;
implementation
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; TForm1 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Button1Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Sender&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; TObject&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
begin
&amp;nbsp;
 Tree&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;320&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;580&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;pi&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
end;
&amp;nbsp;
procedure TForm1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Tree&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x, y&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer; a&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Real; l&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
var
 x1, y1&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer;
 p, s &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer;
 i &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Integer;
 a1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt; Real;
begin
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; l &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt; then
 exit;
 x1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; l&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; l&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; l &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;100&lt;/span&gt; then
 p &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;100&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 p &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; l;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; p &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;40&lt;/span&gt; then
 begin
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Генерация листьев&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; Random &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; then
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Pen&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;clgreen
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Pen&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;rgbtocolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;90&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;139&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; to &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
&amp;nbsp;
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Line&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;i,y,x1,y1&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
 end
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 begin
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Генерация веток&lt;/span&gt;
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Pen&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;rgbtocolor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;100&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;3&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; to &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;p &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 paintbox1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Canvas&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Line&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; i &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;p &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, y, x1, y1&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 end;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Следующие ветки&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; to &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;9&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Random&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;9&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 begin
 s &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Random&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;l &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; l &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;l &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 a1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; a &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1.6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Random&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Угол наклона веток&lt;/span&gt;
 x1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; s &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 y1 &lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; Round&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; s &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 Tree&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x1, y1, a1, p &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; Random&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//Чем меньше вычетаем, тем пышнее дерево&lt;/span&gt;
 end;
&amp;nbsp;
end;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
initialization
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;$I unit1.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;lrs&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
end.&lt;/pre&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/fraktalnoe_derevo/2011-05-25-3</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/fraktalnoe_derevo/2011-05-25-3</guid>
			<pubDate>Wed, 25 May 2011 18:44:03 GMT</pubDate>
		</item>
		<item>
			<title>Фрактал Ньютона</title>
			<description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Ньютона&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Бассейны Ньютона, фракталы Ньютона — разновидность алгебраических фракталов.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Области с фрактальными границами появляются при приближенном нахождении корней нелинейного уравнения алгоритмом Ньютона на комплексной плоскости.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;История и дополнительные сведения о фрактале http://ru.wikipedia.org/wiki/Бассейны_Ньютона&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Алгоритм&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;В данном случае рассматривается полином как функция комплексного переменного.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Применим метод Ньютона для нахождения нуля функции комплексного переменного, используя процедуру:&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;zn+1 = zn - f(zn) / f...</description>
			<content:encoded>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Фрактал Ньютона&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Бассейны Ньютона, фракталы Ньютона — разновидность алгебраических фракталов.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Области с фрактальными границами появляются при приближенном нахождении корней нелинейного уравнения алгоритмом Ньютона на комплексной плоскости.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;История и дополнительные сведения о фрактале http://ru.wikipedia.org/wiki/Бассейны_Ньютона&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Алгоритм&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;В данном случае рассматривается полином как функция комплексного переменного.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;Применим метод Ньютона для нахождения нуля функции комплексного переменного, используя процедуру:&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;zn+1 = zn - f(zn) / f&apos;(zn)&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;1. Задается степень полинома, массив его коэффициентов, количество итераций, погрешность.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;2. Вычисляется начальное приближение z0 = xmin + ymin * i;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;3. Далее в цикле с помощью процедуры описанной выше находятся нули функции,&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;пока не будет достигнута требуемая погрешность для приближенного корня или заданное количество итераций.&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;В архиве 2 файла :&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;complex.c - простая структура для работы с комплексными числами&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;nf.c - основная программа&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; color: rgb(68, 68, 68); font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; &quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;conio.h&amp;gt; &lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;dos.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;stdlib.h&amp;gt; &lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &lt;graphics.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#include &quot;complex.c&quot;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#define EE 1E-80&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#define MAX_ROOTS 15&lt;/span&gt;
&lt;span style=&quot;color: rgb(51, 153, 0); &quot;&gt;#define BGI_PATH &quot;C:&amp;#92;&amp;#92;Lang&amp;#92;&amp;#92;BCLite&amp;#92;&amp;#92;BGI&quot;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;struct&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 Complex root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;MAX_ROOTS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; nor; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// number of root&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; deg; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// degree&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt; Roots;
&amp;nbsp;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// возвращает номер корня полинома для заполнения области&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; process_root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Complex z, Roots &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;p, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;nor; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;mod&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; csub&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; z, p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
 p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;nor&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;z;
 p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;nor&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; p&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;nor;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// инициализация корней&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; Rootinit&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Roots &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;roots&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;register&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;MAX_ROOTS;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 roots&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 roots&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;nor&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 roots&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// возвращает значение полинома в точке z&lt;/span&gt;
Complex f&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Complex z, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; deg, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;register&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;register&lt;/span&gt; Complex f;
 f&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;; i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 f&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;cadd&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; cmult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;f,z&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; f;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// возвращает значение первой производной полинома в точке z&lt;/span&gt;
Complex df&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;Complex z, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; deg, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;register&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;register&lt;/span&gt; Complex df;
 df&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;; i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 df&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;cadd&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; cmult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;df,z&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;, comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; df;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; Initialize&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; gd, gm, errorcode;
&amp;nbsp;
 gd &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; DETECT;
 initgraph&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;gd, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;gm, BGI_PATH&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 errorcode &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; graphresult&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;errorcode &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; grOk&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/* an error occurred */&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;Graphics error: %s&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;, grapherrormsg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;errorcode&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;Press any key to halt:&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/* return with error code */&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; drawFrac&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; dx, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; per, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; deg, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; NIT, &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; dy, xmin, ymin, x, y;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; X,Y;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; ITEST;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i,j,k,kit,col; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// счетчики, кол-во итераций, цвет&lt;/span&gt;
 Complex z,w,fz,dfz;
 Roots roots;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;fp;
&amp;nbsp;
&amp;nbsp;
 Rootinit&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;roots&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 roots.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;deg&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; deg;
&amp;nbsp;
 Initialize&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 per &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;per&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//per *= 0.01;&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// масштаб&lt;/span&gt;
 X &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;per;
 Y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; getmaxy&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;per;
 dy&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;dx&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;Y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;X;
 xmin &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;dx;
 ymin &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; dy;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;Y; i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 y &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; ymin &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;dy&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;Y;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;X; j&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 x &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; xmin &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;dx&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;X;
 z&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;comp&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x,y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 ITEST&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// цикл до тех пор, пока не достигнем нужного числа итераций,&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// или не найдем максимально близкий корень&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;; k&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;NIT; k&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 kit&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;k;
 fz &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; f&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;z,roots.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;deg&lt;/span&gt;,poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 dfz &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; df&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;z,roots.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;deg&lt;/span&gt;,poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;dfz&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;EE &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; ITEST&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; break;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 w&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;z;
 z&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;csub&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; z, cdiv&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;fz,dfz&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// zn+1 = zn - f(zn)/f&apos;(z)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; mod&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; csub&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;z,w&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt; EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; break;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;kit &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt; NIT&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; ITEST&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;ITEST &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; putpixel&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;j,i,BLACK&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 col &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; process_root&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;z,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;roots,EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 putpixel&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;j,i,col&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt; kbhit&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; break;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;!&lt;/span&gt;kbhit&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 restorecrtmode&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; main&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;char&lt;/span&gt; answ;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;MAX_ROOTS&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; dx&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;,per&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;20&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;float&lt;/span&gt; EPS&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;1E&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-10&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i,deg&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;5&lt;/span&gt;,NIT&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;40&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 clrscr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;INPUT TO DRAW FRACTAL&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;1) Polynominal degree (max is %d) : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;%d&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,MAX_ROOTS,deg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot; Coeficients : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;deg;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;A%d= %f&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,i,poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;2) Width of the area on the cartesian surface (dx) : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;%f&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,dx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;3) Percentage of the area of the screen to be covered: &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;%f&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,per&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;4) Maximum Number of Iterations : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;%d&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,NIT&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;5) Precision : &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;t&lt;/span&gt;%G &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;,EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;6) Draw Fractal&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;7) Exit &lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;What is your choice ? &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 answ&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;getch&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 clrscr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;switch&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;answ&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;1&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter the degree of the complex polynominal [&lt;=%d]: &quot;&lt;/span&gt;,MAX_ROOTS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;deg&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;15&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;||&lt;/span&gt; deg&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter the coeficients starting with the greatest power&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;deg;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;A%d = &quot;&lt;/span&gt;,i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%f&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;poly&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;2&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter the width (dx&amp;gt;0) = &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%f&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;dx&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;dx&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;3&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter the percentage of the screen to be covered by the fractal(%)&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;(the smallest the fastest -&amp;gt;useful for a preview) : &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%f&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;per&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;per&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;||&lt;/span&gt; per&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;4&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter the maximum Number of ITerations (NIT&amp;gt;0) : &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%d&quot;&lt;/span&gt;,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;NIT&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;NIT&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;5&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;&lt;span style=&quot;color: rgb(102, 102, 102); font-weight: bold; &quot;&gt;&amp;#92;n&lt;/span&gt;Enter precision ( &amp;gt;0 ) : &quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;scanf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&quot;%e&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;EPS&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;6&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 drawFrac&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;dx,per,poly,deg,NIT,EPS&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0); &quot;&gt;&apos;7&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 128); &quot;&gt;:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/*end switch */&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;; &lt;span style=&quot;color: rgb(255, 0, 0); font-style: italic; &quot;&gt;/*end do-loop*/&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/fraktal_njutona/2011-05-25-2</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/fraktal_njutona/2011-05-25-2</guid>
			<pubDate>Wed, 25 May 2011 18:42:53 GMT</pubDate>
		</item>
		<item>
			<title>Алгоритм проверки принадлежности точки многоугольнику. Метод трассировки луча</title>
			<description>&lt;h3 style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt; Алгоритм проверки принадлежности точки многоугольнику. Метод трассировки луча&lt;/h3&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Задача: Многоугольник на плоскости задается координатами своих вершин. Для заданной точки Z(x,y) определить, принадлежит ли она стороне многоугольника или лежит внутри или вне его.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Принадлежность точки стороне проверяется просто: если концевые точки стороны A(x1,y1) и B(x2,y2), то, если точка Z(x,y) принадлежит стороне, то должно выполняться равенство:&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;(x-x2)*(y1-y2)=(y-y2)*(y1-y2)&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68...</description>
			<content:encoded>&lt;h3 style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt; Алгоритм проверки принадлежности точки многоугольнику. Метод трассировки луча&lt;/h3&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border-collapse: collapse; font-family: &apos;Helvetica neue&apos;, Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Задача: Многоугольник на плоскости задается координатами своих вершин. Для заданной точки Z(x,y) определить, принадлежит ли она стороне многоугольника или лежит внутри или вне его.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Принадлежность точки стороне проверяется просто: если концевые точки стороны A(x1,y1) и B(x2,y2), то, если точка Z(x,y) принадлежит стороне, то должно выполняться равенство:&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;(x-x2)*(y1-y2)=(y-y2)*(y1-y2)&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Далее, проведем из точки Z прямую, параллельную оси OX и проверим, сколько сторон многоугольника пересекает луч, идущий от точки Z вправо. Если 0, то Z - вне многоугольника, нечетное количество - то внутри, если четное количество - то снаружи.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Обойдем все ребра многоугольника и проверим пересечение с лучом.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Необходимо обработать случай, когда прямая пересекает одну из вершин многоугольника (например, A).&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Может быть 2 случая: в первом случае, когда оба ребра, входящих в вершину A, лежат по одну сторону от прямой, количество пересечений можно считать равным двум (или нулю), во втором случае, когда ребра лежат по разные стороны от прямой, число пересечений примем равным единице.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Также рассмотрим случай, когда прямая проходит по стороне (например АВ).&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Если ребро, входящее в вершину А, и ребро, входящее в вершину В, лежат по одну сторону от прямой, количество пересечений можно считать равным двум (или нулю); если же они лежат по разные стороны от прямой, число пересечений примем равным единице.&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;Чтобы узнать пересекает ли прямая, проходящая через точку Z параллельно оси OX, сторону АВ, надо обозначить через F(x,y)=b-y (где b - координата точки Z по у). Если эта прямая пересекает отрезок, то либо концы отрезка лежат в различных полуплоскостях, либо хотя бы одна концевая точка отрезка лежит на прямой. Это равносильно выполнению следующего неравенства F(x1,y1)*F(x2,y2)&lt;=0&lt;/p&gt;&lt;p style=&quot;color: rgb(68, 68, 68); margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-bottom: 0.8em; &quot;&gt;&lt;span style=&quot;line-height: 15px; &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); color: rgb(34, 34, 34); overflow-x: auto; overflow-y: auto; &quot;&gt;gboolean on_click&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;GtkWidget &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;widget, GdkEventButton &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;event, gpointer data&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//функция обработки щелчка мыши&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 gc &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;style&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;fg_gc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;GTK_WIDGET_STATE&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;widget&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; i,j;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; x,y;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//переменные, в которые записываются координаты текущей точки&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; count,ct;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;int&lt;/span&gt; h,l,r;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//вспомогательные переменные&lt;/span&gt;
&amp;nbsp;
 clrbelong.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;pixel&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//цвет, обозначающий, что точка &lt;/span&gt;
 clrbelong.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;red&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;225&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//принадлежит одной из сторон&lt;/span&gt;
 clrbelong.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;green&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;150&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//многоугольника&lt;/span&gt;
 clrbelong.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;blue&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; 
&amp;nbsp;
 clroutside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;pixel&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//цвет, обозначающий, что точка не &lt;/span&gt;
 clroutside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;red&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;225&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//принадлежит ни одной из сторон&lt;/span&gt;
 clroutside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;green&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//многоугольника&lt;/span&gt;
 clroutside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;blue&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;;
&amp;nbsp;
 clrinside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;pixel&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//цвет, обозначающий, что точка в&lt;/span&gt;
 clrinside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;red&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//многоугольнике&lt;/span&gt;
 clrinside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;green&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;139&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; 
 clrinside.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;blue&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;257&lt;/span&gt;; 
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x_mouse &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; x_mouse &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;allocation.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;width&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; y_mouse &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; y_mouse &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt; widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;allocation.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 c.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; x_mouse; 
 c.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; y_mouse;
 p&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;c;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//записываем в массив координаты новую точку с экрана&lt;/span&gt;
 k&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt; 
 x&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;p&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//записываем ее координаты в переменные х и у&lt;/span&gt;
 y&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;p&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;k&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверка принадлежности точки одной из сторон мн-ка&lt;/span&gt;
 count&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;num;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверяем, лежит ли данная точка на какой-нибудь из сторон прямоугольника&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;num&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверка, лежит ли данная точка на отрезке или только на его продолжении&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 gdk_gc_set_rgb_fg_color&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;gc,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;clrbelong&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 gdk_draw_arc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;window,gc,&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;TRUE&lt;/span&gt;, x&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, y&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;64&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 count &lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;
 break;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если данная точка не лежит ни на одной строне многоугольника, то выполняем следующее &lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;count&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; 
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проводим прямую || ox &lt;/span&gt;
 gdk_gc_set_rgb_fg_color&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;gc,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;clr&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 gdk_draw_line&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;window, gc, x, y, WIDTH, y&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
&amp;nbsp;
 ct&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//счетчик, в который записывается кол-во пересечений многоугольника лучом&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;=&lt;/span&gt;num;i&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//перебираем каждую сторону мн-ка&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;num&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 j&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверяем, пересекает ли прямая отрезок (сторону)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//&quot;&lt;&quot; означает, что мы не берем случай, когда прямая проходит через концы отрезка&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверка с какой стороны точка&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если справа - увеличиваем счетчик на единицу&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если данная сторона лежит на луче&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 l&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;num;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 l&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;num&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 r&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 r&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;+1&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если &amp;#92;_ или _/ , то добавляем к счетчику единицу&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// &amp;#92; / &lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// _&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если &amp;#92;_/ или / &amp;#92; , то добавляем к счетчику двойку&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;l&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;r&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;l&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;r&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если же прямая проходит через конец отрезка, тогда &lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//проверяем, как расположены стороны относительно данной точки&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 h&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;num;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
 h&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-1&lt;/span&gt;;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если стороны расположены:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// &amp;#92; или /&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// / &amp;#92; ,то прибавляем к счетчику единицу&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если стороны расположены:&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;// &amp;#92;/ или /&amp;#92; ,&lt;/span&gt;
 &lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//то прибавляем к счетчику двойку&lt;/span&gt;
&amp;nbsp;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;h&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;++&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;h&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;y&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;[&lt;/span&gt;j&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 238, 255); &quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;ct&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если четное кол-во пересечений луча с мн-ком, то точка снаружи&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 gdk_gc_set_rgb_fg_color&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;gc,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;clroutside&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 gdk_draw_arc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;window,gc,&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;TRUE&lt;/span&gt;, x&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, y&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;64&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); &quot;&gt;//если нечетное - то внутри&lt;/span&gt;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;{&lt;/span&gt;
 gdk_gc_set_rgb_fg_color&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;gc,&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;&amp;amp;&lt;/span&gt;clrinside&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 gdk_draw_arc&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;(&lt;/span&gt;widget&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 128); &quot;&gt;&amp;gt;&lt;/span&gt;window,gc,&lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;TRUE&lt;/span&gt;, x&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, y&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;-4&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 64); &quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); &quot;&gt;64&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;)&lt;/span&gt;;
 &lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt; 
 &lt;span style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; TRUE;
&lt;span style=&quot;color: rgb(0, 128, 0); &quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;geshifilter-cpp&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(187, 187, 187); border-right-color: rgb(187, 187, 187); border-bottom-color: rgb(187, 187, 187); border-left-color: rgb(187, 187, 187); overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;font color=&quot;#008000&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Arial; font-size: 11px; border-collapse: separate; color: rgb(0, 0, 0); line-height: normal; white-space: normal; &quot;&gt;&lt;i&gt;&lt;b&gt;Материал &amp;nbsp;позаимствован с сайта&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;img src=&quot;http://brothersit.net/opitanet.png&quot; alt=&quot;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</content:encoded>
			<link>https://brothersinc.ucoz.net/blog/algoritm_proverki_prinadlezhnosti_tochki_mnogougolniku_metod_trassirovki_lucha/2011-05-12-1</link>
			<dc:creator>Mr_Ser_Win</dc:creator>
			<guid>https://brothersinc.ucoz.net/blog/algoritm_proverki_prinadlezhnosti_tochki_mnogougolniku_metod_trassirovki_lucha/2011-05-12-1</guid>
			<pubDate>Thu, 12 May 2011 06:34:25 GMT</pubDate>
		</item>
	</channel>
</rss>