Phyllotactic Spiral in TurtleToy
Moire 1:
Phyllotactic Spiral (variation)
Moire2:
Phyllotactic Spiral (variation)
Moire3:
Phyllotactic Spiral (variation)
Square:
Phyllotactic Spiral (variation)
Hexagon:
Phyllotactic Spiral (variation)
Polygon:
Phyllotactic Spiral (variation)
Twirl:
Phyllotactic Spiral (variation)
Spiral:
Phyllotactic Spiral (variation)
Mandala:
Phyllotactic Spiral (variation)
Star:
Phyllotactic Spiral (variation)
Triangle:
Phyllotactic Spiral (variation)
Rhombus:
Phyllotactic Spiral (variation)
Post more in the comments ☟
Log in to post a comment.
// Forked from "Phyllotactic Spiral" by Samolevsky
// https://turtletoy.net/turtle/176d80f96a
// Phyllotactic Spiral in TurtleToy
Canvas.setpenopacity(1);
const turtle = new Turtle();
// Constants
const rotation = 65.5;// min=1, max=360, step=0.05 // Angle in degrees
const scale = 3.26; // min=0.01, max=20, step=0.01 // Scaling factor for distance from center
const totalPoints = 588; // min=0.01, max=1000, step=1 // Total number of points in the spiral
const nudge = 0.40; // min=-2, max=2, step=0.1
// Draw the Phyllotactic Spiral
for (let i = 0; i < totalPoints; i++) {
const angle = i * rotation;
const radius = scale * Math.sqrt(i);
const x = radius * Math.sin(angle * Math.PI / 180 + nudge);
const y = radius * Math.cos(angle * Math.PI ) * Math.cos(angle * Math.PI / 180 + nudge);
if (i === 0) {
turtle.jump(x, y);
} else {
turtle.goto(x, y);
}
}
function loop() {
return false;
}