Why "Shamrock"?
The shamrock ☘ is the three-leaf symbol of Ireland, famously used by Saint Patrick to explain the Trinity. Unlike SWClover's epicycloid equations (which trace smooth, cusp-pointed petals), SWShamrock uses a polar equation whose dominant term naturally creates three rounded, organic-looking lobes — resembling real clover leaves more closely than any epicycloid can.
The Polar Parametric Equations
SWShamrock is defined by a polar curve. The radius at each angle θ is:
SCALE = 1.31 (empirical sizing constant)
r(θ) = SCALE · radius · (sin(3θ/2) + sin(9θ/2)/5)²
x(θ) = r(θ) · cos(θ)
y(θ) = r(θ) · sin(θ)
θ ∈ [0, 2π)
Why Three Lobes?
The dominant term sin(3θ/2) has period 4π/3 and passes through zero at θ = 0, 2π/3, 4π/3, and 2π. Because the formula squares the result, these zeros become the pinch points between the three lobes. The secondary term sin(9θ/2)/5 (amplitude 20% of the dominant term) adds subtle ruffling and slight asymmetry to each lobe, giving the shamrock its distinctive organic silhouette rather than a perfectly smooth petal shape.
Comparison with SWClover
| Feature | SWClover | SWShamrock |
| Equation type | Epicycloid (Cartesian parametric) | Polar parametric |
| Lobe count | Variable (2–8) | Fixed (3) |
| Lobe tips | Sharp cusps | Soft, rounded |
| Silhouette | Geometric / symmetrical | Organic / slightly ruffled |
| Default rotation | 0° | 30° (one lobe points up) |
| Optional stem | No | Yes |
Polar Curves in Mathematics
A polar curve r(θ) expresses the distance from the origin as a function of angle. Famous polar curves include:
- Rose curves: r = cos(nθ) or r = sin(nθ) — produce n petals (n odd) or 2n petals (n even).
- Cardioid: r = 1 − cos(θ) — the heart-shaped curve from rolling a circle of equal radius.
- Lemniscate of Bernoulli: r² = cos(2θ) — the figure-eight infinity symbol (∞).
- Archimedean spiral: r = a + bθ — equal spacing between turns.
SWShamrock's equation uses half-angle arguments (3θ/2 and 9θ/2) that would normally create non-integer petal counts. The squaring trick — (sin(3θ/2) + …)² — folds the negative half-cycles into positive ones, producing the three lobes in a single [0, 2π) pass.
The Stem
Toggling Show Stem draws a SWSpire shape — a cusp-pointed arch — whose apex is anchored at the shamrock's center. The stem rotates with the figure, so its direction is always relative to the current orientation. Four sliders let you adjust the stem's length, width, cusp sharpness, and angle offset independently of the body rotation. Try enabling Spin with the stem visible to see it sweep like a clock hand!
Using the Controls
- Radius — scales the overall size. The SCALE factor (1.31) is applied internally.
- Rotation — the base orientation in CCW degrees. Default 30° puts one lobe at the top.
- Show Stem — toggles the SWSpire stem whose apex touches the center.
- Stem Length — how far the stem extends from the center (0.5–9 grid units).
- Stem Width — the lateral width of the spire arch (0.1–2 grid units).
- Cusp Shape — the power exponent controlling tip sharpness (1 = round, 11 = sharp).
- Stem Angle — rotates the stem relative to the body orientation (−180° to +180°).
- Breathe (accordion) — sinusoidally oscillates the radius. Speed sets Hz; Amount sets the radius swing in grid units.
- Spin (accordion) — continuously rotates the shamrock. Combine with Breathe for complex patterns.
- Drag the center dot to reposition the figure.
- Click the canvas to toggle the grid on/off.
Keyboard Shortcuts
- s — Toggle spin
- b — Toggle breathe
- r — Factory reset
- q — Stop all animations