{"id":22905,"date":"2009-02-20T05:38:51","date_gmt":"2009-02-20T12:38:51","guid":{"rendered":"http:\/\/sapromat.ru\/?p=30"},"modified":"2009-02-20T05:38:51","modified_gmt":"2009-02-20T12:38:51","slug":"%d0%bc%d0%b5%d1%82%d0%be%d0%b4-%d1%86%d0%b8%d1%84%d1%80%d0%be%d0%b2%d0%be%d0%b3%d0%be-%d0%b4%d0%b8%d1%84%d1%84%d0%b5%d1%80%d0%b5%d0%bd%d1%86%d0%b8%d0%b0%d0%bb%d1%8c%d0%bd%d0%be%d0%b3%d0%be-%d0%b0-3","status":"publish","type":"post","link":"https:\/\/studentpmr.ru\/?p=22905","title":{"rendered":"\u041c\u0435\u0442\u043e\u0434 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430."},"content":{"rendered":"<p>\u0417\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0432 \u0440\u0430\u0441\u0442\u0440. \u0413\u0434\u0435 x1, y1, x2, y2 &#8212; \u043a\u043e\u043d\u0446\u044b \u0440\u0430\u0437\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u0430, \u0430 yi &#8212; \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0448\u0430\u0433\u0430 (\u0432\u0434\u043e\u043b\u044c \u043e\u0442\u0440\u0435\u0437\u043a\u0430). <!--more-->\u0422.\u0435. \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 y. \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0426\u0414\u0410 &#8212; \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438\u0437 \u043f\u0440\u0438\u0440\u0430\u0449\u0435\u043d\u0438\u0439 (?x \u0438\u043b\u0438 ?y) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0440\u0430\u0441\u0442\u0440\u0430. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<br \/>\n\u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u043e\u0442\u0440\u0435\u0437\u043a\u0430<br \/>\nif abs(x2 &#8212; x1) ? abs(y2 &#8212; y1) then<br \/>\n\u0414\u043b\u0438\u043d\u0430 = abs(x2 &#8212; x1)<br \/>\nelse<br \/>\n\u0414\u043b\u0438\u043d\u0430 = abs(y2 &#8212; y1)<br \/>\nend if<br \/>\n\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438\u0437 \u043f\u0440\u0438\u0440\u0430\u0449\u0435\u043d\u0438\u0439 ?x \u0438\u043b\u0438 ?y \u0440\u0430\u0432\u043d\u044b\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0440\u0430\u0441\u0442\u0440\u0430<br \/>\n? x = (x2 &#8212; x1)\/\u0414\u043b\u0438\u043d\u0430<br \/>\n? y = (y2 &#8212; y1)\/\u0414\u043b\u0438\u043d\u0430<br \/>\n\u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b, \u0430 \u043d\u0435 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c<br \/>\n\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u043d\u0442\u043e\u0432<br \/>\nx = x1 + 0.5?Sign(? x)<br \/>\ny = y1 + 0.5?Sign(? y)<br \/>\n\u043d\u0430\u0447\u0430\u043b\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430<br \/>\nI = 1<br \/>\nwhile (I ? \u0414\u043b\u0438\u043d\u0430)<br \/>\nPlot (Integer(x), Integer(y))<br \/>\nx  = x + ? x<br \/>\ny  = y + ? y<br \/>\nI = I + 1<br \/>\nend while<br \/>\nfinish<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435! \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u043e\u0447\u043a\u0438 (x1,y1) \u0438 (x2,y2) &#8212; \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. \u0417\u0434\u0435\u0441\u044c &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f Integer &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0446\u0435\u043b\u043e\u0435, \u043f\u0443\u0442\u0435\u043c \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438!!! \u0424\u0443\u043d\u043a\u0446\u0438\u044f Sign &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 -1, 0, 1 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e, \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0432 \u0440\u0430\u0441\u0442\u0440. \u0413\u0434\u0435 x1, y1, x2, y2 &#8212; \u043a\u043e\u043d\u0446\u044b \u0440\u0430\u0437\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u0430, \u0430 yi &#8212; \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0448\u0430\u0433\u0430 (\u0432\u0434\u043e\u043b\u044c \u043e\u0442\u0440\u0435\u0437\u043a\u0430).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/22905"}],"collection":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22905"}],"version-history":[{"count":0,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/22905\/revisions"}],"wp:attachment":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}