To learn more about the heart curve, I recommend watching Daniel Shiffman's Heart Coding Challenge.
Code:
heart() {
heart() {
for (let theta = 0; theta < 2 * PI; theta += 0.1) {
const x = 0.1 * this.r * 16 * pow(sin(theta), 3);
const y =
0.1 *
-this.r *
(13 * cos(theta) -
5 * cos(2 * theta) -
2 * cos(3 * theta) -
cos(4 * theta));
this.points.push(createVector(x, y));
}
}
ADH231a ruleset with heart |
Rounded Star with heart |
Snake-kolam ruleset with heart curve |
Skierpinski rule-set with heart curve |