Last active
July 20, 2023 13:27
-
-
Save tkamishima/17f4fa0a2888088bf4d43d0c5e7230eb to your computer and use it in GitHub Desktop.
Normal distribution on Adobe Illustrator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const start = -300; | |
const end = 300; | |
const step = 1; | |
const sigma = 100; | |
var anchorpoint = []; | |
for (var x = start; x <= end; x += step) { | |
var y = 00 * (1 / Math.sqrt(2.0 * Math.PI * sigma * sigma)) * Math.exp(- x * x / (2 * sigma * sigma)); | |
anchorpoint.push([x, y]); | |
} | |
const docObj = activeDocument; | |
var pObj = docObj.pathItems.add(); | |
pObj.setEntirePath(anchorpoint); | |
pObj.filled = false; //塗りなし | |
pObj.stroked = true; //線あり | |
pObj.strokeWidth = 1; //線幅1pt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment