Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let koef = [6, 0, -4, -3, 5, 6, -6, -13, 7, 44, 64, 44, 7, -13, -6, 6, 5, -3, -4, 0, 6];
  2.     let points = [];
  3.  
  4.     let m = 2.0;
  5.  
  6.      while (m < 22.0) {
  7.  
  8.          let x = 0;
  9.          let y = 0;
  10.  
  11.          let actual_x = 0;
  12.          let actual_y = 0;
  13.  
  14.          koef.forEach((k, i) => {
  15.             x += k * Math.cos(2 * Math.PI * (i / m) );
  16.             y += k * Math.sin(2 * Math.PI * (i / m) );
  17.          });
  18.  
  19.          actual_x = (2/m);
  20.          actual_y = 20 * Math.log10(Math.sqrt(Math.pow(x,2) + Math.pow(y,2)));
  21.  
  22.          points.push({
  23.              x: actual_x,
  24.              y: actual_y
  25.          });
  26.  
  27.          m += 0.01
  28.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement