(cX, cY, vol)
| 37 | $(Math.floor(cnv.width / 2), Math.floor(cnv.height / 2), 7); |
| 38 | |
| 39 | function $(cX, cY, vol) { |
| 40 | var x = 0, y = 0, f; |
| 41 | ctx.beginPath(); |
| 42 | |
| 43 | for (var cr = 0; cr <= 360; cr += 0.01) { |
| 44 | f = vol * (4 + Math.sin(5 * cr) + |
| 45 | 0.5 * Math.sin(10 * cr) + |
| 46 | 1 / 6 * Math.sin(60 * cr) |
| 47 | ) * (cr / 50 + 1); |
| 48 | x = Math.floor(f * Math.cos(cr) + cX); |
| 49 | y = Math.floor(f * Math.sin(cr) + cY); |
| 50 | |
| 51 | if (cr == 0) ctx.moveTo(x, y); |
| 52 | ctx.lineTo(x, y); |
| 53 | } |
| 54 | ctx.stroke(); |
| 55 | } |
| 56 | </script> |
| 57 | </body> |
| 58 | </html> |
no test coverage detected