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AK,EAAL,GAAU,CAAnC;AACA,aAAK,GAAL,CAAS,SAAT;AACA,aAAK,GAAL,CAAS,IAAT;AACH,KAdO;AAgBA,QAAA,SAAA,CAAA,QAAA,GAAR,UAAkB,EAAlB,EAA8B,EAA9B,EAA0C,EAA1C,EAAsD,EAAtD,EAAgE;AAC5D,aAAK,GAAL,CAAS,SAAT,GAAqB,GAArB;AACA;AACA,aAAK,GAAL,CAAS,WAAT,GAAuB,MAAvB;AAEA,aAAK,GAAL,CAAS,SAAT;AACA,aAAK,GAAL,CAAS,MAAT,CAAgB,EAAhB,EAAoB,EAApB;AACA,aAAK,GAAL,CAAS,MAAT,CAAgB,EAAhB,EAAoB,EAApB;AACA,aAAK,GAAL,CAAS,MAAT;AACH,KATO;AAWA,QAAA,SAAA,CAAA,WAAA,GAAR,UAAqB,EAArB,EAAiC,EAAjC,EAA6C,EAA7C,EAAyD,EAAzD,EAAmE;AAC/D,YAAM,IAAI,KAAK,EAAf;AACA,YAAM,IAAI,KAAK,EAAf;AAEA,eAAO,KAAK,IAAL,CAAU,IAAI,CAAJ,GAAQ,IAAI,CAAtB,CAAP;AACH,KALO;AAMZ,WAAA,GAAA;AA1GA,CAAA,EAAA;AAAa,QAAA,GAAA,GAAA,GAAA","file":"generative.dfdcac92.map","sourceRoot":"..","sourcesContent":["export class App {\r\n    private canvas: HTMLCanvasElement;\r\n    private ctx: CanvasRenderingContext2D;\r\n\r\n    constructor() {\r\n        this.canvas = document.getElementById('image') as HTMLCanvasElement;\r\n        this.ctx = this.canvas.getContext('2d');\r\n\r\n        this.canvas.width = window.innerWidth;\r\n        this.canvas.height = window.innerHeight ;\r\n    }\r\n\r\n    public run(): void {\r\n        const routine = () => {\r\n            this.clear();\r\n            this.draw();\r\n\r\n            window.setTimeout(routine, 1000);\r\n        };\r\n\r\n        routine();\r\n    }\r\n\r\n    public clear () {\r\n        this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n    }\r\n\r\n    private draw () {\r\n        const r = 400;\r\n        const center = { x: Math.round(this.canvas.width / 2), y: Math.round(this.canvas.height / 2) };\r\n        const rMax = 50;\r\n        const exceptions = [\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * 200 },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax },\r\n            { x: center.x + r - Math.random() * 2 * r, y: center.y + r - Math.random() * 2 * r, r: Math.random() * rMax }\r\n        ];\r\n\r\n        for (let i = 0; i < 2000; i++) {\r\n            let angle = Math.random() * Math.PI * 2;\r\n            const start = { x: center.x + r * Math.cos(angle), y: center.y + r * Math.sin(angle) };\r\n            angle = Math.random() * Math.PI * 2;\r\n            const end = { x: center.x + r * Math.cos(angle), y: center.y + r * Math.sin(angle) };\r\n\r\n            let intersect = false;\r\n\r\n            for (const exception of exceptions) {\r\n                const a = this.getDistance(start.x, start.y, end.x, end.y);\r\n                const b = this.getDistance(start.x, start.y, exception.x, exception.y);\r\n                const c = this.getDistance(end.x, end.y, exception.x, exception.y);\r\n\r\n                angle = Math.acos((a * a + b * b - c * c) / (2 * a * b));\r\n                const dist = Math.sin(angle) * b;\r\n\r\n                if (dist < exception.r) {\r\n                    intersect = true;\r\n                    continue;\r\n                }\r\n\r\n            }\r\n            if (intersect) {\r\n                i--;\r\n                continue;\r\n            }\r\n\r\n            this.drawLine(start.x, start.y, end.x, end.y);\r\n        }\r\n    }\r\n\r\n    private drawPoint (x: number, y: number, r: number = 5) {\r\n        this.ctx.lineWidth = 1;\r\n        this.ctx.strokeStyle = '#000';\r\n        this.ctx.fillStyle = '#900';\r\n\r\n        this.ctx.beginPath();\r\n        this.ctx.arc(x, y, r, 0, Math.PI * 2);\r\n        this.ctx.closePath();\r\n        this.ctx.stroke();\r\n\r\n        this.ctx.beginPath();\r\n        this.ctx.arc(x, y, 1, 0, Math.PI * 2);\r\n        this.ctx.closePath();\r\n        this.ctx.fill();\r\n    }\r\n\r\n    private drawLine (x1: number, y1: number, x2: number, y2: number) {\r\n        this.ctx.lineWidth = 0.1;\r\n        // this.ctx.lineWidth = Math.random() * Math.random();\r\n        this.ctx.strokeStyle = '#000';\r\n\r\n        this.ctx.beginPath();\r\n        this.ctx.moveTo(x1, y1);\r\n        this.ctx.lineTo(x2, y2);\r\n        this.ctx.stroke();\r\n    }\r\n\r\n    private getDistance (x1: number, y1: number, x2: number, y2: number): number {\r\n        const a = x2 - x1;\r\n        const b = y2 - y1;\r\n\r\n        return Math.sqrt(a * a + b * b);\r\n    }\r\n}\r\n","import { App } from './App';\r\n\r\nconst app = new App();\r\napp.run();\r\n"]}