Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let koef = [6, 0, -4, -3, 5, 6, -6, -13, 7, 44, 64, 44, 7, -13, -6, 6, 5, -3, -4, 0, 6];
- let points = [];
- let m = 2.0;
- while (m < 22.0) {
- let x = 0;
- let y = 0;
- let actual_x = 0;
- let actual_y = 0;
- koef.forEach((k, i) => {
- x += k * Math.cos(2 * Math.PI * (i / m) );
- y += k * Math.sin(2 * Math.PI * (i / m) );
- });
- actual_x = (2/m);
- actual_y = 20 * Math.log10(Math.sqrt(Math.pow(x,2) + Math.pow(y,2)));
- points.push({
- x: actual_x,
- y: actual_y
- });
- m += 0.01
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement