{"id":195142,"date":"2013-09-25T13:25:03","date_gmt":"2013-09-25T09:25:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=195142"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=195142","title":{"rendered":"<span class=\"post_title\">\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0432 \u0437\u0430 8 \u0448\u0430\u0433\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/ac4\/16d\/776\/ac416d7764f22ca79f8124e67bf955e3.jpg\"\/><br \/>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0425\u0430\u0431\u0440!<br \/>  \u042f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u0438\u043b \u043a\u043e\u0442\u043e\u0432, \u0438 \u043b\u044e\u0431\u0438\u043b \u0438\u0445 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u043e\u0440\u0434\u044b \u043a\u043e\u0448\u0430\u0447\u044c\u0438. \u0427\u0443\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0448\u044c \u0444\u043e\u0440\u043c\u0443, \u043b\u0438\u043d\u0438\u044e \u2014 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0434\u0440\u0443\u0433\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435. \u0423 \u043c\u0435\u043d\u044f \u043b\u0438\u0441\u0442\u044b \u04104 \u0431\u044b\u043b\u0438 \u0438\u0437\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0434 \u043f\u0440\u0435\u0434\u0435\u043b. \u0418 \u0442\u0443\u0442 \u043c\u043d\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u0442\u0443\u043a\u043d\u0443\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0440\u0434 \u043a\u043e\u0442\u043e\u0432? \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443 \u0438 \u0442\u0435\u0431\u0435 \u0432\u044b\u043a\u0438\u043d\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043c\u043e\u0440\u0434\u0430 \u043a\u043e\u0442\u0430. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443. <br \/>  \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0438 \u043a\u043e\u0442\u043e\u0432.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u0441\u0451 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 JS \u0438 Canvas&#8217;\u0435, \u0438 \u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e. \u042d\u0442\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u043f\u043e\u043b\u043d\u043e, \u0430 \u043d\u0430\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0432, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0432\u043e\u0442 \u043e\u043d\u0438:<\/p>\n<pre><code class=\"javascript\">function add(func, scale){  \tGraphics.ctx.scale(scale.x, scale.y); \tfunc(Graphics.ctx);\t \tGraphics.ctx.scale(1, 1);  } <\/code><\/pre>\n<p>  \u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0430\u043d\u0432\u0430\u0441\u0430, \u0447\u0442\u043e-\u0442\u043e \u0440\u0438\u0441\u0443\u0435\u043c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043d\u0430\u0437\u0430\u0434.<\/p>\n<pre><code class=\"javascript\">function draw\u0421ircle(ctx, pos, radius, fillColor, strokeColor, lineWidth) {     ctx.beginPath();     ctx.arc(center.x - pos.x, center.y + pos.y, radius, 0, 2*Math.PI, false);     ctx.fillStyle = fillColor;     ctx.fill();     ctx.lineWidth = lineWidth;     ctx.strokeStyle = strokeColor;     ctx.stroke(); } <\/code><\/pre>\n<p>  \u0410 \u044d\u0442\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0435\u0439\\\u043a\u0440\u0443\u0433\u043e\u0432. \u0422\u043e\u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e, \u0432\u0441\u0451 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0440\u0430\u0437 \u0438 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0438 \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u043a \u043a\u043e\u0442\u0430\u043c!<\/p>\n<h4>\u0428\u0430\u0433 1 \u2014 \u0413\u043e\u043b\u043e\u0432\u0430<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u043c\u044b \u0441 \u0433\u043e\u043b\u043e\u0432\u044b. \u0428\u043e \u0435\u0441\u043c\u044c \u0433\u043e\u043b\u043e\u0432\u0430? \u041e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0436\u0430\u0442\u044c, \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c.<br \/>  \u0415\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u043e\u0431\u0432\u043e\u0434\u043a\u0438, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c. \u0418 \u0435\u0441\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043a\u043e\u0434\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<br \/>  \u041a\u043e\u0434 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d, \u0434\u0443\u043c\u0430\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442.  <\/p>\n<pre><code class=\"javascript\">\/\/\u0413\u0435\u043d\u0435\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 var radius = Math.sRandom(60, 70); \/\/\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b var scaleCircle = {x:Math.sRandom(1,1.1),y:Math.sRandom(0.9,1.0)}; \/\/\u0417\u0430\u0434\u0430\u0435\u043c \u0446\u0432\u0435\u0442\u0430 var whiteColor = &quot;#fff&quot;; var blackColor = &quot;#000&quot;; \/\/\u0420\u0438\u0441\u0443\u0435\u043c add(function(ctx){         \/\/ (Math.sRandom(0, 100) &lt; 95 ? blackColor : whiteColor) - \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430, \u0438\u043d\u043e\u0433\u0434\u0430, \u0440\u0435\u0434\u043a\u043e, \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0443\u0440 \u0431\u0435\u043b\u044b\u043c, \u0442.\u0435. \u0433\u043e\u043b\u043e\u0432\u0430 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0443\u0440\u0430. \u0423\u0432\u0435\u0440\u044f\u044e, \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u044c\u0441\u044f \u0437\u0434\u043e\u0440\u043e\u0432\u043e. \tdraw\u0421ircle(ctx, {x:0,y:0}, radius, whiteColor, (Math.sRandom(0, 100) &lt; 95 ? blackColor : whiteColor), Math.sRandom(2,5)); }, scaleCircle); <\/code><\/pre>\n<p>  \u0412\u043e\u0442\u044c \u0438 \u0433\u043e\u043b\u043e\u0432\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c. <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/090\/aef\/705\/090aef705e1597619e3ad99f41501e86.png\"\/><br \/>  \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435!  <\/p>\n<h4>\u0428\u0430\u0433 2 \u2014 \u0423\u0448\u0438<\/h4>\n<p>  \u0423\u0448\u0438 \u0443 \u043a\u043e\u0442\u043e\u0432 \u2014 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0440\u0434\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0443\u0448\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u0435, \u043f\u043e \u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044b, \u0440\u0430\u0437\u043d\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<br \/>  \u0414\u0435\u043b\u0430\u0435\u043c.  <\/p>\n<pre><code class=\"javascript\">\t\/\/\u0412\u0435\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c, \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0442\u043e\u0447\u0435\u043a \u0443\u0448\u0435\u0439 \tvar dir = {x:0, y:radius}; \t\/\/\u041f\u0435\u0440\u0432\u044b\u0439 \u0443\u0433\u043e\u043b     var angleOne = Math.PI + Math.PI\/Math.sRandom(2, 5);     \/\/\u041f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443     var pointR1 = VectorRot(dir, angleOne);     \/\/\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0432\u043e\u0440\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0443\u0433\u043e\u043b \u043c\u0438\u043d\u0443\u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435     var pointR2 = VectorRot(dir, angleOne - Math.PI\/Math.sRandom(4, 7));     \/\/\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0442\u043e\u0447\u043a\u0443 \u0443\u0445\u0430     var topPointR = {x:((pointR1.x + pointR2.x) \/ 2)+Math.sRandom(-10, 10), y:pointR2.y - 30 + Math.sRandom(0, 5)};     \/\/\u0420\u0438\u0441\u0443\u0435\u043c \tadd(function(ctx){ \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0435 \u0443\u0445\u043e \t    ctx.beginPath();         ctx.strokeStyle = strokeColor;         ctx.fillStyle = fillColor;         ctx.lineWidth = Math.sRandom(2, 4);         topPointR = {x:topPointR.x+Math.sRandom(-1,5), y:topPointR.y+Math.sRandom(-5,5)}; \t\tctx.moveTo(center.x + pointR1.x,center.y + pointR1.y); \t\tctx.lineTo(center.x + topPointR.x,center.y + topPointR.y); \t\tctx.lineTo(center.x + pointR2.x,center.y +pointR2.y); \t\tctx.fill(); \t\tctx.stroke(); \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \u043b\u0435\u0432\u043e\u0435 \u0443\u0445\u043e     \tctx.beginPath();         ctx.strokeStyle = strokeColor;         ctx.fillStyle = fillColor;         ctx.lineWidth = Math.sRandom(2, 4);         var topPointL = VectorXInvert({x:topPointR.x+Math.sRandom(-5,5), y:topPointR.y+Math.sRandom(-5,5)});         var pointL1 = VectorXInvert(pointR1);         var pointL2 = VectorXInvert(pointR2); \t\tctx.moveTo(center.x + pointL1.x,center.y + pointL1.y); \t\tctx.lineTo(center.x + topPointL.x,center.y + topPointL.y); \t\tctx.lineTo(center.x + pointL2.x,center.y +pointL2.y); \t\tctx.fill(); \t\tctx.stroke();   \t}, {x:1,y:1}); <\/code><\/pre>\n<p>  \u0418\u0438\u0438\u0438\u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/72d\/525\/336\/72d525336d3dca0870b028030343a66f.png\"\/><br \/>  \u0423\u0436\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u0442\u0430, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<h4>\u0428\u0430\u0433 3 \u2014 \u0423\u0441\u044b<\/h4>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0441\u043b\u0435 \u0443\u0448\u0435\u0439, \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u043e\u0440\u0434\u044b \u043a\u043e\u0442\u0430. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041e\u0434\u043d\u0438\u043c \u0440\u0430\u043d\u0434\u043e\u043c\u043e\u043c \u0442\u0443\u0442 \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0451\u0448\u044c\u0441\u044f, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0446\u0438\u043a\u043b, \u0438 \u043f\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0443 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438, \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"javascript\">\t\/\/\u0420\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u043e\u0432 \t\/\/\u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u043e\u0447\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\/\/\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 - \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0430 \tvar pointsR = []; \t\/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0443\u0441\u043e\u0432 \tvar count = Math.floor(Math.sRandom(3, 5)); \tfor (var i = 0; i &lt; count; i++) { \t\t\/\/\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440, \u0441 \u0434\u043b\u0438\u043d\u043e\u0439 \u0438\u0437 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u043a\u0440\u0443\u0433\u0430 \/ \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\tvar dir = {x:0, y:radius\/Math.sRandom(1.6,1.9)}; \t\t\/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0443\u0433\u043e\u043b, \u043f\u043b\u044e\u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b \t\tvar angleOne = Math.PI\/(2 + ((i+1)\/4)); \t\t\/\/\u041f\u0432\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \t\tvar pointR1 = VectorRot(dir, angleOne); \t\t\/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c y \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 count \u0443\u0441\u044b \u043e\u0442\u043b\u043e\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \t\t\/\/\u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \t\tvar y = pointR1.y+(i &lt; count \/ 2 ? -Math.sRandom(8, 25) : Math.sRandom(7, 15) ); \t\t\/\/\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \t\tpointsR.push({begin:pointR1, end:{x:pointR1.x - Math.sRandom(60, 100),y:y}}); \t} \t\/\/\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0448\u0438\u0440\u0438\u043d\u044b \u043b\u0438\u043d\u0438\u0438 \tvar lineWidth = Math.sRandom(0.5, 2); \t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \tadd(function(ctx){ \t\t\/\/\u041f\u0440\u0430\u0432\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \t\tfor (var i = 0; i &lt; pointsR.length; i++) { \t\t\tctx.beginPath(); \t        ctx.strokeStyle = strokeColor; \t        ctx.fillStyle = fillColor; \t        ctx.lineWidth = lineWidth; \t\t\tctx.moveTo(center.x - pointsR[i].begin.x,center.y + pointsR[i].begin.y); \t\t\tctx.lineTo(center.x - pointsR[i].end.x,center.y + pointsR[i].end.y); \t\t\tctx.stroke(); \t\t} \t\t\/\/\u041b\u0435\u0432\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \t    for (var i = 0; i &lt; pointsR.length; i++) { \t\t\t \t\t\tctx.beginPath(); \t        ctx.strokeStyle = strokeColor; \t        ctx.fillStyle = fillColor; \t        ctx.lineWidth = lineWidth; \t        var pointLBegin = VectorXInvert(pointsR[i].begin); \t        var pointLEnd = VectorXInvert(pointsR[i].end); \t\t\tctx.moveTo(center.x - pointLBegin.x,center.y + pointLBegin.y); \t\t\tctx.lineTo(center.x - pointLEnd.x,center.y + pointLEnd.y); \t\t\tctx.stroke(); \t\t}  \t}, {x:1,y:1}); <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f VectorXInvert \u043f\u0443\u0441\u0442\u044c \u0432\u0430\u0441 \u043d\u0435 \u0441\u043c\u0443\u0449\u0430\u0435\u0442, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0447\u0430\u0441\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e x \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 x = -x;<br \/>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u043a\u043e\u0442:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/0fb\/4d2\/373\/0fb4d2373e1b961a66baa82a8510e1f2.png\"\/>  <\/p>\n<h4>\u0428\u0430\u0433 4 \u2014 \u0420\u043e\u0442<\/h4>\n<p>  \u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u043d\u0438\u044e \u0440\u0442\u0430, \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0438\u0441\u0443\u043d\u043a\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0439\u0434\u0435\u0442.<br \/>  \u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0439 \u043b\u0438\u043d\u0438\u044e \u0440\u0442\u0430. \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430 \u043a\u0440\u0438\u0432\u044b\u0445 \u0411\u0435\u0437\u044c\u0435.  <\/p>\n<pre><code class=\"javascript\">\t\/\/---\u0420\u043e\u0442 \t\/\/\u0420\u043e\u0442 \u0441\u0442\u0440\u043e\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0438\u0432\u044b\u0445 \u0411\u0435\u0437\u044c\u0435. \u0417\u0430\u0434\u0430\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u043e\u0447\u043a\u0438 + 2 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f \t\/\/      P0 \t\/\/  P3  |   iP3 \t\/\/  |   |    | \t\/\/  P2--P1--iP2 \tvar P0 = {x:center.x, y:center.y}; \tvar P1 = {x:center.x, y:center.y + Math.sRandom(40, 65)}; \tvar P2 = {x:center.x - Math.sRandom(29, 36),y: center.y + 40}; \tvar P3 = {x:center.x - Math.sRandom(20, 40), y:center.y + Math.sRandom(23, 28)}; \tvar iP2 = {x:center.x + Math.sRandom(29, 36),y: center.y + 40}; \tvar iP3 = {x:center.x + Math.sRandom(20, 40), y:center.y + Math.sRandom(23, 28)}; \t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \tadd(function(ctx){ \t    ctx.beginPath();         ctx.strokeStyle = strokeColor;         ctx.fillStyle = fillColor ;         ctx.lineWidth = Math.sRandom(1,3); \t\tctx.moveTo(P0.x,P0.y ); \t\tctx.bezierCurveTo(P1.x, P1.y, P2.x, P2.y, P3.x, P3.y); \t\tctx.stroke();  \t    ctx.beginPath();         ctx.strokeStyle = strokeColor;         ctx.fillStyle = fillColor ;         ctx.lineWidth = Math.sRandom(1,3); \t\tctx.moveTo(P0.x,P0.y ); \t\t \t\tctx.bezierCurveTo(P1.x, P1.y, iP2.x, iP2.y, iP3.x, iP3.y); \t\tctx.stroke();   \t}, {x:1,y:1}); <\/code><\/pre>\n<p>  \u0413\u043b\u044f\u0434\u0438\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0422\u0435\u0440\u043f\u0435\u043d\u0438\u0435, \u0435\u0449\u0451 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c!<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/b6f\/5dc\/857\/b6f5dc8577f1b893c9a6b830ac1826cb.png\"\/>  <\/p>\n<h4>\u0428\u0430\u0433 5 \u2014 \u041d\u043e\u0441<\/h4>\n<p>  \u041d\u043e\u0441 \u0435\u0441\u0442\u044c \u043d\u043e\u0441. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0440\u0443\u0433, \u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u0447\u0435\u043a. \u041a\u0440\u0443\u0433 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0435. \u041d\u0443 \u0442\u0430\u043a, \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430.<br \/>  \u0420\u0430\u0437\u0443\u043c\u0435\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0448\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u043d\u0434\u043e\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432 \u0446\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u043e\u0441\u044b \u2014 \u0437\u0430\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u044b\u0435, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u0442\u0443\u0440. \u041d\u0430\u043c \u0432\u0435\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0442\u043e\u0432?  <\/p>\n<pre><code class=\"javascript\">\t\/\/\u0414\u0432\u0430 \u0442\u0438\u043f\u0430 \u043d\u043e\u0441\u0430 - \u043b\u0438\u0431\u043e \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u043b\u0438\u0431\u043e \u043a\u0440\u0443\u0433 \tvar chance = Math.sRandom(0, 100); \tif(chance &lt; 98) \t{ \t\t\/\/\u041a\u043e\u0435\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \t\tvar scale = {x:Math.sRandom(0.9,1.3), y:Math.sRandom(0.9,1.3)}; \t\t\/\/\u041f\u0440\u0430\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \t\tvar pointR ={x:Math.sRandom(4,5)*scale.x,y:Math.sRandom(-5,-4)*scale.y}; \t\t\/\/\u041b\u0435\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \t\tvar pointL ={x:Math.sRandom(-4,-5)*scale.x,y:Math.sRandom(-5,-4)*scale.y}; \t\t\/\/\u041d\u0438\u0436\u043d\u044f\u044f \u0442\u043e\u0447\u043a\u0430 \t\tvar bottomPoint ={x:0,y:Math.sRandom(5,6)*scale.y}; \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \t\tadd(function(ctx){ \t\t    ctx.beginPath(); \t        ctx.strokeStyle = strokeColor; \t        ctx.fillStyle = (Math.sRandom(0, 100) &gt; 50 ? fillColor : strokeColor); \t        ctx.lineWidth = Math.sRandom(1,3); \t\t\tctx.moveTo(center.x + pointR.x,center.y + 5 + pointR.y); \t\t\tctx.lineTo(center.x + bottomPoint.x,center.y + 5 + bottomPoint.y); \t\t\tctx.lineTo(center.x + pointL.x,center.y + 5 + pointL.y); \t\t\tctx.closePath(); \t\t\tctx.fill(); \t\t\tctx.stroke();  \t\t}, {x:1,y:1}); \t} \telse \t{ \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \u043a\u043e\u0442 \t\tadd(function(ctx){ \t\t\tdraw\u0421ircle(ctx, {x:0,y:0}, Math.sRandom(7, 10), strokeColor, strokeColor, 1); \t\t}, {x:1,y:1}); \t} <\/code><\/pre>\n<p>  \u041d\u0430\u0448 \u043a\u043e\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0442\u0430. \u042d\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/942\/a4d\/4a6\/942a4d4a68b6e7bb756780fa92d15c84.png\"\/>  <\/p>\n<h4>\u0428\u0430\u0433 6 \u2014 \u0413\u043b\u0430\u0437\u0430<\/h4>\n<p>  \u0413\u043b\u0430\u0437\u0430 \u0448\u0442\u0443\u043a\u0430 \u0441\u043b\u043e\u0436\u043d\u0430\u044f. \u041d\u0435\u0442, \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0435 \u043a\u0440\u0438\u0432\u044b\u0445 \u0411\u0435\u0437\u044c\u0435. \u041d\u043e \u043d\u0430\u0434\u043e \u0435\u0449\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0433\u043b\u0430\u0437\u0430, \u043a\u043e\u0442\u0438\u043a \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0442\u044c, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043e\u0434\u0438\u043d \u0433\u043b\u0430\u0437 \u043f\u0440\u0438\u043e\u0442\u043a\u0440\u044b\u0442\u044c. \u0418 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u0442, \u0431\u0435\u0437 \u043a\u043e\u0434\u0430. \u0418\u0431\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c, \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043a\u0443\u0447\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0433\u043b\u044f\u0434\u0438\u0442. \u0410 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/ea7\/bd8\/c6d\/ea7bd8c6d683a866871c02a340f69bc4.png\"\/><\/p>\n<p>  \u041a\u043e\u0442 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043a\u043e\u0440.  <\/p>\n<h4>\u0428\u0430\u0433 7 \u2014 \u0422\u043e\u0447\u043a\u0438 \u0443\u0441\u043e\u0432 \u043d\u0430 \u0449\u0435\u043a\u0430\u0445<\/h4>\n<p>  \u0417\u043d\u0430\u0435\u0442\u0435, \u0431\u044b\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 100%. \u0412\u043e\u0442 \u043a\u043e\u0434, \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  \u041a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438\u0435 \u043e\u0442 \u043d\u043e\u0441\u0430.  <\/p>\n<pre><code class=\"javascript\">\tif(Math.sRandom(0, 100) &gt; 60) \t{ \t\tadd(function(ctx){  \t\t\tfor (var i = 0; i &lt; Math.sRandom(5, 7); i++) { \t\t\t\tvar P = {x:Math.sRandom(20, 40),y:Math.sRandom(0, 30)}; \t\t\t\tdraw\u0421ircle(ctx, P, 1, strokeColor, strokeColor, 1); \t\t\t} \t\t    for (var i = 0; i &lt; Math.sRandom(5, 7); i++) { \t\t\t\tvar P = {x:-Math.sRandom(20, 40),y:Math.sRandom(0, 30)}; \t\t\t\tdraw\u0421ircle(ctx, P, 1, strokeColor, strokeColor, 1); \t\t\t}  \t\t}, {x:1,y:1}); \t} <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/3a2\/d3f\/d13\/3a2d3fd135791347861c6e3002fbdce0.png\"\/><\/p>\n<h4>\u0428\u0430\u0433 8 \u2014 \u00ab\u0427\u0435\u043b\u043a\u0430\u00bb<\/h4>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0440\u0438\u0441\u0443\u0435\u043c \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u043b\u0438\u043d\u0438\u0439 \u0441\u0432\u0435\u0440\u0445\u0443. \u041d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445 \u0442\u044f\u0436\u0435\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"javascript\"> \tif(Math.sRandom(0, 100) &gt; 75) \t{ \t\tadd(function(ctx){  \t\t\t \t\t\tfor (var i = 0; i &lt; Math.sRandom(3, 5); i++) { \t\t\t\t\/\/\u0411\u0435\u0440\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0432\u043d\u044b\u0439 \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u0440\u0430\u0434\u0438\u0443\u0441\u0443 \t\t\t\tvar radiusVector = {x:0,y:-radius}; \t\t\t\t\/\/\u041f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \t\t\t\t\/\/\u041d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u043b\u043e\u0441\u044b \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u0438 \u0440\u043e\u0432\u043d\u043e \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \t\t\t\tradiusVector = VectorRot(radiusVector, Math.sRandom(-0.01, 0.01)) \t\t\t\t\/\/\u0421\u0442\u0440\u043e\u0438\u043c \u043d\u0438\u0436\u043d\u0438\u0438 \u0442\u043e\u0447\u043a\u0438 \t\t\t\tvar P0 = {x:Math.sRandom(-25, 25), y: radiusVector.y}; \t\t\t\tvar P1 = {x:Math.sRandom(-25, 25), y: Math.sRandom(-50, -40)}; \t\t\t\t\/\/\u0428\u0438\u0440\u0438\u043d\u0430 \u0432\u043e\u043b\u043e\u0441\u0430 \t\t\t\tvar lineWidth = Math.sRandom(0.5, 1.5); \t\t\t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \t\t\t\tdrawLine(ctx, P0, P1, strokeColor, strokeColor, lineWidth); \t\t\t}  \t\t}, {x:1,y:1}); \t} <\/code><\/pre>\n<p>  \u0417\u0434\u043e\u0440\u043e\u0432\u043e, \u043f\u0440\u0430\u0432\u0434\u0430? <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/bcf\/2f2\/b18\/bcf2f2b18c85dc665f478b9e0a4a011f.png\"\/>  <\/p>\n<h4>\u0428\u0430\u0433 8 \u2014 \u041a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u0447\u0438\u043a \u0438\u043b\u0438 \u0431\u0430\u043d\u0442\u0438\u043a<\/h4>\n<p>  \u041d\u0443 \u0430 \u044d\u0442\u043e \u0443\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u044f \u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e\u0431\u044b \u0435\u0449\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0438 \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u0430\u043d\u0442\u0438\u043a \u0438 \u043a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u0447\u0438\u043a. \u041d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e, \u044f \u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \ud83d\ude42<br \/>  \u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u0434, \u043f\u043e\u0442\u043e\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438.  <\/p>\n<pre><code class=\"javascript\">\t\/\/\u0414\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 \t\/\/\u041b\u0438\u0431\u043e \u0431\u0430\u0431\u043e\u0447\u043a\u0430 \u043b\u0438\u0431\u043e \u043a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u0447\u0438\u043a \tvar chanceBottom = Math.sRandom(0, 100); \tif(chanceBottom &gt; 50) \t{  \t\tvar chance = Math.sRandom(0, 100); \t\tif(chance &gt; 90) \t\t{ \t\t\t\/\/\u0411\u0430\u0431\u043e\u0447\u043a\u0430 - \u0434\u0432\u0430 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 + \u043a\u0440\u0443\u0433, \u0441 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u0434\u0438\u043f\u0430\u0437\u0430\u043e\u043d\u0435 \t\t\tvar P = {x:0,y:radius}; \t\t\tvar P0 = {x:Math.sRandom(20, 45), y:radius- Math.sRandom(13, 22)}; \t\t\tvar P1 = {x:Math.sRandom(20, 45), y:radius+ Math.sRandom(13, 22)}; \t\t\tadd(function(ctx){ \t\t\t\t\t \t\t\t\tvar color = (Math.sRandom(0, 100) &gt; 50 ? fillColor : strokeColor); \t\t\t    ctx.beginPath(); \t\t    \tctx.strokeStyle = strokeColor; \t\t    \tctx.fillStyle = color; \t\t    \tctx.lineWidth = Math.sRandom(2, 5); \t\t\t\tctx.moveTo(center.x + P.x,center.y + P.y); \t\t\t\tctx.lineTo(center.x + P0.x,center.y + P0.y); \t\t\t\tctx.lineTo(center.x + P1.x,center.y + P1.y); \t\t\t\tctx.closePath(); \t\t\t\tctx.stroke(); \t\t\t\tctx.fill();  \t\t\t\tctx.beginPath(); \t\t    \tctx.strokeStyle = strokeColor; \t\t    \tctx.fillStyle = color; \t\t    \tctx.lineWidth = Math.sRandom(2, 5); \t\t\t\tctx.moveTo(center.x - P.x,center.y + P.y); \t\t\t\tctx.lineTo(center.x - P0.x,center.y + P0.y); \t\t\t\tctx.lineTo(center.x - P1.x,center.y + P1.y); \t\t\t\tctx.closePath(); \t\t\t\tctx.stroke(); \t\t\t\tctx.fill();  \t\t\t\tdraw\u0421ircle(ctx, P, Math.sRandom(6, 12), (Math.sRandom(0, 100) &gt; 50 ? fillColor : strokeColor), strokeColor, Math.sRandom(1, 3));  \t\t\t}, {x:1,y:1}); \t\t} \t} \telse \t{ \t\t\/\/\u041a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u0447\u0438\u043a \t\tvar chance = Math.sRandom(0, 100); \t\tif(chance &gt; 90) \t\t{ \t\t\t\/\/\u041a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u0447\u0438\u043a - \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u0432\u043d\u0438\u0437\u0443 \u0441 \u043a\u0440\u0443\u0433\u043e\u043c. \u0421\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e \u0442\u0440\u0451\u043c \u0442\u043e\u0447\u043a\u0430\u043c, \u0432\u0441\u0451 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435 \t\t\tvar P = {x:0,y:radius}; \t\t\tvar P0 = {x:Math.sRandom(8, 15), y:radius+ Math.sRandom(23, 29)}; \t\t\tvar P1 = {x:-P0.x, y:P0.y}; \t\t\tvar P3 = {x:0,y:P0.y + Math.sRandom(0, 7)}; \t\t\tadd(function(ctx){  \t\t\t\tdraw\u0421ircle(ctx, P3, Math.sRandom(2, 6), (Math.sRandom(0, 100) &gt; 50 ? fillColor : strokeColor), strokeColor, Math.sRandom(1, 3));  \t\t\t\tvar color = (Math.sRandom(0, 100) &gt; 50 ? fillColor : strokeColor); \t\t\t    ctx.beginPath(); \t\t    \tctx.strokeStyle = strokeColor; \t\t    \tctx.fillStyle = color; \t\t    \tctx.lineWidth = Math.sRandom(2, 5); \t\t\t\tctx.moveTo(center.x + P.x,center.y + P.y); \t\t\t\tctx.lineTo(center.x + P0.x,center.y + P0.y); \t\t\t\tctx.lineTo(center.x + P1.x,center.y + P1.y); \t\t\t\tctx.closePath(); \t\t\t\tctx.stroke(); \t\t\t\tctx.fill();  \t\t\t}, {x:1,y:1}); \t\t} \t} <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b.<br \/>  \u041a\u043e\u0434 \u0431\u044b\u043b \u0431\u044b \u0441\u043a\u0443\u0447\u0435\u043d, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u0442\u043e\u0432, \u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0442 \u0441 \u0431\u0430\u043d\u0442\u0438\u043a\u043e\u043c!<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/e5f\/31f\/f04\/e5f31ff0460e498e0fdbf59dca3a8dc0.png\"\/><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b \u044f \u0441\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e \u043a\u043e\u0442\u0430\u0445.<br \/>  \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/MagistrAVSH\/random-cat\">github.com\/MagistrAVSH\/random-cat<\/a><br \/>  \u0410 \u0432\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0441\u0435\u0445 \u0442\u0440\u0443\u0434\u043e\u0432, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0449\u0435\u043b\u043a\u0430\u0442\u044c: <a href=\"http:\/\/magistravsh.github.io\/random-cat\/\">magistravsh.github.io\/random-cat\/<\/a><br \/>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0440\u044b\u0441\u044c \u043e\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430, \u0438 \u043f\u043e\u0433\u043b\u0430\u0434\u044c \u043a\u043e\u0442\u0430! \ud83d\ude42 \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/195142\/\"> http:\/\/habrahabr.ru\/post\/195142\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/ac4\/16d\/776\/ac416d7764f22ca79f8124e67bf955e3.jpg\"\/><br \/>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0425\u0430\u0431\u0440!<br \/>  \u042f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u0438\u043b \u043a\u043e\u0442\u043e\u0432, \u0438 \u043b\u044e\u0431\u0438\u043b \u0438\u0445 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u043e\u0440\u0434\u044b \u043a\u043e\u0448\u0430\u0447\u044c\u0438. \u0427\u0443\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0448\u044c \u0444\u043e\u0440\u043c\u0443, \u043b\u0438\u043d\u0438\u044e \u2014 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0434\u0440\u0443\u0433\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435. \u0423 \u043c\u0435\u043d\u044f \u043b\u0438\u0441\u0442\u044b \u04104 \u0431\u044b\u043b\u0438 \u0438\u0437\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0434 \u043f\u0440\u0435\u0434\u0435\u043b. \u0418 \u0442\u0443\u0442 \u043c\u043d\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u0442\u0443\u043a\u043d\u0443\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0440\u0434 \u043a\u043e\u0442\u043e\u0432? \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443 \u0438 \u0442\u0435\u0431\u0435 \u0432\u044b\u043a\u0438\u043d\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043c\u043e\u0440\u0434\u0430 \u043a\u043e\u0442\u0430. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443. <br \/>  \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0438 \u043a\u043e\u0442\u043e\u0432.  <\/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-195142","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195142","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=195142"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195142\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}