Code:
reduceDenominator(numerator, denominator) {
function rec(a, b) {
return b ? rec(b, a % b) : a;
}
return denominator / rec(numerator, denominator);
}
rose() {
let k = this.d / this.m;
for (
let theta = 0;
theta < TWO_PI * this.reduceDenominator(this.d, this.m);
theta += 0.02
) {
let r = this.r * cos(k * theta);
let x = r * cos(theta);
let y = r * sin(theta);
this.points.push(createVector(x, y));
}
} ![]() Mango leaf ruleset with rose curve |
![]() ADH231a ruleset with rose curve |
![]() Quadratic snowflake ruleset with rose curve |
![]() Skierpinski carpet rule-set with rose curve |




