97

Golden Mathematical Honeybee

Biomimetic simulation of Apis mellifera displaying 230 Hz figure-8 aerodynamic wing strokes, banded golden velvet abdominal segments, and a surrounding hexagonal honeycomb geometric matrix.

Playground
60 FPS Canvas 2D
Click + Drag to interact with field
</>

Full Executable Algorithm Code

// 073 - Golden Mathematical Honeybee (insects)
// 1:1 Original algorithm engine source
function createGoldenHoneybee() {
  return {
    setup() {
    },
    render(context, timeState, params) {
      const { ctx, width, height } = context;
      const wingFrequency = Number(params.wingBeatSpeed ?? 1.4);
      const honeycombRadius = Number(params.combRadius ?? 1);
      const pollenDensity = Math.max(10, Math.min(40, Math.round(Number(params.pollenCount ?? 20))));
      const t = timeState.time * wingFrequency;
      ctx.fillStyle = "#060402";
      ctx.fillRect(0, 0, width, height);
      const cx = width * 0.5;
      const cy = height * 0.52;
      const maxR = Math.min(width, height) * 0.42;
      ctx.save();
      ctx.translate(cx, cy);
      const goldHue = 42;
      const hexSize = maxR * 0.14 * honeycombRadius;
      const hexRings = 2;
      for (let hr = 1; hr <= hexRings; hr++) {
        const count = hr * 6;
        for (let i = 0; i < count; i++) {
          const a = i / count * Math.PI * 2 + t * 0.05;
          const hDist = maxR * (0.65 + 0.28 * (hr / hexRings));
          const hx = Math.cos(a) * hDist;
          const hy = Math.sin(a) * hDist;
          ctx.beginPath();
          for (let k = 0; k < 6; k++) {
            const ha = k / 6 * Math.PI * 2 + Math.PI / 6;
            const px = hx + Math.cos(ha) * hexSize;
            const py = hy + Math.sin(ha) * hexSize;
            if (k === 0) ctx.moveTo(px, py);
            else ctx.lineTo(px, py);
          }
          ctx.closePath();
          ctx.strokeStyle = hsla(goldHue, 90, 70, 0.25);
          ctx.lineWidth = 1;
          ctx.stroke();
          if ((i + hr) % 3 === 0) {
            ctx.fillStyle = hsla(38, 95, 60, 0.15 + 0.1 * Math.sin(t * 2 + i));
            ctx.fill();
          }
        }
      }
      const strokePhase = Math.sin(t * 18);
      const strokePitch = Math.cos(t * 18) * 0.25;
      for (const wSide of [-1, 1]) {
        ctx.save();
        const baseWingAngle = -Math.PI * 0.48 * wSide + strokePhase * 0.35 * wSide;
        ctx.rotate(baseWingAngle);
        ctx.scale(1, 0.4 + 0.6 * Math.abs(strokePhase));
        const wLen = maxR * 0.82;
        const wWidth = wLen * 0.36;
        ctx.beginPath();
        ctx.moveTo(0, 0);
        ctx.bezierCurveTo(wSide * wWidth * 0.8, -wLen * 0.3, wSide * wWidth * 0.9, -wLen * 0.8, 0, -wLen);
        ctx.bezierCurveTo(-wSide * wWidth * 0.3, -wLen * 0.7, -wSide * wWidth * 0.2, -wLen * 0.2, 0, 0);
        ctx.fillStyle = "rgba(254, 240, 138, 0.2)";
        ctx.fill();
        ctx.strokeStyle = hsla(50, 100, 85, 0.85);
        ctx.lineWidth = 1.4;
        ctx.stroke();
        for (let wv = 1; wv <= 4; wv++) {
          const wvFrac = wv / 5;
          ctx.beginPath();
          ctx.moveTo(0, -wLen * 0.15);
          ctx.quadraticCurveTo(wSide * wWidth * 0.6 * wvFrac, -wLen * 0.5 * wvFrac, wSide * (wWidth * 0.45 * wvFrac), -wLen * wvFrac);
          ctx.strokeStyle = hsla(45, 95, 80, 0.45);
          ctx.lineWidth = 0.8;
          ctx.stroke();
        }
        const hwLen = wLen * 0.65;
        const hwWidth = wWidth * 0.75;
        ctx.beginPath();
        ctx.moveTo(0, 0);
        ctx.bezierCurveTo(wSide * hwWidth, -hwLen * 0.2, wSide * hwWidth * 0.8, -hwLen * 0.75, 0, -hwLen);
        ctx.bezierCurveTo(0, -hwLen * 0.5, 0, -hwLen * 0.2, 0, 0);
        ctx.fillStyle = "rgba(253, 224, 71, 0.15)";
        ctx.fill();
        ctx.strokeStyle = hsla(48, 90, 80, 0.6);
        ctx.lineWidth = 1;
        ctx.stroke();
        ctx.restore();
      }
      const segments = 6;
      for (let s = 0; s < segments; s++) {
        const sFrac = s / segments;
        const sy = sFrac * maxR * 0.48 + maxR * 0.04;
        const sw = maxR * 0.18 * Math.sin((sFrac + 0.15) * Math.PI);
        const sh = maxR * 0.08;
        ctx.beginPath();
        ctx.ellipse(0, sy, sw, sh * 0.5, 0, 0, Math.PI * 2);
        const isGoldStripe = s % 2 === 0;
        if (isGoldStripe) {
          ctx.fillStyle = hsla(goldHue + 4, 95, 62, 0.95);
          ctx.fill();
          ctx.strokeStyle = hsla(goldHue + 15, 100, 80, 0.9);
        } else {
          ctx.fillStyle = "#0a0806";
          ctx.fill();
          ctx.strokeStyle = hsla(goldHue - 10, 80, 40, 0.7);
        }
        ctx.lineWidth = 1.2;
        ctx.stroke();
      }
      ctx.beginPath();
      ctx.moveTo(-3, maxR * 0.52);
      ctx.lineTo(0, maxR * 0.58);
      ctx.lineTo(3, maxR * 0.52);
      ctx.fillStyle = "#f59e0b";
      ctx.fill();
      ctx.beginPath();
      ctx.ellipse(0, -maxR * 0.06, maxR * 0.15, maxR * 0.14, 0, 0, Math.PI * 2);
      ctx.fillStyle = "#1c1308";
      ctx.fill();
      ctx.strokeStyle = hsla(goldHue, 95, 75, 0.9);
      ctx.lineWidth = 1.8;
      ctx.stroke();
      const setaeCount = 20;
      for (let f = 0; f < setaeCount; f++) {
        const fa = f / setaeCount * Math.PI * 2;
        const fx = Math.cos(fa) * (maxR * 0.15);
        const fy = -maxR * 0.06 + Math.sin(fa) * (maxR * 0.14);
        ctx.beginPath();
        ctx.moveTo(fx, fy);
        ctx.lineTo(fx * 1.12, fy * 1.12);
        ctx.strokeStyle = hsla(goldHue + 10, 100, 78, 0.6);
        ctx.lineWidth = 0.9;
        ctx.stroke();
      }
      ctx.beginPath();
      ctx.arc(0, -maxR * 0.22, maxR * 0.1, 0, Math.PI * 2);
      ctx.fillStyle = "#0f0a04";
      ctx.fill();
      ctx.strokeStyle = hsla(goldHue, 90, 70, 0.85);
      ctx.lineWidth = 1.4;
      ctx.stroke();
      for (const eSide of [-1, 1]) {
        ctx.beginPath();
        ctx.ellipse(eSide * (maxR * 0.08), -maxR * 0.23, maxR * 0.045, maxR * 0.07, eSide * 0.25, 0, Math.PI * 2);
        ctx.fillStyle = "#291807";
        ctx.fill();
        ctx.strokeStyle = hsla(goldHue + 20, 100, 85, 0.95);
        ctx.lineWidth = 1.2;
        ctx.stroke();
      }
      for (const aSide of [-1, 1]) {
        const aSway = Math.sin(t * 4 + aSide) * 0.06;
        ctx.beginPath();
        ctx.moveTo(aSide * 4, -maxR * 0.28);
        const tipX = aSide * (maxR * 0.14) + aSway * 8;
        const tipY = -maxR * 0.44;
        ctx.quadraticCurveTo(aSide * (maxR * 0.04), -maxR * 0.38, tipX, tipY);
        ctx.strokeStyle = hsla(goldHue + 15, 95, 80, 0.85);
        ctx.lineWidth = 1.3;
        ctx.stroke();
      }
      for (let p = 0; p < pollenDensity; p++) {
        const pSeed = p * 61.7;
        const pa = (pSeed + t * 0.3) % (Math.PI * 2);
        const pr = maxR * (0.35 + 0.55 * Math.sin(pSeed * 2 + t * 0.5));
        const px = Math.cos(pa) * pr;
        const py = Math.sin(pa) * pr;
        const pAlpha = 0.3 + 0.5 * Math.sin(t * 3 + p);
        ctx.fillStyle = hsla(45, 100, 82, pAlpha);
        ctx.beginPath();
        ctx.arc(px, py, 1.4, 0, Math.PI * 2);
        ctx.fill();
      }
      ctx.restore();
    }
  };
}

// Default parameters from content metadata
const defaultParams = [
  {
    "key": "wingBeatSpeed",
    "label": "Wingbeat Speed",
    "type": "range",
    "min": 0.5,
    "max": 2.5,
    "step": 0.1,
    "defaultValue": 1.4,
    "description": "High-frequency stroke oscillation rate"
  },
  {
    "key": "combRadius",
    "label": "Honeycomb Scale",
    "type": "range",
    "min": 0.6,
    "max": 1.4,
    "step": 0.1,
    "defaultValue": 1,
    "description": "Scale of surrounding hexagonal honeycomb tessellation"
  },
  {
    "key": "pollenCount",
    "label": "Pollen Motes",
    "type": "range",
    "min": 10,
    "max": 40,
    "step": 5,
    "defaultValue": 20,
    "description": "Number of floating glowing pollen dust motes"
  }
];

if (!window.__art_instances) window.__art_instances = {};
if (!window.__art_instances['golden-honeybee']) {
  const inst = typeof createGoldenHoneybee === 'function' ? createGoldenHoneybee() : null;
  if (inst && inst.setup) {
    inst.setup({ ctx, width, height, dpr: 1, aspectRatio: width / height }, defaultParams);
  }
  window.__art_instances['golden-honeybee'] = inst;
}

const instance = window.__art_instances['golden-honeybee'];
if (instance && instance.render) {
  instance.render(
    { ctx, width, height, dpr: 1, aspectRatio: width / height },
    { time, deltaTime: dt, frameCount: Math.floor(time * 60), fps: 60 },
    defaultParams
  );
}
Edit in Interactive Playground Zero Dependencies • Standalone Canvas 2D
ƒ

Mathematical Formulation

high
Analytical Equation
ϕ(t)=Acos(ωt),ψ(t)=Bsin(2ωt),Hk=c+R[cos(kπ/3+π/6)sin(kπ/3+π/6)]\phi(t) = A \cos(\omega t), \quad \psi(t) = B \sin(2\omega t), \quad \mathbf{H}_k = \mathbf{c} + R \begin{bmatrix} \cos(k\pi/3 + \pi/6) \\ \sin(k\pi/3 + \pi/6) \end{bmatrix}
Click to expand
Compact Formula
wing_stroke = rotate(-π/2 + sin(18t)*0.35), honeycomb = regularHexagon(r)

Mathematical Tags

#honeybee #bee #insect #hymenoptera #creatures #honeycomb #gold #hexagonal
Author: Math Art Core Target: 60 FPS

Export & Embed: Golden Mathematical Honeybee

4K PNG Snapshot

High-resolution single frame render

WebM Video (5s Loop)

60 FPS browser-captured stream

Standalone JS Script

Complete executable Canvas 2D algorithm

HTML Iframe Embed

<iframe src="https://art.fazleyrabbi.xyz/embed/golden-honeybee" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate Select
101 Mathematical Artworks

Support the Project

Keep mathematical creative coding alive & open source

Or via Direct Payoneer ($0 Fee)
Payoneer Customer ID: $0 Fee Direct
24076084

💡 Payoneer app: Go to Pay → Pay to recipient → Enter ID 24076084.

Thank you for supporting generative mathematical animations! ✨