{"id":305175,"date":"2020-06-11T03:00:15","date_gmt":"2020-06-11T03:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305175"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305175","title":{"rendered":"\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u043e: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 3 \u0447\u0430\u0441\u043e\u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f p5.js"},"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\/506268\/\">\u0423 \u043c\u0435\u043d\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c p5.js, \u044f \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u043c\u0438 \u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043a\u0440\u0443\u0442\u043e\u0435. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0442\u043e\u0440\u0430 \u0447\u0430\u0441\u043e\u0432 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_l\/wz\/a6\/_lwza67asite-gqhwihy4zpsrp4.png\" alt=\"image\"><br \/>  <i>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438<\/i><\/p>\n<p>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0440\u043e\u043a\u0430 \u043d\u0430\u0441 \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e, \u0447\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b \u2013 \u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0438 \u0446\u0432\u0435\u0442\u043e\u043c. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u043b\u0433\u043e\u0439 \u043f\u043e\u0435\u0437\u0434\u043a\u0438 \u044f \u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u044f\u043a\u0438\u0435 \u0438\u0434\u0435\u0438, \u0438 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u044d\u0442\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0431\u044b\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e, \u043d\u043e \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443: \u044d\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043c\u044b \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 3 \u0447\u0430\u0441\u0430 \u0438\u0437\u0443\u0447\u0430\u0435\u043c p5.js. \u042f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u044d\u0442\u0443 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e, \u043d\u043e \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0435\u0437\u0434\u043e\u043a \u043c\u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u044f \u0441\u043c\u043e\u0433 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u044f \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u044d\u0442\u043e:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ok\/pm\/6p\/okpm6pctw3o1oqogbbtrcz7akwc.jpeg\" alt=\"image\"><br \/>  <i>\u041d\u0430\u0431\u0440\u043e\u0441\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u043e\u0439 \u043f\u043e\u0435\u0437\u0434\u043a\u0438, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438<\/i><\/p>\n<p>  \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u044f \u043c\u043e\u0433 \u0431\u044b:  <\/p>\n<ul>\n<li>\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0442\u043a\u0443 \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441 (\u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c)<\/li>\n<li>\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0435\u0442\u043a\u0435<\/li>\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435<\/li>\n<li>\u0437\u0430\u0442\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432<\/li>\n<\/ul>\n<p>  \u0412 \u043c\u043e\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u0430 \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. <br \/>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0434\u0430\u043b\u0435\u043a\u043e \u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u043b\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u043d\u044f\u043b, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u0443\u043f\u043e \u0431\u044b\u043b\u043e \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  <b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u043a\u0438.<\/b><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044f \u043c\u043e\u0433 \u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u0438\u0434\u0435\u0439, \u044f \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0441\u0435\u0442\u043a\u0443 \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441 (\u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c):<\/p>\n<pre><code class=\"javascript\">function setup() {   createCanvas( windowWidth, windowHeight )   colorMode( HSB )   noLoop()   noStroke() }   function draw() {   background( 20, 20, 20)      \/\/ Setup a grid so i can figure out the uppper and lower bounds   \/\/ of where the points should go      var columns = 5   var rows = 5   var columnWidth = windowWidth \/ columns   var columnHeight = windowHeight \/ rows   fill( 30, 30, 30)   stroke( 90, 90, 90 )   rect( 0, 0, columnWidth, columnHeight )    \/\/ Create a row    for ( i = 0; i &lt; rows; i++ ){      \/\/ Create a column      for ( j = 0; j &lt; columns; j++ ){        rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )     }   } } <\/code><\/pre>\n<p>  \u0418 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lg\/gv\/oz\/lggvozfslgztmbdcjhvyq4a1n7g.png\" alt=\"image\"><br \/>  <i>\u0421\u0435\u0442\u043a\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043b\u0438\u043d\u0438\u0439<\/i><\/p>\n<p>  <b>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/b><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0442\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0438 \u043d\u0438\u0436\u043d\u044e\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 \u0432\u044b\u0441\u043e\u0442\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u0440\u0443\u0436\u043a\u0438. \u041f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u0438. <br \/>  \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b:<\/p>\n<pre><code class=\"javascript\">for ( j = 0; j &lt; columns + 1 ; j++ ){   rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )    \/\/create my point    var pointPositionX = random( j * columnWidth - columnWidth, j * columnWidth )   var pointPositionY = random( i * columnHeight - columnHeight, i * columnHeight )   circle( pointPositionX, pointPositionY, 10 ) }<\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0442\u043e\u0447\u043a\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jq\/_0\/qf\/jq_0qfdnr4en2n3ys5ubd_r5qiw.png\" alt=\"image\"><br \/>  <i>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/i><\/p>\n<p>  <b>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445.<\/b><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438, \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">for ( i = 0; i &lt; rows + 1; i++ ){     var columnData = []     \/\/ Create a column     for ( j = 0; j &lt; columns + 1 ; j++ ){       rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )       \/\/create my point       var pointPositionX = random( j * columnWidth - columnWidth, j * columnWidth )       var pointPositionY = random( i * columnHeight - columnHeight, i * columnHeight )       columnData.push( [pointPositionX, pointPositionY] )       console.log( columnData )       \/\/circle( pointPositionX, pointPositionY, 10 )     }     allCoordinates.push( columnData )     console.log( allCoordinates )   } <\/code><\/pre>\n<p>  \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440, \u043a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043d\u0430 JavaScript, \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442, \u043d\u043e \u043e\u043d, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0443 \u043c\u0435\u043d\u044f \u043b\u0435\u0433\u043a\u043e. \u0412\u043e\u0442 \u0442\u043e, \u0447\u0442\u043e \u044f \u0432\u044b\u0432\u0435\u043b \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u043c\u0443\u2026 \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f1\/v8\/wl\/f1v8wltxc5jg3wzcsrcf7blrf-4.png\" alt=\"image\"><br \/>  <i>\u0422\u0435 \u0446\u0438\u0444\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438<\/i><\/p>\n<p>  <b>\u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a.<\/b><\/p>\n<p>  \u0414\u0430, \u0442\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0431\u044b\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439 \u2013 \u0437\u0430\u0447\u0435\u043c \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0431\u044b \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 0? \u041a\u0442\u043e \u0437\u043d\u0430\u0435\u0442. \u041f\u043e\u043b\u0430\u0433\u0430\u044e, \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e i \u0438 j \u0431\u044b\u043b\u0438 1? \u041a\u043e\u0440\u043e\u0447\u0435, \u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u044d\u0442\u043e. <\/p>\n<p>  \u042f \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e \u043f\u043e\u043d\u044f\u0442\u0438\u044f, \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041c\u043d\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 allCoordinates[]. <\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u044f \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0431\u044b\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0442\u0430\u043a, \u043a\u0430\u043a \u044f \u0445\u043e\u0442\u0435\u043b, \u0438 \u0447\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a.<\/p>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">var allCoordinates = [];   \/\/ Create a row   for ( i = 0; i &lt; rows + 1; i++ ){     \/\/ Create a column     for ( j = 0; j &lt; columns + 1 ; j++ ){       rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )       \/\/create my point       var pointPositionX = random( j * columnWidth + columnWidth, j * columnWidth )       var pointPositionY = random( i * columnHeight + columnHeight, i * columnHeight )       allCoordinates.push( [pointPositionX, pointPositionY] )       circle( pointPositionX, pointPositionY, 10 )       console.log(allCoordinates)     }   }   \/\/ Create the first triangle   fill( 90, 90, 90 )   var currentPoint = 0   var firstPointX = allCoordinates[0][0]   var firstPointY = allCoordinates[0][1]   var secondPointX = allCoordinates[1][0]   var secondPointY = allCoordinates[1][1]   var thirdPointX = allCoordinates[6][0]   var thirdPointY = allCoordinates[6][1]   triangle( firstPointX, firstPointY, secondPointX, secondPointY, thirdPointX, thirdPointY ) <\/code><\/pre>\n<p>  \u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xe\/q8\/be\/xeq8beywu72hrih_sjlllw4yijs.png\" alt=\"image\"><br \/>  <i>\u042d\u0439, \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435!<\/i><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0446\u0438\u043a\u043b \u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0438\u0445. <\/p>\n<p>  <b>\u041f\u043e\u0441\u043b\u0435 2 \u0447\u0430\u0441\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0435\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430&#8230;<\/b><\/p>\n<p>  \u042f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u043d\u0430\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u042f \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043e\u0432\u044b\u0432\u0430\u043b \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u0442\u044c, \u0433\u0434\u0435 \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u2013 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u044f \u0434\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0433\u0434\u0435 \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438 \u044f \u0437\u043d\u0430\u043b, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0447\u0430\u0441 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443, \u044f \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u043e \u044f \u0431\u044b\u043b \u0433\u043e\u0442\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0437\u043c\u043e\u043c. \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8p\/ml\/kl\/8pmlkleaa1niqbqbyduhpnixztm.png\" alt=\"image\"><br \/>  <i>\u0414\u0430, \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441<\/i><\/p>\n<p>  <b>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0445\u0443\u0434\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430.<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0441\u043b\u0430\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0441\u0442\u0440\u043e\u043a, \u0437\u0430\u043d\u0438\u043c\u0430\u044f\u0441\u044c \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u043a\u0430\u0434\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0446\u0432\u0435\u0442\u043e\u0432. \u042f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0432\u0441\u0435 \u0431\u043b\u0438\u0436\u0435 \u043a \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q5\/8y\/ld\/q58yldqzx7hjlxrmvsdu2qsg130.png\" alt=\"image\"><br \/>  <i>\u0412\u0441\u0435 \u0431\u043b\u0438\u0436\u0435 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f<\/i><\/p>\n<p>  <b>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0440\u044f\u0448\u043b\u0438\u0432\u044b\u0439 \u043a\u043e\u0434.<\/b><\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u0440\u0435\u043d\u0434\u0435\u0440 \u043d\u0430\u0447\u0430\u043b \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0441\u0435 \u043b\u0443\u0447\u0448\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u044f \u043c\u043e\u0433 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  \u042d\u0442\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m9\/_d\/ws\/m9_dwsmytkq9jzjgz5by--zqwpu.png\" alt=\"image\"><br \/>  <i>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0435, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c. \u0414\u0443\u043c\u0430\u044e, \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f!<\/i> <\/p>\n<p>  \u0418 \u0441\u0430\u043c \u043a\u043e\u0434 \u043d\u0430 p5.js. \u041e\u043d \u043d\u0435 \u0434\u043e\u0447\u0438\u0449\u0435\u043d, \u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0443\u043a. \u041d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0439\u0442\u0435\u0441\u044c!<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">function setup() {   var canvas = createCanvas( 1600, 1600 )   canvas.parent(&quot;canvasArea&quot;);   colorMode( HSB )   noLoop()   noStroke() }  function draw() {   background( 197, 31, 65 )    \/\/ Setup a grid so i can figure out the uppper and lower bounds   \/\/ of where the points should go   var columns = 20   var rows = 20    var columnWidth = 1600 \/ columns   var columnHeight = 1600 \/ rows    \/\/ Show the grid   fill( 18, 11, 18 )   \/\/stroke( 90, 90, 90 )   \/\/rect( 0, 0, columnWidth, columnHeight )    var allCoordinates = [];   \/\/ Create a row   for ( i = 0; i &lt; rows; i++ ){     \/\/ Create a column     for ( j = 0; j &lt; columns ; j++ ){       rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )       \/\/create my point       var pointPositionX = random( j * columnWidth + columnWidth, j * columnWidth )       var pointPositionY = random( i * columnHeight + columnHeight, i * columnHeight )        allCoordinates.push( [pointPositionX, pointPositionY] )       circle( pointPositionX, pointPositionY, 10 )     }   }   var whichRow = 1   var l = 1   while ( l &lt; allCoordinates.length ){      \/\/firstTriangle     if (whichRow == 1 || whichRow == rows){       \/\/don't do anything on the first and last row (thse need just one triangle)     }     else{       if ( (l + 1) % rows == 0 || l == 0){         console.log(&quot;it's the last item, do nothing&quot;)       }       else{         \/\/Triangle 1         var colorChoices = [           [45, 15, 75],           [22, 42, 95],           [5, 55, 75],           [0, 61, 95]         ]          var randomColorChoice = Math.floor(random(0,4))         fill( colorChoices[randomColorChoice][0], colorChoices[randomColorChoice][1], Math.floor(random(50,100)) )         \/\/stroke( 200, 90, 90 )          var currentPoint = l         var nextPoint = l + 1         var bottomPoint = l + rows         var firstPointX = allCoordinates[currentPoint][0]         var firstPointY = allCoordinates[currentPoint][1]         var secondPointX = allCoordinates[nextPoint][0]         var secondPointY = allCoordinates[nextPoint][1]         var thirdPointX = allCoordinates[bottomPoint][0]         var thirdPointY = allCoordinates[bottomPoint][1]         triangle(firstPointX, firstPointY, secondPointX, secondPointY, thirdPointX, thirdPointY)          \/\/Triangle 2         randomColorChoice = Math.floor(random(0,4))         fill( colorChoices[randomColorChoice][0], colorChoices[randomColorChoice][1], Math.floor(random(50,100)) )         \/\/stroke( 200, 90, 90 )          var currentPoint = l         var nextPoint = l - rows         var bottomPoint = l + 1         var firstPointX = allCoordinates[currentPoint][0]         var firstPointY = allCoordinates[currentPoint][1]         var secondPointX = allCoordinates[nextPoint][0]         var secondPointY = allCoordinates[nextPoint][1]         var thirdPointX = allCoordinates[bottomPoint][0]         var thirdPointY = allCoordinates[bottomPoint][1]         triangle( firstPointX, firstPointY, secondPointX, secondPointY, thirdPointX, thirdPointY )       }     }     l++     if ( l % rows == 0 ){ whichRow++ }   } } <\/code><\/pre>\n<\/div><\/div>\n<blockquote><p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432:<\/p>\n<ul>\n<li> <a href=\"https:\/\/habr.com\/ru\/post\/505658\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0442\u0430 \u0441\u043a\u0432\u043e\u0437\u044c \u043a\u043e\u0441\u043c\u043e\u0441 (\u0438\u043b\u0438 \u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043d\u0435\u0433\u0430) \u0437\u0430 10 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 p5.js<\/a><\/li>\n<li> <a href=\"https:\/\/habr.com\/ru\/post\/505190\/\">\u041a\u0430\u043a \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u043c\u0443\u0430\u0440\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043e\u0440\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 p5.js \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430 (\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0433\u0430\u0439\u0434)<\/a><\/li>\n<li> <a href=\"https:\/\/habr.com\/ru\/post\/505226\/\">\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 2d-\u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043d\u0430 3d-\u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c p5.js (\u0447\u0430\u0441\u0442\u044c 1 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430)<\/a><\/li>\n<li> <a href=\"https:\/\/habr.com\/ru\/post\/505402\/\">\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 2d-\u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043d\u0430 3d-\u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c p5.js (\u0447\u0430\u0441\u0442\u044c 2 \u2014 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043d\u0430 \u043a\u0443\u0431)<\/a><\/li>\n<\/ul>\n<\/blockquote>\n<\/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\/506268\/\"> https:\/\/habr.com\/ru\/post\/506268\/<\/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\/506268\/\">\u0423 \u043c\u0435\u043d\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c p5.js, \u044f \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u043c\u0438 \u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043a\u0440\u0443\u0442\u043e\u0435. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0442\u043e\u0440\u0430 \u0447\u0430\u0441\u043e\u0432 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_l\/wz\/a6\/_lwza67asite-gqhwihy4zpsrp4.png\" alt=\"image\"><br \/>  <i>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438<\/i><\/p>\n<p>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0440\u043e\u043a\u0430 \u043d\u0430\u0441 \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e, \u0447\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b \u2013 \u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0438 \u0446\u0432\u0435\u0442\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-305175","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305175","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=305175"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305175\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}