效果
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ff5b495a5cb0ecd124a240befff689a3.png)
代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<canvas id="can" width="800" height="600" style="margin: 100px"></canvas>
</body>
<script>
var context = document.getElementById("can").getContext("2d");
context.fillStyle = "pink";
var points=new Array();
for (i=-1.7655;i<1.7655;i+=0.001){
let point = new Object();
point.x=i;
point.y=fxy(i);
points.push(point);
}
for(i=0;i<points.length;i++){
draw(points[i].x,points[i].y,50)
}
function draw(x,y,r){
context.beginPath();
context.arc((x*140-4)+400,(y*100-4)+300,r,0,2*Math.PI);
context.fill();
}
function fxy(x){
y=-Math.cbrt(x)*Math.cbrt(x)+Math.sin(16*Math.PI*x)*Math.sqrt(Math.PI-x*x)*(2.71828/3);
return y;
}
</script>
</html>