{"id":293037,"date":"2019-08-06T15:00:49","date_gmt":"2019-08-06T15:00:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293037"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293037","title":{"rendered":"\u0422\u0440\u044e\u043a \u0441 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0435\u0449\u0435 \u0441\u043e \u0448\u043a\u043e\u043b\u044b:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/74a\/bc7\/64a\/74abc764a952ef9c76e9a91311f0e16f.svg\" alt=\"$\\sin(\\alpha + \\beta) = \\sin\\alpha \\times \\cos\\beta + \\cos\\alpha \\times \\sin\\beta \\\\ \\cos(\\alpha + \\beta) = \\cos\\alpha \\times \\cos\\beta - \\sin\\alpha \\times \\sin\\beta$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432 \u0434\u0435\u0442\u0441\u0442\u0432\u0435 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u0448\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u043c \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u2014 \u043e\u043d\u0430 \u0441\u0430\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f \u0434\u0435\u043b\u0430\u044e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443. \u042d\u0442\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043a \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u0435\u0441\u0435\u043b\u044c\u0435 \u043d\u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043a\u0430\u0436\u0435\u0442\u0435 &#171;\u042d\u0432\u0440\u0438\u043a\u0430!&#187;, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c, \u0430 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p2\/sk\/oc\/p2skocu3scp-y3d9dqv7etb3z4s.jpeg\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0422\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>sin()<\/code> \u0438 <code>cos()<\/code> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u043a\u0440\u0443\u0433\u043b\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0421\u0440\u0435\u0434\u0438 \u043c\u0435\u0441\u0442 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u0440\u0443\u0433\u043e\u0432 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0424\u0443\u0440\u044c\u0435, \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u043b\u043d \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438 \u0432\u043e\u0434\u044b, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0435\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0432\u0443\u043a\u0430, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412\u043e \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 <code>sin()<\/code> \u0438 <code>cos()<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430, \u043a\u0430\u043a \u0442\u0443\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">for(int n=0; n &lt; num; n++) {     const float t = 2.0f*PI*(float)n\/(float)num;     const float s = sinf(t);     const float c = cosf(t);      \/\/ do something with s and c     ... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u0441\u043c. \u043a\u043e\u0434 \u043d\u0438\u0436\u0435), \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043b\u0435\u0433\u0447\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 <code>n<\/code> \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441 \u0444\u0430\u0437\u043e\u0439 <code>t<\/code>, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f, <code>n+1<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c <code>sin()<\/code> \u0438 <code>cos()<\/code> \u0434\u043b\u044f <code>t+f<\/code>. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0443 \u043d\u0430\u0441 \u0441\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u044b <code>sin(t)<\/code> \u0438 <code>cos(t)<\/code> \u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c <code>sin(t+f)<\/code> \u0438 <code>cos(t+f)<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">const float f = 2.0f*PI\/(float)num; const float t = 0.0f; for( int n=0; n &lt; num; n++ ) {     const float s = sinf(t);     const float c = cosf(t);      \/\/ do something with s and c     ...     t += f; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 <code>t<\/code> \u0438 \u043a\u0430\u043a\u043e\u0432 \u0435\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u2014 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9fa\/fb7\/e30\/9fafb7e30b29c7b0de9a5c334ad6dbeb.svg\" alt=\"$[0;2\\pi]$\" data-tex=\"inline\"><\/math>). \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0441 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442, \u0442\u0430\u043a \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>sin()<\/code> \u0438 <code>cos()<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6dd\/85a\/468\/6dd85a46885d1720c52f97b9db1c9a39.svg\" alt=\"$\\frac{2\\pi}{\\text{num}}$\" data-tex=\"inline\"><\/math>). \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>sin()<\/code> \u0438\u043b\u0438 <code>cos()<\/code> (\u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u0446\u0438\u043a\u043b\u0435), \u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>sincos()<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e25\/d83\/749\/e25d837493f287eb7e2bdc3e33e4b7f3.svg\" alt=\"$f = \\alpha$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3a7\/264\/19f\/3a726419fa5a17428aa330f5b9377f34.svg\" alt=\"$t = \\beta$\" data-tex=\"inline\"><\/math>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u043a\u0430\u043a<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">sin(t+f) = sin(f)*cos(t) + cos(f)*sin(t) cos(t+f) = cos(f)*cos(t) - sin(f)*sin(t)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438\u043b\u0438, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">new_s = sin(f)*old_c + cos(f)*old_s new_c = cos(f)*old_c - sin(f)*old_s<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a <code>f<\/code> \u2014 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u0442\u043e <code>sin(f)<\/code> \u0438 <code>cos(f)<\/code> \u0442\u043e\u0436\u0435. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0438\u0445 <code>a<\/code> \u0438 <code>b<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">new_s = b*old_c + a*old_s new_c = a*old_c - b*old_s<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0440\u043e\u0433\u0438\u0445 (\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u0430\u043a\u0438\u0445) \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439!<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">const float f = 2.0f*PI\/(float)num; const float a = cosf(f); const float b = sinf(f); float s = 0.0f; float c = 1.0f; for( int n=0; n &lt; num; n++ ) {     \/\/ do something with s and c     ...      const float ns = b*c + a*s;     const float nc = a*c - b*s;     c = nc;     s = ns; }<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"tolkovanie\">\u0422\u043e\u043b\u043a\u043e\u0432\u0430\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u041a \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u043c\u044b \u0441\u043b\u0435\u043f\u043e \u0438\u0433\u0440\u0430\u043b\u0438 \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/50f\/90b\/240\/50f90b2403d21c84b2617e0670e9a028.svg\" alt=\"$s_{n+1} = s_na + c_nb\\\\ c_{n+1} = c_na - s_nb$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u0432\u0430\u0441 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u2014 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b\u0438 \u044d\u0442\u043e\u0433\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e20\/512\/7e1\/e205127e164c49090e4b0f5d2520b1ca.svg\" alt=\"$ \\left(\\begin{matrix}s_{n+1} \\\\ c_{n+1}\\end{matrix}\\right) = \\left(\\begin{matrix}a &amp; b \\\\ -b &amp; a\\end{matrix}\\right) \\cdot \\left(\\begin{matrix}s_{n} \\\\ c_{n}\\end{matrix}\\right) $\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, <code>sin(t)<\/code> \u0438 <code>cos(t)<\/code> \u043c\u043e\u0436\u043d\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u0438\u043d\u044b 1 \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u0435\u043a\u0442\u043e\u0440 <code>x<\/code>. \u0422\u043e\u0433\u0434\u0430, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/abb\/078\/6c6\/abb0786c6e56eb8175e15aaedf7242ca.svg\" alt=\"$x = \\{\\sin\\beta, \\cos\\beta\\}$\" data-tex=\"inline\"><\/math>. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f9\/b4e\/782\/1f9b4e782c79f33919b15e24dabc33f6.svg\" alt=\"$x_{n+1} = Rx_n$\" data-tex=\"inline\"><\/math>, \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/17c\/c0b\/442\/17cc0b4429e18718378508ea134d0c22.svg\" alt=\"$R = \\left(\\begin{matrix}a&amp;b\\\\-b&amp;a\\end{matrix}\\right)$\" data-tex=\"inline\"><\/math>. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0446\u0438\u043a\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0442\u0430\u043a, \u0447\u0442\u043e <code>x<\/code> \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u0440\u0443\u0433\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430. \u041a\u0430\u0436\u0434\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e <code>x<\/code> \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6dd\/85a\/468\/6dd85a46885d1720c52f97b9db1c9a39.svg\" alt=\"$\\frac{2\\pi}{\\text{num}}$\" data-tex=\"inline\"><\/math> \u0440\u0430\u0434\u0438\u0430\u043d.<br \/>  \u0418\u0442\u0430\u043a, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c,<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/74a\/bc7\/64a\/74abc764a952ef9c76e9a91311f0e16f.svg\" alt=\"$\\sin(\\alpha + \\beta) = \\sin\\alpha \\times \\cos\\beta + \\cos\\alpha \\times \\sin\\beta \\\\ \\cos(\\alpha + \\beta) = \\cos\\alpha \\times \\cos\\beta - \\sin\\alpha \\times \\sin\\beta$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043a\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/abb\/078\/6c6\/abb0786c6e56eb8175e15aaedf7242ca.svg\" alt=\"$x = \\{\\sin\\beta, \\cos\\beta\\}$\" data-tex=\"inline\"><\/math> \u043f\u043e \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0441 \u0448\u0430\u0433\u043e\u043c \u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7fd\/b73\/0d9\/7fdb730d916a98c0ad71826e0bc706bf.svg\" alt=\"$\\beta$\" data-tex=\"inline\"><\/math> \u0440\u0430\u0434\u0438\u0430\u043d. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u0435\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/49b\/c87\/66c\/49bc8766cb3ca9c88a5e4a75753dd02f.svg\" alt=\"$u = \\{\\cos\\beta, \\sin\\beta\\}$\" data-tex=\"inline\"><\/math>. \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u2014 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/784\/f98\/db3\/784f98db37a499162c1479600e8465ed.svg\" alt=\"$u$\" data-tex=\"inline\"><\/math>. \u0422\u0430\u043a \u043a\u0430\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/784\/f98\/db3\/784f98db37a499162c1479600e8465ed.svg\" alt=\"$u$\" data-tex=\"inline\"><\/math> \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b (\u0438\u043c\u0435\u044e\u0442 \u0434\u043b\u0438\u043d\u0443 1), \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044f \u2014 \u0438\u0445 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fb6\/659\/48f\/fb665948f4f9dccb4138e5639a591c0f.svg\" alt=\"$s = x\\cdot u = \\sin\\alpha\\cdot\\cos\\beta + \\cos\\alpha\\cdot\\sin\\beta$\" data-tex=\"inline\"><\/math>, \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u2014 \u0430\u043d\u0442\u0438\u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438, \u0441\u043f\u0440\u043e\u0435\u0446\u0438\u0440\u043e\u0432\u0430\u0432 \u043d\u0430 \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u043e\u0441\u044c, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1c1\/778\/187\/1c1778187263268cc347012d16da61e2.svg\" alt=\"$v$\" data-tex=\"inline\"><\/math>. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0435\u043a\u0442\u043e\u0440, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/784\/f98\/db3\/784f98db37a499162c1479600e8465ed.svg\" alt=\"$u$\" data-tex=\"inline\"><\/math> \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u043a \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0439 \u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b: <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/573\/913\/313\/57391331311154b8b68fb9b2df8a86eb.svg\" alt=\"$c = x\\cdot v = \\cos\\alpha\\cdot\\cos\\beta + \\sin\\alpha\\cdot\\sin\\beta$\" data-tex=\"inline\"><\/math><\/p>\n<p>  <\/p>\n<h1 id=\"primechaniya\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430. \u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2d5\/bde\/2b5\/2d5bde2b5594724d6c903afc066600fa.svg\" alt=\"$|R| = \\left|\\begin{matrix}a&amp;b\\\\-b&amp;a\\end{matrix}\\right| = a^2 + b^2 = \\sin^2\\alpha + \\cos^2\\alpha = 1$\" data-tex=\"inline\"><\/math>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b81\/a7c\/1e9\/b81a7c1e9676b36cc02ddeea5d5f6e51.svg\" alt=\"$R$\" data-tex=\"inline\"><\/math> \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u043d\u0435 \u0442\u043e\u0447\u043d\u044b, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u043f\u0438\u0440\u0430\u043b\u0438 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u0442 \u0441 \u0446\u0435\u043d\u0442\u0440\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0423 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u0438 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0445 <code>num<\/code>, \u0442.\u0435. \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0443\u0433\u043b\u0430\u0445 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430.<\/p>\n<p>  <\/p>\n<h1 id=\"primer\">\u041f\u0440\u0438\u043c\u0435\u0440<\/h1>\n<p>  <\/p>\n<p>\u0412 <a href=\"http:\/\/www.iquilezles.org\/prods\/index.htm#kindercrasher\">Kindercrasher<\/a>, 4096-\u0431\u0430\u0439\u0442\u043d\u043e\u0439 \u0434\u0435\u043c\u043a\u0435 \u0438\u0437 2008 (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043d\u0430 \u041a\u0414\u041f\u0412), \u0433\u0440\u0443\u043f\u043f\u0430 \u0441\u0444\u0435\u0440 \u043f\u0443\u043b\u044c\u0441\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0434 \u043c\u0443\u0437\u044b\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0424\u0443\u0440\u044c\u0435 \u0437\u0432\u0443\u043a\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u044d\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%91%D1%8B%D1%81%D1%82%D1%80%D0%BE%D0%B5_%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5_%D0%A4%D1%83%D1%80%D1%8C%D0%B5\">FFT<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u043e\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u0438\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c. \u0412\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 FFT, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B8%D1%81%D0%BA%D1%80%D0%B5%D1%82%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5_%D0%A4%D1%83%D1%80%D1%8C%D0%B5\">DFT<\/a> \u043f\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0432 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438.<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a47\/4a2\/7b7\/a474a27b7d8b20cb301a428a96dcf3f6.svg\" alt=\"$X_k = \\sum_{n=0}^{N-1}{x_ne^{-\\frac{2\\pi i}{N}kn}}\\quad k=0,1,\\ldots,N-1$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 16-\u0431\u0438\u0442\u043d\u044b\u0439 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0441\u0442\u0435\u0440\u0435\u043e \u0431\u0443\u0444\u0435\u0440, <code>x<\/code>, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 128 \u0447\u0430\u0441\u0442\u043e\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u0437\u0432\u0443\u043a\u0430 <code>y<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0446\u0438\u043a\u043b, \u0442\u043e\u0442, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 4096 \u0440\u0430\u0437: \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>sin()<\/code> \u0438\u043b\u0438 <code>cos()<\/code>, \u0445\u043e\u0442\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u044d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0431\u0443\u0434\u0443\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;math.h&gt; void iqDFT12( float *y, const short *x ) {     for( int i=0; i&lt;128; i++ )     {         const float wi = (float)i*(2.0f*3.1415927f\/4096.0f);         const float sii = sinf( wi );         const float coi = cosf( wi );          float co = 1.0f;         float si = 0.0f;         float acco = 0.0f;         float acsi = 0.0f;         for( int j=0; j&lt;4096; j++ )         {             const float f = (float)(x[2*j+0]+x[2*j+1]);             const float oco = co;             acco += co*f; co = co*coi -  si*sii;             acsi += si*f; si = si*coi + oco*sii;         }         y[i] = sqrtf(acco*acco+acsi*acsi)*(1.0f\/32767.0f);     } }<\/code><\/pre>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \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\/462725\/\"> https:\/\/habr.com\/ru\/post\/462725\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0435\u0449\u0435 \u0441\u043e \u0448\u043a\u043e\u043b\u044b:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/74a\/bc7\/64a\/74abc764a952ef9c76e9a91311f0e16f.svg\" alt=\"$\\sin(\\alpha + \\beta) = \\sin\\alpha \\times \\cos\\beta + \\cos\\alpha \\times \\sin\\beta \\\\ \\cos(\\alpha + \\beta) = \\cos\\alpha \\times \\cos\\beta - \\sin\\alpha \\times \\sin\\beta$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432 \u0434\u0435\u0442\u0441\u0442\u0432\u0435 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u0448\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u043c \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u2014 \u043e\u043d\u0430 \u0441\u0430\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f \u0434\u0435\u043b\u0430\u044e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443. \u042d\u0442\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043a \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u0435\u0441\u0435\u043b\u044c\u0435 \u043d\u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043a\u0430\u0436\u0435\u0442\u0435 &#171;\u042d\u0432\u0440\u0438\u043a\u0430!&#187;, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c, \u0430 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p2\/sk\/oc\/p2skocu3scp-y3d9dqv7etb3z4s.jpeg\"><\/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-293037","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293037","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=293037"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293037\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}