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
| Name | Required | Default | Description |
|---|---|---|---|
x | yes | - | x-coordinate |
y | yes | - | y-coordinate |
a | yes | - | radiusX (a) |
b | yes | - | radiusY (b) |
m | yes | - | (m, branches) |
n1 | yes | - | n1 |
n2 | yes | - | n2 |
n3 | yes | - | n3 |
radius | yes | - | radius |
draw | - | true | If 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...]
