You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
2 weeks ago
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1180],{74909:function(n,t,e){var o=e(12739),r=e(5265),a=e(41376),i=e(41372),u=e(95783),c=e(54354),s=1e7,f=Math.cos(Math.PI/6),h=s*Math.sin(Math.PI/6),p=s*f,w=new r.Z([[0,s],[p,-h],[-p,-h],[0,s]]),x=new o.Z(w),v=new i.Z({source:new u.Z({features:[x]})});new a.Z({layers:[v],target:"map",view:new c.ZP({center:[0,0],zoom:1})});function l(n){var t=n.next,e=n.point,o=n.next.point,r=o[0]-e[0],a=o[1]-e[1],i={point:[e[0]+r/3,e[1]+a/3]},u=Math.sqrt(r*r+a*a)/(2*f),c=Math.atan2(a,r)+Math.PI/6,s={point:[e[0]+u*Math.cos(c),e[1]+u*Math.sin(c)]},h={point:[o[0]-r/3,o[1]-a/3]};n.next=i,i.next=s,s.next=h,h.next=t}var m,M=document.getElementById("depth");function d(){!function(n){for(var t=w.clone(),e=function(n){for(var t={point:n[0]},e=n.length,o=0,r=t;o<e-1;++o)r.next={point:n[o+1]},r=r.next;return t}(t.getCoordinates()),o=0;o<n;++o)for(var r=e;r.next;){var a=r.next;l(r),r=a}var i=function(n){for(var t=[n.point],e=n,o=1;e.next;e=e.next,++o)t[o]=e.next.point;return t}(e);document.getElementById("count").innerHTML=i.length,t.setCoordinates(i),x.setGeometry(t)}(Number(M.value))}M.onchange=function(){window.clearTimeout(m),m=window.setTimeout(d,200)},d()}},function(n){var t=function(t){return n(n.s=t)};t(9877),t(74909)}]);
|
||
|
//# sourceMappingURL=fractal.js.map
|