438

Moiré Interference

Visual optical interference fringes formed by the spatial overlap of two dense concentric circle grids shifting across phase space.

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

Full Executable Algorithm Code


import type { ArtRenderer, ParameterState, RenderContext, TimeState } from '../../types/engine';
import { hsla } from '../common/color';

export function createMoireInterference(): ArtRenderer {
  return {
    setup() {},

    render(context: RenderContext, timeState: TimeState, params: ParameterState) {
      const { ctx, width, height } = context;
      const t = timeState.time * Number(params.speed || 0.5);
      const ringCount = Number(params.ringCount || 75);
      const separation = Number(params.separation || 40) + Math.sin(t * 0.8) * 30;

      ctx.fillStyle = '#08090d';
      ctx.fillRect(0, 0, width, height);

      const cx = width * 0.5;
      const cy = height * 0.5;

      const c1x = cx - separation;
      const c1y = cy;
      const c2x = cx + separation * Math.cos(t * 0.5);
      const c2y = cy + separation * Math.sin(t * 0.5);

      const maxR = Math.max(width, height) * 0.75;
      const step = maxR / ringCount;

      ctx.lineWidth = 1.3;

      // Pattern 1
      for (let r = 5; r < maxR; r += step) {
        ctx.beginPath();
        ctx.arc(c1x, c1y, r, 0, Math.PI * 2);
        ctx.strokeStyle = hsla((180 + (r / maxR) * 60) % 360, 85, 60, 0.6);
        ctx.stroke();
      }

      // Pattern 2
      for (let r = 5; r < maxR; r += step) {
        ctx.beginPath();
        ctx.arc(c2x, c2y, r, 0, Math.PI * 2);
        ctx.strokeStyle = hsla((280 + (r / maxR) * 60) % 360, 85, 65, 0.6);
        ctx.stroke();
      }
    },
  };
}
Edit in Interactive Playground Zero Dependencies • Standalone Canvas 2D
ƒ

Mathematical Formulation

low
Analytical Equation
I(x,y)=cos⁡(k1∥r−c1∥)+cos⁡(k2∥r−c2(t)∥)I(x, y) = \cos(k_1 \|\mathbf{r} - \mathbf{c}_1\|) + \cos(k_2 \|\mathbf{r} - \mathbf{c}_2(t)\|)
Click to expand
Compact Formula
fringe = arc(c1, r) + arc(c2(t), r), beat_frequency = |k1 - k2|

Mathematical Tags

#moire #interference #optical #grating #geometry #physics
Author: Math Art Core Target: 60 FPS

Export & Embed: Moiré Interference

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/moire-interference" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate ↵ Select
113 Mathematical Artworks
Made by Fazley Rabbi
☕

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! ✨