+
+
+
const areaW=80;
+ const areaH = 24;const area
+ =new Array( areaW*areaH ).fill(0);const
+ areaElement = document.getElementById( 'areaId');
+ const clearArea = () =>{ area.fill(0); };const drawToArea
+ =(x, y, color)=>{if(x >= 0 && x < areaW && y>=0 && y<areaH){const
+ index=y * areaW+x; area[index] = color; }}; const renderArea= () =>{let
+ result = ''; for (let i = 0; i<area.length; i++) {result+=" .,-~:;=!*#$"[area
+ [i] || 0]; if((i + 1)%areaW===0){result += '\n';}}areaElement.textContent=result;
+ };const main=()=>{ clearArea(); let A=0;let B=0;const sin=(x)=>{return(
+ Math.sin(x))}; const cos = (x)=>{ return Math.cos(x);}; const floor
+ =(x) =>{return Math.floor(x);}; const round = (x)=>{return Math
+.round(x);}; const memset=(arr, val, count) => { for (let i = 0;
+i < count; i++) {arr[i]=val;}}; let updateArea= ()=>{clearArea()
+ ;for(let j = 0;j < 6.28;j+=0.07 ){for (let i=0; i <6.28;i+=0.02)
+ {const c = sin(i); const d=cos(j) ;const e = sin(A);const f = sin(j)
+ ;const g =cos(A);const h =d+2;const D=1/(c* h * e + f * g + 5);const l=
+ cos(i); const m = cos(B);const n = sin(B); const t = c * h *g - f*e;const x=round
+ (40 + 30 * D * (l * h * m - t * n)); const y = round(12 + 15 * D * (l * h*n +
+ t * m));const o = x + areaW * y; const N = round(8 * ((f * e- c * d*g)*
+ m - c * d * e - f *g-l * d * n)); if (y >= 0 && y < areaH && x>=0
+ && x < areaW && D > area[o] ) { area[o] = D; drawToArea(x
+ ,y,N > 0?N:0);}}}};const loop= () =>{ updateArea()
+ ;renderArea() ; A += 0.04 ; B += 0.02;
+ requestAnimationFrame(loop)}
+ loop()};main()
+
+
+