{"id":7962,"date":"2009-04-09T15:03:43","date_gmt":"2009-04-09T12:03:43","guid":{"rendered":"http:\/\/studentpmr.ru\/?p=7962"},"modified":"2009-04-09T15:03:43","modified_gmt":"2009-04-09T12:03:43","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-2","status":"publish","type":"post","link":"http:\/\/studentpmr.ru\/?p=7962","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 (\u0426\u0414\u0410)"},"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). \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 (Dx \u0438\u043b\u0438 Dy) \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:<\/p>\n<p> <!--more-->  <\/p>\n<p>\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<\/p>\n<p>if abs(x2 &#8212; x1) ? abs(y2 &#8212; y1) then<\/p>\n<p>\u0414\u043b\u0438\u043d\u0430 = abs(x2 &#8212; x1)<\/p>\n<p>else<\/p>\n<p>\u0414\u043b\u0438\u043d\u0430 = abs(y2 &#8212; y1)<\/p>\n<p>end if<\/p>\n<p>\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 Dx \u0438\u043b\u0438 Dy \u0440\u0430\u0432\u043d\u044b\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0440\u0430\u0441\u0442\u0440\u0430<\/p>\n<p>D x = (x2 &#8212; x1)\/\u0414\u043b\u0438\u043d\u0430<\/p>\n<p>D y = (y2 &#8212; y1)\/\u0414\u043b\u0438\u043d\u0430<\/p>\n<p>\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<\/p>\n<p>\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<\/p>\n<p>x = x1 + 0.5?Sign(D x)<\/p>\n<p>y = y1 + 0.5?Sign(D y)<\/p>\n<p>\u043d\u0430\u0447\u0430\u043b\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430<\/p>\n<p>I = 1<\/p>\n<p>while (I ? \u0414\u043b\u0438\u043d\u0430)<\/p>\n<p>Plot (Integer(x), Integer(y))<\/p>\n<p>x = x + D x<\/p>\n<p>y = y + D y<\/p>\n<p>I = I + 1<\/p>\n<p>end while<\/p>\n<p>finish <\/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). \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 (Dx \u0438\u043b\u0438 Dy) \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:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/7962"}],"collection":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7962"}],"version-history":[{"count":0,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/7962\/revisions"}],"wp:attachment":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7962"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}