Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 2.1 KB

File metadata and controls

53 lines (44 loc) · 2.1 KB

Heart

To learn more about the heart curve, I recommend watching Daniel Shiffman's Heart Coding Challenge.

heart curve

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));
    }
}

Source

🌄 Gallery

ADH231a ruleset background with box

ADH231a ruleset with heart
Rounded Star with heart

Rounded Star with heart
Snake-kolam ruleset with heart curve

Snake-kolam ruleset with heart curve
Skierpinski rule-set with heart curve

Skierpinski rule-set with heart curve