Code:
hyperbolicTan(theta) {
let l = pow(e, 2 * theta);
return (l - 1) / (l + 1);
}
gear() {
for (let theta = 0; theta < 2 * PI; theta += 0.05) {
let r =
this.a +
(1 / this.b) * this.hyperbolicTan(this.b * sin(this.m * theta));
let x = this.r * r * sin(theta);
let y = this.r * r * cos(theta);
this.points.push(createVector(x, y));
}
}
Sources:
-Mathworld - Gear Curve -Hyperbolic tan function
![]() Krishna anklet with gear curve |
![]() Kolam ruleset with gear curve |
![]() Mango leaf with gear curve |
![]() Skierpinski with gear curve |