From e8caec019f524bb799f38ce67be9a7336cdff73a Mon Sep 17 00:00:00 2001 From: teahubxyz Date: Fri, 23 Oct 2026 21:52:39 +0000 Subject: [PATCH] Overlays: add the collapsed double-ring yantra as a layer Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01161aC97vUnBnyZRBGyJeHy --- overlay/index.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/overlay/index.html b/overlay/index.html index 55ee0ef..8b9d2ae 100644 --- a/overlay/index.html +++ b/overlay/index.html @@ -41,6 +41,7 @@ input[type=range]{width:100%;accent-color:var(--fit)} +
@@ -74,9 +75,13 @@ const circ=(r,n=360)=>Array.from({length:n+1},(_,i)=>{const a=i/n*Math.PI*2;retu function petals(r0,r1,k){const o=[];for(let i=0;icorners.push([x*c-y*s,x*s+y*c]))}corners.push(corners[0]);const o=[];for(let i=0;i{const A=[-w,b],B=[0,a],C=[w,b];[[A,B],[B,C],[C,A]].forEach(([p,q])=>csides.push(seg(p,q)))}); const RHO_FIT=Math.sqrt(Math.hypot(...V0)*Math.hypot(...M1)); const inv=(p,r2)=>{const r=p[0]*p[0]+p[1]*p[1];return r<1e-12?null:[r2*p[0]/r,r2*p[1]/r]}; -let L={orig:true,unit:false,fit:true,outer:true},rho=RHO_FIT,zoom=1,pan=[0,0]; +let L={orig:true,unit:false,fit:true,outer:true,coll:false},rho=RHO_FIT,zoom=1,pan=[0,0]; const cv=document.getElementById('c'),ctx=cv.getContext('2d'); function size(){const d=Math.min(devicePixelRatio,2);cv.width=innerWidth*d;cv.height=innerHeight*d;ctx.setTransform(d,0,0,d,0,0);draw()} let queued=false; @@ -92,15 +97,16 @@ function render(){ if(L.unit){ring(1,col.ring);sides.forEach(sd=>path(sd.pts.map(p=>inv(p,1)),col.ring,.7,1.1));O.forEach(o=>path(o.map(p=>inv(p,1)),col.ring,.4,1))} if(L.fit){ring(rho,col.fit);sides.forEach(sd=>path(sd.pts.map(p=>inv(p,rho*rho)),col.fit,.85,1.2));O.forEach(o=>path(o.map(p=>inv(p,rho*rho)),col.fit,.45,1))} if(L.orig){sides.forEach(sd=>path(sd.pts,sd.up?col.up:col.down,1,1.3));O.forEach(o=>path(o,col.fg,.45,1));path(circ(1),col.fg,.6,1)} + if(L.coll){const cc='#c9b8ff';csides.forEach(p=>path(p,cc,.9,1.3));CR.forEach(r=>ring(r,cc));path(seg([-1.2,CP[0][1]],[1.2,CP[0][1]],2),cc,1,2.4);ctx.fillStyle=cc;CP.forEach(p=>{ctx.beginPath();ctx.arc(X(p),Y(p),5,0,7);ctx.fill()})} if(L.fit&&Math.abs(rho-RHO_FIT)<1e-3){ctx.fillStyle=col.fit;MIDS.forEach(m=>{ctx.beginPath();ctx.arc(X(m),Y(m),3.5,0,7);ctx.fill()})} ctx.fillStyle=col.bindu;ctx.beginPath();ctx.arc(cx,cy,2.4,0,Math.PI*2);ctx.fill(); document.getElementById('rv').textContent=rho.toFixed(4); - document.getElementById('note').textContent= + document.getElementById('note').textContent=L.coll?'Collapsed yantra (lavender): both rings exact (dashed, r = 0.6127 and 0.4155). Two bases fuse into one line (thick) carrying three 6-fold points: one on the axis, a mirror pair beside it. Many other coincidences appear too; it is a degenerate corner of the family.': 'Yantra in gold and pink; its inversion in the rim (ρ = 1) in violet; its inversion in a circle of radius ρ in teal. '+ (Math.abs(rho-RHO_FIT)<1e-3?`Fit: ρ = ${RHO_FIT.toFixed(4)}. Two big lobes and one inner lobe meet at the image of a triple point (the T4 apex on the T6 base); this ρ puts those meeting points at the radius of the outer upward triangle’s slanted-side midpoints (teal dots), about 0.615 of the rim.`:'Fit trefoil snaps ρ so the lobe meeting points land on the outer triangle’s side midpoints.'); } const $=id=>document.getElementById(id); -['orig','unit','fit','outer'].forEach(k=>$('l-'+k).onclick=e=>{L[k]=!L[k];e.currentTarget.setAttribute('aria-pressed',L[k]);draw()}); +['orig','unit','fit','outer','coll'].forEach(k=>$('l-'+k).onclick=e=>{L[k]=!L[k];e.currentTarget.setAttribute('aria-pressed',L[k]);draw()}); $('rho').oninput=e=>{rho=Math.pow(10,+e.target.value);draw()}; $('snap').onclick=()=>{rho=RHO_FIT;$('rho').value=Math.log10(rho);if(!L.fit){L.fit=true;$('l-fit').setAttribute('aria-pressed','true')}draw()}; $('rho').value=Math.log10(RHO_FIT);