PLAYGROUND (experimental)

superformula

Draw a super formula
superformula(
    x, 
    y, 
    a, 
    b, 
    m, 
    n1, 
    n2, 
    n3, 
    radius, 
    [draw=true], 
    [stroke=#000000], 
    [fill=#FFFFFF], 
    [weight=1.00]
)

Draw a super formula

Syntaxe

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

Arguments

NameTypeRequiredDefaultDescription
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-#000000Stroke color
fill-#FFFFFFFill color
weight-1.00Stroke 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(whoami(png=true));

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...]