{"id":305112,"date":"2020-06-09T21:00:24","date_gmt":"2020-06-09T21:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305112"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305112","title":{"rendered":"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0418\u0437\u0438\u043d\u0433\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C++ (\u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 OpenGL)"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506100\/\">\n<h3>\u041c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430<\/h3>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430 \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u0437\u043c\u0430 \u0438 \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u0430 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439. \u0424\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u0437\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u043a\u043e\u0432 \u043d\u0438\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u2014 \u0442\u043e\u0447\u043a\u0438 \u041a\u044e\u0440\u0438. \u0412 \u0442\u043e\u0447\u043a\u0435 \u041a\u044e\u0440\u0438 (\u0443\u0437\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u0438\u0435, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043b\u0435\u0447\u0435\u0442 \u0444\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u043a\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u0412. \u041b\u0435\u043d\u0446\u0435\u043c \u0432 1920 \u0433\u043e\u0434\u0443, \u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0430 \u0418\u0437\u0438\u043d\u0433\u043e\u043c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f, \u0432 \u0447\u0435\u0441\u0442\u044c \u0447\u0435\u0433\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0448\u0435\u0442\u043a\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e: +1 \u0438\u043b\u0438 -1, \u2014 \u043f\u043e\u043b\u0435 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u0438\u043b\u0438 \u00ab\u0432\u043d\u0438\u0437\u00bb. \u0427\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u043d. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0435\u0448\u0435\u0442\u043a\u0430 \u0438\u0437 N \u0447\u0438\u0441\u043b\u0430 \u0441\u043f\u0438\u043d\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 2<sup>N<\/sup> \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445. \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u043d\u0435\u0440\u0433\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u043f\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043f\u0438\u043d\u043e\u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0430\u0442\u043e\u043c\u043e\u0432: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qa\/qk\/-8\/qaqk-8wwm_roct6dx4khhtscw7q.png\"\/><\/p>\n<p>  \u0413\u0434\u0435 J \u2014 \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u043f\u0438\u043d\u043e\u0432 (\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u043e\u0431\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0430\u0440), s<sub>i<\/sub> \u0438 s<sub>j<\/sub> \u2014 \u0441\u043f\u0438\u043d\u044b. <\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c J &gt; 0 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u043a\u0430, J &lt; 0 \u0430\u043d\u0442\u0438\u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u043a\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 H, \u0442\u043e \u043f\u043e\u043b\u043d\u0430\u044f \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vq\/zg\/-0\/vqzg-0mb2dsfmjdh5twwghqowo8.png\"\/><\/p>\n<p>  \u0421\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yu\/-g\/o8\/yu-go8strepmhoyzgavlnidttkw.png\"\/><\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e<\/h3>\n<p>  \u041a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e 2<sup>N<\/sup> \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043f\u0438\u043d\u043e\u0432 N \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 N=10 \u043f\u043e\u043b\u0443\u0447\u0438\u043c 2<sup>10<\/sup> \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0442\u0435\u0440\u043c\u043e\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u044f \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 T. \u0412 \u0445\u043e\u0434\u0435 \u043e\u0431\u043c\u0435\u043d\u0430 \u044d\u043d\u0435\u0440\u0433\u0438\u0435\u0439 \u0441 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u043e\u0439, \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u043a\u043e\u043b\u043e \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0430 \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430 T. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e \u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u044b:<\/p>\n<ol>\n<li>\u0420\u0430\u0437\u044b\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u03b1<sub>i<\/sub> \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c) \u043f\u0440\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c T;<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0442\u0435\u0440\u043c\u043e\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0432\u0431\u043b\u0438\u0437\u0438 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u044f (\u044d\u043d\u0435\u0440\u0433\u0438\u044e E, \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c M); <\/li>\n<li>\u0423\u0441\u0440\u0435\u0434\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/li>\n<\/ol>\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u041c\u0435\u0442\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430.<\/h3>\n<p>  \u0412 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u00ab\u043c\u0435\u0442\u043e\u0434 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e\u00bb \u0438 \u00ab\u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u041c\u0435\u0442\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430\u00bb \u2014 \u043f\u043e\u0447\u0442\u0438 \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u044b. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u041c\u0435\u0442\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u043f\u0438\u043d\u043e\u0432 \u0438\u043b\u0438 \u0447\u0430\u0441\u0442\u0438\u0446:<\/p>\n<ol>\n<li>\u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/li>\n<li>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u043f\u0440\u043e\u0431\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0438\u043d \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e \u043e\u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c. \u0418\u043b\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u0438\u0446\u0443 \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/li>\n<li>\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u2206\u0415, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0431\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u2206\u0415 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e, \u0442\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0448\u0430\u0433\u0443 8.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u2206\u0415 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u00ab\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u00bb:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r6\/ke\/8t\/r6ke8tyd2mddxgi8gjqpxflopcs.png\"\/>  <\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e rnd \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 (0, 1)<\/li>\n<li> \u0415\u0441\u043b\u0438 rnd\u2264W, \u0442\u043e \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/li>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d.<\/li>\n<li>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0448\u0430\u0433\u0438 2\u20138 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438\u043b\u0438 \u00ab\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0439\u00bb.<\/li>\n<li>\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0414\u0432\u0443\u043c\u0435\u0440\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C++<\/h3>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0443\u044e \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u041c\u0435\u0442\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/p>\n<ul>\n<li>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0435\u0448\u0435\u0442\u043a\u0438 SIZE, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443\u044e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 T_MAX.<\/li>\n<li>\u0412 \u043e\u043a\u043d\u0435 ISING \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u044f \u0440\u0435\u0448\u0435\u0442\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c SIZE\u00d7SIZE, \u0432 \u0440\u0435\u0448\u0435\u0442\u043a\u0435 \u0441\u043f\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0432\u0435\u0440\u0445 (0), \u0431\u0443\u0434\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u043b\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0441\u043f\u0438\u043d\u044b, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043d\u0438\u0437 (1), \u0431\u0443\u0434\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438 \u0447\u0435\u0440\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430.<\/li>\n<li>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 T \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0448\u043a\u0430\u043b\u044b \u0441\u043f\u0440\u0430\u0432\u0430 \u0432 \u043e\u043a\u043d\u0435 ISING. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043c\u044b\u0448\u0438 \u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 W \u0438 S \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b). \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u2013 0,01\u2103.<\/li>\n<li>\u0411\u0435\u043b\u0430\u044f \u0447\u0435\u0440\u0442\u0430 \u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0448\u043a\u0430\u043b\u0435 \u2013 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u041a\u044e\u0440\u0438 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u043a\u0430 \u0418\u0437\u0438\u043d\u0433\u0430. \u0412 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0418\u0437\u0438\u043d\u0433\u0430 \u043f\u0440\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 T=2,269\u2103 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u0437 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. <\/li>\n<li>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0441 (\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434); \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u0448\u0430\u0433\u043e\u0432 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e.<\/li>\n<li>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u0442\u043a\u0438 \u0441\u043f\u0438\u043d\u043e\u0432.<\/li>\n<li>\u041a\u0430\u0436\u0434\u044b\u0435 10 \u0441 (\u0441\u0435\u043a\u0443\u043d\u0434) \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c (\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f, \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u043d\u0430 \u0441\u043f\u0438\u043d, \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u043d\u0430 \u0441\u043f\u0438\u043d, \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438).<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt; #include &lt;random&gt; #include &lt;locale&gt; #include &quot;glut.h&quot;  using namespace std;  #define SIZE 256 #define SIZE_PX 800 #define T_MAX 4 #define CURIE_SCALE 1000.   double quadSize = SIZE_PX \/ (double)SIZE;  short lattice[SIZE][SIZE]; double w[5]; double T = T_MAX, M, E;  int ratio = 0; size_t nmcs = 0; double ecum = 0, e2cum = 0, mcum = 0, m2cum = 0;  void display() { \tglClear(GL_COLOR_BUFFER_BIT); \t \tglBegin(GL_QUADS); \tfor (int i = 0; i &lt; SIZE; i++) \t\tfor (int j = 0; j &lt; SIZE; j++) \t\t{ \t\t\tglColor3f(lattice[i][j], lattice[i][j], lattice[i][j]); \t\t\tglVertex2d(i, j); \t\t\tglVertex2d(i, j + 1); \t\t\tglVertex2d(i + 1, j + 1); \t\t\tglVertex2d(i + 1, j); \t\t} \tglEnd();  \tglBegin(GL_QUADS); \t{ \t\tglColor3f(1, 0, 0); \t\tglVertex2d(SIZE, 0); \t\tglVertex2d(SIZE, SIZE * T \/ T_MAX); \t\tglVertex2d(SIZE + SIZE \/ 8, SIZE * T \/ T_MAX); \t\tglVertex2d(SIZE + SIZE \/ 8, 0);  \t\tglColor3f(1, 1, 1); \t\tglVertex2d(SIZE, SIZE * 2.27 \/ T_MAX - SIZE \/ CURIE_SCALE); \t\tglVertex2d(SIZE, SIZE * 2.27 \/ T_MAX + SIZE \/ CURIE_SCALE); \t\tglVertex2d(SIZE + SIZE \/ 8, SIZE * 2.27 \/ T_MAX + SIZE \/ CURIE_SCALE); \t\tglVertex2d(SIZE + SIZE \/ 8, SIZE * 2.27 \/ T_MAX - SIZE \/ CURIE_SCALE); \t} \tglEnd();  \tglutSwapBuffers(); \tglFlush(); }  void calcW() { \tdouble e4 = exp(-4 \/ T), e8 = e4 * e4; \tw[0] = w[4] = e8; \tw[1] = w[3] = e4; \tw[2] = 0; }  void init() { \tM = E = 0; \tstatic std::default_random_engine generator; \tstd::uniform_int_distribution&lt;int&gt; distribution(0, RAND_MAX); \tfor (int i = 0; i &lt; SIZE; i++) \t\tfor (int j = 0; j &lt; SIZE; j++) \t\t{ \t\t\tlattice[i][j] = ((distribution(generator) \/ (double)RAND_MAX &gt;= 0.5) - 1) * 2 + 1; \t\t\tM += lattice[i][j]; \t\t}  \tfor (int i = 0; i &lt; SIZE; i++) \t\tfor (int j = 0; j &lt; SIZE; j++) \t\t{ \t\t\tE += (i + 1 != SIZE) ? lattice[i][j] * lattice[i + 1][j] : 0; \t\t\tE += (j + 1 != SIZE) ? lattice[i][j] * lattice[i][j + 1] : 0; \t\t}  \tcalcW(); }  void metropolis() { \tint x, y, sum; \tfor (int i = 0; i &lt; SIZE * SIZE; i++) \t{ \t\tx = rand() % SIZE; \t\ty = rand() % SIZE; \t\tsum = lattice[(x - 1 + SIZE) % SIZE][y] + \t\t\tlattice[(x + 1 + SIZE) % SIZE][y] + \t\t\tlattice[x][(y - 1 + SIZE) % SIZE] + \t\t\tlattice[x][(y + 1 + SIZE) % SIZE];  \t\tif (sum * lattice[x][y] &lt;= 0 || (rand() \/ (double)RAND_MAX) &lt; w[sum \/ 2 + 2]) \t\t{ \t\t\tlattice[x][y] = -lattice[x][y]; \t\t\t::ratio++; \t\t\tM += 2 * lattice[x][y]; \t\t\tE -= 2 * lattice[x][y] * sum; \t\t} \t} }  void timer1(int) { \tdisplay();  \tmetropolis();  \tnmcs++;  \tecum += E; \te2cum += E * E; \tmcum += M; \tm2cum += M * M;   \tglutTimerFunc(10, timer1, 0); }  void outputData(int) { \tdouble norm = 1 \/ (double)(nmcs * SIZE * SIZE);  \tcout &lt;&lt; &quot;\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f = &quot; &lt;&lt; ::ratio * norm &lt;&lt; endl; \tcout &lt;&lt; &quot;\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u043d\u0430 \u0441\u043f\u0438\u043d = &quot; &lt;&lt; ecum * norm &lt;&lt; endl; \tcout &lt;&lt; &quot;\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u043d\u0430 \u0441\u043f\u0438\u043d = &quot; &lt;&lt; e2cum * norm &lt;&lt; endl; \tcout &lt;&lt; &quot;\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c = &quot; &lt;&lt; mcum * norm &lt;&lt; endl; \tcout &lt;&lt; &quot;\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438 = &quot; &lt;&lt; m2cum * norm &lt;&lt; endl &lt;&lt; endl;  \tglutTimerFunc(10000, outputData, 0); }  void keyboard(unsigned char key, int x, int y) { \tswitch (key) \t{ \tcase 'w': case 'W': \t{ \t\tT += 0.01; \t\tT = (T &gt;= T_MAX) ? T_MAX : T; \t\tcalcW(); \t\tbreak; \t} \tcase 's': case 'S': \t{ \t\tT -= 0.01; \t\tT = (T &lt;= 0.01) ? 0.01 : T; \t\tcalcW(); \t\tbreak; \t} \t} }  void motion(int x, int y) { \tdouble k = 1 - y \/ (double)SIZE_PX; \tT = T_MAX * k; \tT = (T &gt;= T_MAX) ? T_MAX : T; \tT = (T &lt;= 0.01) ? 0.01 : T; \tcalcW(); }  int main() { \tsetlocale(LC_ALL, &quot;ru&quot;); \tinit(); \tglutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); \tglutInitWindowSize(SIZE_PX + 100, SIZE_PX); \tglutCreateWindow(&quot;ISING&quot;); \tglMatrixMode(GL_PROJECTION); \tglLoadIdentity(); \tgluOrtho2D(0, SIZE + SIZE \/ 8, 0, SIZE); \tglutDisplayFunc(display); \tglutKeyboardFunc(keyboard); \tglutMotionFunc(motion); \tglutTimerFunc(1, timer1, 0); \tglutTimerFunc(10000, outputData, 0);  \tglutMainLoop(); } <\/code><\/pre>\n<p>  \u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0446\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435:<\/p>\n<ul>\n<li>init() \u2013 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438;<\/li>\n<li>display() \u2013 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0440\u0435\u0448\u0435\u0442\u043a\u0438 \u0441\u043f\u0438\u043d\u043e\u0432 \u0438 \u0448\u043a\u0430\u043b\u044b \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b;<\/li>\n<li>calcW() \u2013 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430;<\/li>\n<li>metropolis() \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u041c\u0435\u0442\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430;<\/li>\n<li>timer1() \u2013 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0448\u0430\u0433\u043e\u0432 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e;<\/li>\n<li>outputData() \u2013 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u043d\u0430 \u0441\u043f\u0438\u043d, \u0432\u044b\u0432\u043e\u0434 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li>keyboard() \u0438 motion() \u2013 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u043a\u0430\u043b\u044b \u0434\u0432\u0443\u043c\u044f \u043f\u0443\u0442\u044f\u043c\u0438 \u2013 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438 \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 \u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043c\u044b\u0448\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e;<\/li>\n<\/ul>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0432\u044b\u0432\u043e\u0434\u043e\u0432:<\/p>\n<ul>\n<li>\u041f\u0440\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 T=2,269\u2103 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u0437 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/li>\n<li>\u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0432 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/> \n<ul>\n<li>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f;<\/li>\n<li>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u043d\u0430 \u0441\u043f\u0438\u043d \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f;<\/li>\n<li>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u043d\u0430 \u0441\u043f\u0438\u043d \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f;<\/li>\n<li>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f;<\/li>\n<li>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0438 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ka\/gq\/ox\/kagqox0wpmizfunxkiwykfllipk.png\"\/><\/div>\n<p> \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\/ru\/post\/506100\/\"> https:\/\/habr.com\/ru\/post\/506100\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506100\/\">\n<h3>\u041c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430<\/h3>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0418\u0437\u0438\u043d\u0433\u0430 \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u0437\u043c\u0430 \u0438 \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u0430 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439. \u0424\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u0437\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u043c\u0430\u0433\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443 \u0444\u0435\u0440\u0440\u043e\u043c\u0430\u0433\u043d\u0435\u0442\u0438\u043a\u043e\u0432 \u043d\u0438\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u2014 \u0442\u043e\u0447\u043a\u0438 \u041a\u044e\u0440\u0438. \u0412 \u0442\u043e\u0447\u043a\u0435 \u041a\u044e\u0440\u0438 (\u0443\u0437\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u0438\u0435, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043b\u0435\u0447\u0435\u0442 \u0444\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u043a\u043e\u043c.  <\/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-305112","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305112","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=305112"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305112\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}