维科纳蒂 »
×
改变方向
在 Codepen 上打开
更改主题,深色/浅色
<!DOCTYPE html> <html> <script src="../scripts/myplotlib.js"></script> <body> <canvas id="myCanvas" width="400px" height="400px" style="width:100%;max-width:400px;border:1px solid black"></canvas> <script> // Створити плотер const plotter = new XYPlotter("myCanvas"); plotter.transformXY(); const xMax = plotter.xMax; const yMax = plotter.yMax; const xMin = plotter.xMin; const yMin = plotter.yMin; // Створити рандомні XY точки const numPoints = 500; const xPoints = []; const yPoints = []; for (let i = 0; i < numPoints; i++) { xPoints[i] = Math.random() * xMax; yPoints[i] = Math.random() * yMax; } // Нанесіть точки plotter.plotPoints(numPoints, xPoints, yPoints, "blue"); </script> </body> </html>