{"id":290837,"date":"2018-10-16T00:40:02","date_gmt":"2018-10-15T20:40:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290837"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-10-15T20:40:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290837","title":{"rendered":"\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0427\u0430\u0441\u0442\u044c 2 (\u0413\u0440\u0430\u0444\u0438\u043a)"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><a href=\"https:\/\/habr.com\/post\/426373\/\">\u041d\u0430\u0447\u0430\u043b\u043e \u043d\u0430\u0447\u0430\u043b<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e3e\/e9b\/38d\/e3ee9b38d92c1b63514b27be853b42ef.jpg\" alt=\"image\"><\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u0432\u0441\u0435 \u044d\u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u041f\u043e\u0432\u0435\u0440\u043d\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0443\u044e \u043e\u0441\u044c \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f, \u043d\u0435 \u0445\u0440\u0430\u043d\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043b\u0438\u0441\u0442\u0435.<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0443\u044e \u043e\u0441\u044c \u0438\u0433\u0440\u0435\u043a 82 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430. \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c (\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0436\u0430\u0442\u044b\u043c), \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u00ab\u043a\u0440\u0443\u0442\u044b\u0445\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u0438 x \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0438 \u0438\u0433\u0440\u0435\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0449\u0435\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043a\u0430 (x, 0). \u041d\u0443 \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 x \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y1 \u0432 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0435.<\/p>\n<p>  \u041f\u043e\u0435\u0445\u0430\u043b\u0438<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/654\/2d7\/4cb\/6542d74cb0dadcc99e77ee0051e17d1c.svg\" alt=\"$ratio = (max(y1) - min(y1)) \/ (80)$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u0430\u043c\u043e\u043c\u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u043c\u044b \u043e\u0442\u0432\u0435\u0434\u0435\u043c 80 \u043f\u043e\u0437\u0438\u0446\u0438\u0439, \u0434\u0432\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043c\u0435\u0441\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0447\u0438\u0441\u0442\u043e \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438. \u042d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u043a\u0430\u043a\u043e\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435. \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0442\u043e\u0447\u043a\u0443.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443  <\/p>\n<pre><code class=\"python\">    dial_length = 12     label = \"\u0413\u0440\u0430\u0444\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y1 = x**3 - 2*x**2 + 4*x - 8\"     print(\"{1:&gt;{0}}\".format(len(label) + dial_length, label), '\\n')     print(\"{aux[1]:&gt;{aux[0]}}\\n {aux[2]:&gt;{aux[0]}}&gt;\\n\".format(aux =                                 [dial_length + 82, 'y' , 82*'-'])); <\/code><\/pre>\n<p>  \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u043a \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u044f \u0443\u0437\u043d\u0430\u043b \u043e \u0442\u0430\u043a\u043e\u0439 \u0448\u0442\u0443\u043a\u0435, \u043a\u0430\u043a <a href=\"https:\/\/pythonworld.ru\/osnovy\/formatirovanie-strok-metod-format.html\">format<\/a>. \u041c\u043d\u0435 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0438\u0445 \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a<\/p>\n<pre><code class=\"python\">print(\"{1:&gt;{0}}\".format(len(label) + dial_length, label), '\\n') <\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0438\u0447\u043a\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043d\u043e\u043c\u0435\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 format, \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u00ab\u0441\u0441\u044b\u043b\u043a\u0430\u00bb (\u043d\u0435 \u0432 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435) \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e label, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u041d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043b\u0438\u0441\u0442\u0430\u0445 \u2014 \u0441 \u043d\u0443\u043b\u044f.<br \/>  \u041f\u0430\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <b>:&gt;<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u041d\u0443 \u0430 <b>{0}<\/b> \u043f\u043e\u0441\u043b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 <b>&gt;<\/b> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<br \/>  <b>\u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 label len(label) + dial_length \u043f\u043e\u0437\u0438\u0446\u0438\u0439, \u043f\u0440\u0438\u0447\u0435\u043c \u0441\u0430\u043c label \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e len(label), \u0438 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435.<\/p>\n<pre><code class=\"python\">print(\"{1:&gt;{0}}\".format(len(label) + dial_length, label), '\\n') print(dial_length*' ' + label, '\\n')  <\/code><\/pre>\n<p>  <i>\u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b<\/i><br \/>  <\/b><\/p>\n<p>  \u0414\u0430, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043f\u0440\u043e\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442)<\/p>\n<pre><code class=\"python\">print(\"{aux[1]:&gt;{aux[0]}}\\n {aux[2]:&gt;{aux[0]}}&gt;\\n\".format(aux =                                 [dial_length + 82, 'y' , 82*'-'])); <\/code><\/pre>\n<p>  \u0412 format \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0442\u0438\u043f\u0430 r_value (\u0432 C++), \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<p>  \u0417\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 \u043d\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e <b>const<\/b> \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0445 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c.  <\/p>\n<pre><code class=\"python\">MAX_Y1_VALUE_DIFFERENCE = (max_y1_value - min_y1_value) + \\                               (max_y1_value == min_y1_value) RATIO = MAX_Y1_VALUE_DIFFERENCE \/ 80 AXIS_X_POS = abs(int((- min_y1_value) \/ RATIO)) if (AXIS_X_POS &gt; 80):     AXIS_X_POS = 81 <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a RATIO \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e 0, MAX_Y1_VALUE_DIFFERENCE \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435.<br \/>  \u041f\u043e\u0437\u0438\u0446\u0438\u044e \u043e\u0441\u0438 \u0438\u043a\u0441 \u043c\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9ca\/409\/515\/9ca409515bb3895cdd441263824b2155.svg\" alt=\"$80*(y1(x) - min(y1)) \/ (max(y1) - min(y1))$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430? \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432 (\u043d\u0430 \u043e\u0441\u0438 \u0438\u0433\u0440\u0435\u043a) \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0438 (min(y1)) \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (y1(x)) \u0438 \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0438 \u0434\u043e \u0435\u0435 \u043a\u043e\u043d\u0446\u0430 (max(y1)). \u041d\u0443 \u0438 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 80, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0438 \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u0445 (\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435-\u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435.<br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043f\u0440\u0438 y1(x) = 0, \u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u0443\u0430\u043b\u044f.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u0435\u0447\u0430\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439  <\/p>\n<pre><code class=\"python\">while (is_sequence_decreasing and from_x &gt;= to_x) or \\             (not is_sequence_decreasing and from_x &lt;= to_x):          y1_cur_value = y1(from_x)         cur_y1_value_and_min_difference = (y1_cur_value - min_y1_value) + \\                                           (y1_cur_value == min_y1_value) * \\                                           ((max_y1_value == min_y1_value))         pos_of_y = int(cur_y1_value_and_min_difference * 80 \/ \\                        MAX_Y1_VALUE_DIFFERENCE) <\/code><\/pre>\n<p>  \u0426\u0438\u043a\u043b \u043d\u0430\u043c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445 \u0432 \u043b\u0438\u0441\u0442\u0435 \u0438\u043b\u0438 \u0447\u0451\u043c-\u0442\u043e \u0435\u0449\u0435.<br \/>  \u041f\u043e\u0437\u0438\u0446\u0438\u044e \u0438\u0433\u0440\u0435\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043f\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435.<br \/>  \u0412\u0435\u0440\u0445\u043d\u044e\u044e \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043f\u043e\u0444\u0438\u043a\u0441\u0438\u0442\u044c, \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0430 \u043d\u043e\u043b\u044c \u043d\u0430 \u043d\u043e\u043b\u044c. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442, \u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 y1(x) = max(y1), \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u0435\u043a\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u0442 \u0441 \u043a\u043e\u043d\u0446\u043e\u043c \u043e\u0441\u0438 y.<\/p>\n<pre><code class=\"python\">       print(\"{1:^{0}.6g}\".format(dial_length, from_x), end='')          if (negative_value_exists):             if y1_cur_value &lt;= 0 - RATIO \/ 2:                 req_aux = AXIS_X_POS - pos_of_y                 if (req_aux != 0):                     print(pos_of_y * ' ' + '*' + (req_aux - 1) * ' ' + '|')                 else:                     print((AXIS_X_POS - 1) * ' ' + '*' + '|')             elif y1_cur_value &gt;= 0 + RATIO \/ 2:                 req_aux = pos_of_y - AXIS_X_POS                 if (req_aux != 0):                     print(AXIS_X_POS * ' ' + '|' + (req_aux - 1) * ' ' + '*')                 else:                     print((AXIS_X_POS) * ' ' + '|*')             else:                 print(AXIS_X_POS * ' ' + '*')         else:             print('|' + pos_of_y* ' ' + '*')             AXIS_X_POS = 0         from_x += pace_x     print((dial_length + AXIS_X_POS) * ' ' + '|\\n',           (dial_length + AXIS_X_POS - 3) * ' ' + 'x V') <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u0435\u0447\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0430  <\/p>\n<pre><code class=\"python\">print(\"{1:^{0}.6g}\".format(dial_length, from_x), end='') <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c-\u0442\u0430\u043a\u0438 format \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b \u043a\u043e\u0434. <b>^<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, 12 \u043f\u043e\u0437\u0438\u0446\u0438\u0439). <b>g<\/b> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0447\u0438\u0441\u043b\u0430 \u2014 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0430 \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 (\u0447\u0438\u0441\u043b\u043e \u043a\u0430\u043a int), \u0438\u043d\u0430\u0447\u0435 \u2014 6 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448 \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c \u0432 80 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0438 y, \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0447\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043e\u0441\u044c\u044e x \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 y1(x) = 0, \u043d\u043e \u0438 \u0432 \u043e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 [0 \u2014 RATIO\/2, 0 + RATIO\/2].<br \/>  \u0412\u0441\u0435\u0433\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0438) \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043b\u043a\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0441\u0438 x): &#8216;*|&#8217; (y1(x) &lt;= 0 \u2014 RATIO\/2), &#8216;*&#8217; (0 \u2014 RATIO\/2 &lt; y1(x) &lt; 0 + RATIO\/2), &#8216;|*&#8217; (y1(x) &gt;= 0 + RATIO\/2), \u044d\u0442\u0438 \u0442\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u044f \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c.  <\/p>\n<ol>\n<li>y1(x) &lt;= 0 \u2014 RATIO\/2<br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e \u043e\u0441\u0438 x, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0449\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u043e\u0441\u0438 \u0432 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u0445. \u0418\u0437-\u0437\u0430 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 AXIS_X_POS \u0438 pos_of_y \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0432\u043f\u0430\u0441\u0442\u044c. \u041d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0431\u044b \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u0442\u0440\u0435\u0442\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u0423 \u043d\u0430\u0441 \u0436\u0435 \u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043e\u0441\u044c\u044e \u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u043d\u0430 1 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e pos_of_y \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430.<\/li>\n<li>y(x) &gt;= 0 + RATIO\/2<br \/>  \u0421\u043b\u0443\u0447\u0430\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u043b\u0443\u0447\u0430\u044e, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043e\u0442 \u043e\u0441\u0438 \u0445 \u0438 \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u0434 \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/li>\n<li>\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435<br \/>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u043e\u0441\u0438<\/li>\n<\/ol>\n<p>  \u042d\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (y1(x) &lt; 0). \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c &#8216;|&#8217; \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0442\u043e\u0447\u043a\u0438.<br \/>  \u041d\u0443 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u043e\u0441\u0438 x.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f:  <\/p>\n<pre><code class=\"python\">dial_length = 12     label = \"\u0413\u0440\u0430\u0444\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y1 = x**3 - 2*x**2 + 4*x - 8\"     print(\"{1:^{0}.6f}\".format(dial_length, x_copy))      print(\"{1:&gt;{0}}\".format(len(label) + dial_length, label), '\\n')     print(\"{aux[1]:&gt;{aux[0]}}\\n {aux[2]:&gt;{aux[0]}}&gt;\\n\".format(aux =                                 [dial_length + 81, 'y' , 82*'-']), end='');      MAX_Y1_VALUE_DIFFERENCE = (max_y1_value - min_y1_value) + \\                               (max_y1_value == min_y1_value)     RATIO = MAX_Y1_VALUE_DIFFERENCE \/ 80     AXIS_X_POS = abs(int((- min_y1_value) \/ RATIO))     if (AXIS_X_POS &gt; 80):         AXIS_X_POS = 81      while (is_sequence_decreasing and from_x &gt;= to_x) or \\             (not is_sequence_decreasing and from_x &lt;= to_x):          y1_cur_value = y1(from_x)         cur_y1_value_and_min_difference = (y1_cur_value - min_y1_value) + \\                                           (y1_cur_value == min_y1_value) * \\                                           ((max_y1_value == min_y1_value))         pos_of_y = int(cur_y1_value_and_min_difference * 80 \/ \\                        MAX_Y1_VALUE_DIFFERENCE)          print(\"{1:^{0}.6g}\".format(dial_length, from_x), end='')          if (negative_value_exists):             if y1_cur_value &lt;= 0 - RATIO \/ 2:                 req_aux = AXIS_X_POS - pos_of_y                 if (req_aux != 0):                     print(pos_of_y * ' ' + '*' + (req_aux - 1) * ' ' + '|')                 else:                     print((AXIS_X_POS - 1) * ' ' + '*' + '|')             elif y1_cur_value &gt;= 0 + RATIO \/ 2:                 req_aux = pos_of_y - AXIS_X_POS                 if (req_aux != 0):                     print(AXIS_X_POS * ' ' + '|' + (req_aux - 1) * ' ' + '*')                 else:                     print((AXIS_X_POS) * ' ' + '|*')             else:                 print(AXIS_X_POS * ' ' + '*')         else:             print('|' + pos_of_y* ' ' + '*')             AXIS_X_POS = 0         from_x += pace_x     print((dial_length + AXIS_X_POS) * ' ' + '|\\n',           (dial_length + AXIS_X_POS - 3) * ' ' + 'x V') <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/783\/1ad\/333\/7831ad3331f5d5c17ef8fb557fc4ff75.jpg\" alt=\"image\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0ef\/c5c\/80c\/0efc5c80cbfa6b695ef0fd7e19845993.jpg\" alt=\"image\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/60e\/116\/6ee\/60e1166ee9382f94a067c7f88c53b144.jpg\" alt=\"image\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/296\/f3a\/838\/296f3a838240269ed786d40ad07ea24d.jpg\" alt=\"image\"><\/p>\n<p>  \u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442)<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/146\/c89\/49e\/146c8949e3e1027f68844ce3a5e3e1d4.jpg\" alt=\"image\"><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/426519\/\"> https:\/\/habr.com\/post\/426519\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><a href=\"https:\/\/habr.com\/post\/426373\/\">\u041d\u0430\u0447\u0430\u043b\u043e \u043d\u0430\u0447\u0430\u043b<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e3e\/e9b\/38d\/e3ee9b38d92c1b63514b27be853b42ef.jpg\" alt=\"image\"><\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u0432\u0441\u0435 \u044d\u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u041f\u043e\u0432\u0435\u0440\u043d\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0443\u044e \u043e\u0441\u044c \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f, \u043d\u0435 \u0445\u0440\u0430\u043d\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043b\u0438\u0441\u0442\u0435.<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0443\u044e \u043e\u0441\u044c \u0438\u0433\u0440\u0435\u043a 82 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430. \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c (\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0436\u0430\u0442\u044b\u043c), \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u00ab\u043a\u0440\u0443\u0442\u044b\u0445\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u0438 x \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0438 \u0438\u0433\u0440\u0435\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0449\u0435\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043a\u0430 (x, 0). \u041d\u0443 \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 x \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y1 \u0432 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0435.<\/p>\n<p>  \u041f\u043e\u0435\u0445\u0430\u043b\u0438  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-290837","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=290837"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290837\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}