Skip to content

Instantly share code, notes, and snippets.

@tkamishima
Last active July 20, 2023 13:27
Show Gist options
  • Save tkamishima/17f4fa0a2888088bf4d43d0c5e7230eb to your computer and use it in GitHub Desktop.
Save tkamishima/17f4fa0a2888088bf4d43d0c5e7230eb to your computer and use it in GitHub Desktop.
Normal distribution on Adobe Illustrator
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