TESTER

superformula

superformula(x, y, a, b, m, n1, n2, n3, radius, [draw=true], [stroke], [fill], [weight])

Draw a super formula

Syntaxe

superformula(x=150, y=150, a=120, b=120);

Arguments

NameRequiredDefaultDescription
xyes-x-coordinate
yyes-y-coordinate
ayes-radiusX (a)
byes-radiusY (b)
myes-(m, branches)
n1yes-n1
n2yes-n2
n3yes-n3
radiusyes-radius
draw-trueIf false, return a list of points, and don't draw (stroke, fill & weight are ignored)
stroke--Stroke color
fill--Fill color
weight--Stroke weight (thickness)

Full example

canvas(width=500, height=500, center=true);
fill("#FFA000");

superformula(x=0, y=0, a=1.5, b=1.5, m=3, n1=4.5, n2=10, n3=10, radius=200);

save("superformula.png");

var super = superformula(x=0, y=0, a=1.5, b=1.5, m=3, n1=4.5, n2=10, n3=10, radius=150, draw=false);
console(super); // [[81.1275437785, 0, 81.1283160475, 0.7079960882...]