[vc_row][vc_column][vc_column_text][wpproads_banner id=”2608″][/vc_column_text][snippet_preview_vc code=”{“settings“:{“resources“:`{“}`},“code“:{“html“:“%3Ccanvas%3E%3C%2Fcanvas%3E%0A%3C!–%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2C–.%20%20%20%20%2C–.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20((O%20))–((O%20))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2C’_%60–‘____%60–‘_%60.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20_%3A%20%20____________%20%20%3A_%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7C%20%7C%20%7C%7C%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%7C%7C%20%7C%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7C%20%7C%20%7C%7C%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%7C%7C%20%7C%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7C%20%7C%20%7C%7C%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%7C%7C%20%7C%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7C_%7C%20%7C%2F__________%5C%7C%20%7C_%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7C________________%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20__..-‘%20%20%20%20%20%20%20%20%20%20%20%20%60-..__%0A%20%20%20%20%20%20%20%20%20.-%7C%20%3A%20.—————-.%20%3A%20%7C-.%0A%20%20%20%20%20%20%20%2C%5C%20%7C%7C%20%7C%20%7C%5C______________%2F%7C%20%7C%20%7C%7C%20%2F.%0A%20%20%20%20%20%20%2F%60.%5C%3A%7C%20%7C%20%7C%7C%20%20__%20%20__%20%20__%20%20%7C%7C%20%7C%20%7C%3B%2F%2C’%5C%0A%20%20%20%20%20%3A%60-._%5C%3B.%7C%20%7C%7C%20’–”–”–‘%20%7C%7C%20%7C%2C%3A%2F_.-‘%3A%0A%20%20%20%20%20%7C%20%20%20%20%3A%20%20%7C%20%7C%7C%20.———-.%20%7C%7C%20%7C%20%20%3A%20%20%20%20%7C%0A%20%20%20%20%20%7C%20%20%20%20%7C%20%20%7C%20%7C%7C%20’—-SSt—‘%20%7C%7C%20%7C%20%20%7C%20%20%20%20%7C%0A%20%20%20%20%20%7C%20%20%20%20%7C%20%20%7C%20%7C%7C%20%20%20_%20%20%20_%20%20%20_%20%20%7C%7C%20%7C%20%20%7C%20%20%20%20%7C%0A%20%20%20%20%20%3A%2C–.%3B%20%20%7C%20%7C%7C%20%20(_)%20(_)%20(_)%20%7C%7C%20%7C%20%20%3A%2C–.%3B%0A%20%20%20%20%20(%60-‘%7C)%20%20%7C%20%7C%7C______________%7C%7C%20%7C%20%20(%7C%60-‘)%0A%20%20%20%20%20%20%60–‘%20%20%20%7C%20%7C%2F______________%5C%7C%20%7C%20%20%20%60–‘%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7C____________________%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%60.________________%2C’%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(_______)(_______)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(_______)(_______)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(_______)(_______)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(_______)(_______)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7C%20%20%20%20%20%20%20%20%7C%7C%20%20%20%20%20%20%20%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20’——–”——–‘%0A–%3E“,“js“:“%7B%0A%09class%20Robot%20%7B%0A%09%09constructor(color%2C%20light%2C%20size%2C%20x%2C%20y%2C%20struct)%20%7B%0A%09%09%09this.x%20%3D%20x%3B%0A%09%09%09this.points%20%3D%20%5B%5D%3B%0A%09%09%09this.links%20%3D%20%5B%5D%3B%0A%09%09%09this.frame%20%3D%200%3B%0A%09%09%09this.dir%20%3D%201%3B%0A%09%09%09this.size%20%3D%20size%3B%0A%09%09%09this.color%20%3D%20Math.round(color)%3B%0A%09%09%09this.light%20%3D%20light%3B%0A%09%09%09%2F%2F%20—-%20create%20points%20—-%0A%09%09%09for%20(const%20p%20of%20struct.points)%20%7B%0A%09%09%09%09this.points.push(new%20Robot.Point(size%20*%20p.x%20%2B%20x%2C%20size%20*%20p.y%20%2B%20y%2C%20p.f))%3B%0A%09%09%09%7D%0A%09%09%09%2F%2F%20—-%20create%20links%20—-%0A%09%09%09for%20(const%20link%20of%20struct.links)%20%7B%0A%09%09%09%09const%20p0%20%3D%20this.points%5Blink.p0%5D%3B%0A%09%09%09%09const%20p1%20%3D%20this.points%5Blink.p1%5D%3B%0A%09%09%09%09const%20dx%20%3D%20p0.x%20-%20p1.x%3B%0A%09%09%09%09const%20dy%20%3D%20p0.y%20-%20p1.y%3B%0A%09%09%09%09this.links.push(%0A%09%09%09%09%09new%20Robot.Link(%0A%09%09%09%09%09%09this%2C%0A%09%09%09%09%09%09p0%2C%0A%09%09%09%09%09%09p1%2C%0A%09%09%09%09%09%09Math.sqrt(dx%20*%20dx%20%2B%20dy%20*%20dy)%2C%0A%09%09%09%09%09%09link.size%20*%20size%20%2F%203%2C%0A%09%09%09%09%09%09link.lum%2C%0A%09%09%09%09%09%09link.force%2C%0A%09%09%09%09%09%09link.disk%0A%09%09%09%09%09)%0A%09%09%09%09)%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09update()%20%7B%0A%09%09%09if%20(%2B%2Bthis.frame%20%25%2020%20%3D%3D%3D%200)%20this.dir%20%3D%20-this.dir%3B%0A%09%09%09if%20(%0A%09%09%09%09dancerDrag%20%26%26%0A%09%09%09%09this%20%3D%3D%3D%20dancerDrag%20%26%26%0A%09%09%09%09this.size%20%3C%2016%20%26%26%0A%09%09%09%09this.frame%20%3E%20600%0A%09%09%09)%20%7B%0A%09%09%09%09dancerDrag%20%3D%20null%3B%0A%09%09%09%09dancers.push(%0A%09%09%09%09%09new%20Robot(%0A%09%09%09%09%09%09this.color%2C%0A%09%09%09%09%09%09this.light%20*%201.25%2C%0A%09%09%09%09%09%09this.size%20*%202%2C%0A%09%09%09%09%09%09pointer.x%2C%0A%09%09%09%09%09%09pointer.y%20-%20100%20*%20this.size%20*%202%2C%0A%09%09%09%09%09%09struct%0A%09%09%09%09%09)%0A%09%09%09%09)%3B%0A%09%09%09%09dancers.sort(function(d0%2C%20d1)%20%7B%0A%09%09%09%09%09return%20d0.size%20-%20d1.size%3B%0A%09%09%09%09%7D)%3B%0A%09%09%09%7D%0A%09%09%09%2F%2F%20—-%20update%20links%20—-%0A%09%09%09for%20(const%20link%20of%20this.links)%20%7B%0A%09%09%09%09const%20p0%20%3D%20link.p0%3B%0A%09%09%09%09const%20p1%20%3D%20link.p1%3B%0A%09%09%09%09const%20dx%20%3D%20p0.x%20-%20p1.x%3B%0A%09%09%09%09const%20dy%20%3D%20p0.y%20-%20p1.y%3B%0A%09%09%09%09const%20dist%20%3D%20Math.sqrt(dx%20*%20dx%20%2B%20dy%20*%20dy)%3B%0A%09%09%09%09if%20(dist)%20%7B%0A%09%09%09%09%09const%20tw%20%3D%20p0.w%20%2B%20p1.w%3B%0A%09%09%09%09%09const%20r1%20%3D%20p1.w%20%2F%20tw%3B%0A%09%09%09%09%09const%20r0%20%3D%20p0.w%20%2F%20tw%3B%0A%09%09%09%09%09const%20dz%20%3D%20(link.distance%20-%20dist)%20*%20link.force%3B%0A%09%09%09%09%09const%20sx%20%3D%20dx%20%2F%20dist%20*%20dz%3B%0A%09%09%09%09%09const%20sy%20%3D%20dy%20%2F%20dist%20*%20dz%3B%0A%09%09%09%09%09p1.x%20-%3D%20sx%20*%20r0%3B%0A%09%09%09%09%09p1.y%20-%3D%20sy%20*%20r0%3B%0A%09%09%09%09%09p0.x%20%2B%3D%20sx%20*%20r1%3B%0A%09%09%09%09%09p0.y%20%2B%3D%20sy%20*%20r1%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%2F%2F%20—-%20update%20points%20—-%0A%09%09%09for%20(const%20point%20of%20this.points)%20%7B%0A%09%09%09%09%2F%2F%20—-%20dragging%20—-%0A%09%09%09%09if%20(this%20%3D%3D%3D%20dancerDrag%20%26%26%20point%20%3D%3D%3D%20pointDrag)%20%7B%0A%09%09%09%09%09point.x%20%2B%3D%20(pointer.x%20-%20point.x)%20*%200.1%3B%0A%09%09%09%09%09point.y%20%2B%3D%20(pointer.y%20-%20point.y)%20*%200.1%3B%0A%09%09%09%09%7D%0A%09%09%09%09%2F%2F%20—-%20dance%20—-%0A%09%09%09%09if%20(this%20!%3D%3D%20dancerDrag)%20%7B%0A%09%09%09%09%09point.fn%20%26%26%20point.fn(16%20*%20Math.sqrt(this.size)%2C%20this.dir)%3B%0A%09%09%09%09%7D%0A%09%09%09%09%2F%2F%20—-%20verlet%20integration%20—-%0A%09%09%09%09point.vx%20%3D%20point.x%20-%20point.px%3B%0A%09%09%09%09point.vy%20%3D%20point.y%20-%20point.py%3B%0A%09%09%09%09point.px%20%3D%20point.x%3B%0A%09%09%09%09point.py%20%3D%20point.y%3B%0A%09%09%09%09point.vx%20*%3D%200.995%3B%0A%09%09%09%09point.vy%20*%3D%200.995%3B%0A%09%09%09%09point.x%20%2B%3D%20point.vx%3B%0A%09%09%09%09point.y%20%2B%3D%20point.vy%20%2B%200.01%3B%0A%09%09%09%7D%0A%09%09%09%2F%2F%20—-%20ground%20—-%0A%09%09%09for%20(const%20link%20of%20this.links)%20%7B%0A%09%09%09%09const%20p1%20%3D%20link.p1%3B%0A%09%09%09%09if%20(p1.y%20%3E%20canvas.height%20*%20ground%20-%20link.size%20*%200.5)%20%7B%0A%09%09%09%09%09p1.y%20%3D%20canvas.height%20*%20ground%20-%20link.size%20*%200.5%3B%0A%09%09%09%09%09p1.x%20-%3D%20p1.vx%3B%0A%09%09%09%09%09p1.vx%20%3D%200%3B%0A%09%09%09%09%09p1.vy%20%3D%200%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%2F%2F%20—-%20center%20position%20—-%0A%09%09%09this.points%5B3%5D.x%20%2B%3D%20(this.x%20-%20this.points%5B3%5D.x)%20*%200.001%3B%0A%09%09%7D%0A%09%09draw()%20%7B%0A%09%09%09for%20(const%20link%20of%20this.links)%20%7B%0A%09%09%09%09if%20(link.size)%20%7B%0A%09%09%09%09%09const%20dx%20%3D%20link.p1.x%20-%20link.p0.x%3B%0A%09%09%09%09%09const%20dy%20%3D%20link.p1.y%20-%20link.p0.y%3B%0A%09%09%09%09%09const%20a%20%3D%20Math.atan2(dy%2C%20dx)%3B%0A%09%09%09%09%09const%20d%20%3D%20Math.sqrt(dx%20*%20dx%20%2B%20dy%20*%20dy)%3B%0A%09%09%09%09%09%2F%2F%20—-%20shadow%20—-%0A%09%09%09%09%09ctx.save()%3B%0A%09%09%09%09%09ctx.translate(link.p0.x%20%2B%20link.size%20*%200.25%2C%20link.p0.y%20%2B%20link.size%20*%200.25)%3B%0A%09%09%09%09%09ctx.rotate(a)%3B%0A%09%09%09%09%09ctx.drawImage(%0A%09%09%09%09%09%09link.shadow%2C%0A%09%09%09%09%09%09-link.size%20*%200.5%2C%0A%09%09%09%09%09%09-link.size%20*%200.5%2C%0A%09%09%09%09%09%09d%20%2B%20link.size%2C%0A%09%09%09%09%09%09link.size%0A%09%09%09%09%09)%3B%0A%09%09%09%09%09ctx.restore()%3B%0A%09%09%09%09%09%2F%2F%20—-%20stroke%20—-%0A%09%09%09%09%09ctx.save()%3B%0A%09%09%09%09%09ctx.translate(link.p0.x%2C%20link.p0.y)%3B%0A%09%09%09%09%09ctx.rotate(a)%3B%0A%09%09%09%09%09ctx.drawImage(%0A%09%09%09%09%09%09link.image%2C%0A%09%09%09%09%09%09-link.size%20*%200.5%2C%0A%09%09%09%09%09%09-link.size%20*%200.5%2C%0A%09%09%09%09%09%09d%20%2B%20link.size%2C%0A%09%09%09%09%09%09link.size%0A%09%09%09%09%09)%3B%0A%09%09%09%09%09ctx.restore()%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09Robot.Link%20%3D%20class%20Link%20%7B%0A%09%09constructor(parent%2C%20p0%2C%20p1%2C%20dist%2C%20size%2C%20light%2C%20force%2C%20disk)%20%7B%0A%09%09%09%2F%2F%20—-%20cache%20strokes%20—-%0A%09%09%09function%20stroke(color%2C%20axis)%20%7B%0A%09%09%09%09const%20image%20%3D%20document.createElement(%22canvas%22)%3B%0A%09%09%09%09image.width%20%3D%20dist%20%2B%20size%3B%0A%09%09%09%09image.height%20%3D%20size%3B%0A%09%09%09%09const%20ict%20%3D%20image.getContext(%222d%22)%3B%0A%09%09%09%09ict.beginPath()%3B%0A%09%09%09%09ict.lineCap%20%3D%20%22round%22%3B%0A%09%09%09%09ict.lineWidth%20%3D%20size%3B%0A%09%09%09%09ict.strokeStyle%20%3D%20color%3B%0A%09%09%09%09if%20(disk)%20%7B%0A%09%09%09%09%09ict.arc(size%20*%200.5%20%2B%20dist%2C%20size%20*%200.5%2C%20size%20*%200.5%2C%200%2C%202%20*%20Math.PI)%3B%0A%09%09%09%09%09ict.fillStyle%20%3D%20color%3B%0A%09%09%09%09%09ict.fill()%3B%0A%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09ict.moveTo(size%20*%200.5%2C%20size%20*%200.5)%3B%0A%09%09%09%09%09ict.lineTo(size%20*%200.5%20%2B%20dist%2C%20size%20*%200.5)%3B%0A%09%09%09%09%09ict.stroke()%3B%0A%09%09%09%09%7D%0A%09%09%09%09if%20(axis)%20%7B%0A%09%09%09%09%09const%20s%20%3D%20size%20%2F%2010%3B%0A%09%09%09%09%09ict.fillStyle%20%3D%20%22%23000%22%3B%0A%09%09%09%09%09ict.fillRect(size%20*%200.5%20-%20s%2C%20size%20*%200.5%20-%20s%2C%20s%20*%202%2C%20s%20*%202)%3B%0A%09%09%09%09%09ict.fillRect(size%20*%200.5%20-%20s%20%2B%20dist%2C%20size%20*%200.5%20-%20s%2C%20s%20*%202%2C%20s%20*%202)%3B%0A%09%09%09%09%7D%0A%09%09%09%09return%20image%3B%0A%09%09%09%7D%0A%09%09%09this.p0%20%3D%20p0%3B%0A%09%09%09this.p1%20%3D%20p1%3B%0A%09%09%09this.distance%20%3D%20dist%3B%0A%09%09%09this.size%20%3D%20size%3B%0A%09%09%09this.light%20%3D%20light%20%7C%7C%201.0%3B%0A%09%09%09this.force%20%3D%20force%20%7C%7C%200.5%3B%0A%09%09%09this.image%20%3D%20stroke(%0A%09%09%09%09%22hsl(%22%20%2B%20parent.color%20%2B%20%22%20%2C30%25%2C%20%22%20%2B%20parent.light%20*%20this.light%20%2B%20%22%25)%22%2C%0A%09%09%09%09true%0A%09%09%09)%3B%0A%09%09%09this.shadow%20%3D%20stroke(%22rgba(0%2C0%2C0%2C0.5)%22)%3B%0A%09%09%7D%0A%09%7D%3B%0A%09Robot.Point%20%3D%20class%20Point%20%7B%0A%09%09constructor(x%2C%20y%2C%20fn%2C%20w)%20%7B%0A%09%09%09this.x%20%3D%20x%3B%0A%09%09%09this.y%20%3D%20y%3B%0A%09%09%09this.w%20%3D%20w%20%7C%7C%200.5%3B%0A%09%09%09this.fn%20%3D%20fn%20%7C%7C%20null%3B%0A%09%09%09this.px%20%3D%20x%3B%0A%09%09%09this.py%20%3D%20y%3B%0A%09%09%09this.vx%20%3D%200.0%3B%0A%09%09%09this.vy%20%3D%200.0%3B%0A%09%09%7D%0A%09%7D%3B%0A%09%2F%2F%20—-%20set%20canvas%20—-%0A%09const%20canvas%20%3D%20%7B%0A%09%09init()%20%7B%0A%09%09%09this.elem%20%3D%20document.querySelector(%22canvas%22)%3B%0A%09%09%09this.resize()%3B%0A%09%09%09window.addEventListener(%22resize%22%2C%20()%20%3D%3E%20this.resize()%2C%20false)%3B%0A%09%09%09return%20this.elem.getContext(%222d%22)%3B%0A%09%09%7D%2C%0A%09%09resize()%20%7B%0A%09%09%09this.width%20%3D%20this.elem.width%20%3D%20this.elem.offsetWidth%3B%0A%09%09%09this.height%20%3D%20this.elem.height%20%3D%20this.elem.offsetHeight%3B%0A%09%09%09ground%20%3D%20this.height%20%3E%20500%20%3F%200.85%20%3A%201.0%3B%0A%09%09%09for%20(let%20i%20%3D%200%3B%20i%20%3C%20dancers.length%3B%20i%2B%2B)%20%7B%0A%09%09%09%09dancers%5Bi%5D.x%20%3D%20(i%20%2B%202)%20*%20canvas.width%20%2F%209%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%3B%0A%09%2F%2F%20—-%20set%20pointer%20—-%0A%09const%20pointer%20%3D%20%7B%0A%09%09init(canvas)%20%7B%0A%09%09%09this.x%20%3D%200%3B%0A%09%09%09this.y%20%3D%200%3B%0A%09%09%09window.addEventListener(%22mousemove%22%2C%20e%20%3D%3E%20this.move(e)%2C%20false)%3B%0A%09%09%09canvas.elem.addEventListener(%22touchmove%22%2C%20e%20%3D%3E%20this.move(e)%2C%20false)%3B%0A%09%09%09window.addEventListener(%22mousedown%22%2C%20e%20%3D%3E%20this.down(e)%2C%20false)%3B%0A%09%09%09window.addEventListener(%22touchstart%22%2C%20e%20%3D%3E%20this.down(e)%2C%20false)%3B%0A%09%09%09window.addEventListener(%22mouseup%22%2C%20e%20%3D%3E%20this.up(e)%2C%20false)%3B%0A%09%09%09window.addEventListener(%22touchend%22%2C%20e%20%3D%3E%20this.up(e)%2C%20false)%3B%0A%09%09%7D%2C%0A%09%09down(e)%20%7B%0A%09%09%09this.move(e)%3B%0A%09%09%09for%20(const%20dancer%20of%20dancers)%20%7B%0A%09%09%09%09for%20(const%20point%20of%20dancer.points)%20%7B%0A%09%09%09%09%09const%20dx%20%3D%20pointer.x%20-%20point.x%3B%0A%09%09%09%09%09const%20dy%20%3D%20pointer.y%20-%20point.y%3B%0A%09%09%09%09%09const%20d%20%3D%20Math.sqrt(dx%20*%20dx%20%2B%20dy%20*%20dy)%3B%0A%09%09%09%09%09if%20(d%20%3C%2060)%20%7B%0A%09%09%09%09%09%09dancerDrag%20%3D%20dancer%3B%0A%09%09%09%09%09%09pointDrag%20%3D%20point%3B%0A%09%09%09%09%09%09dancer.frame%20%3D%200%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09up(e)%20%7B%0A%09%09%09dancerDrag%20%3D%20null%3B%0A%09%09%7D%2C%0A%09%09move(e)%20%7B%0A%09%09%09let%20touchMode%20%3D%20e.targetTouches%2C%0A%09%09%09%09pointer%3B%0A%09%09%09if%20(touchMode)%20%7B%0A%09%09%09%09e.preventDefault()%3B%0A%09%09%09%09pointer%20%3D%20touchMode%5B0%5D%3B%0A%09%09%09%7D%20else%20pointer%20%3D%20e%3B%0A%09%09%09this.x%20%3D%20pointer.clientX%3B%0A%09%09%09this.y%20%3D%20pointer.clientY%3B%0A%09%09%7D%0A%09%7D%3B%0A%09%2F%2F%20—-%20init%20—-%0A%09const%20dancers%20%3D%20%5B%5D%3B%0A%09let%20ground%20%3D%201.0%3B%0A%09const%20ctx%20%3D%20canvas.init()%3B%0A%09pointer.init(canvas)%3B%0A%09let%20dancerDrag%20%3D%20null%3B%0A%09let%20pointDrag%20%3D%20null%3B%0A%09%2F%2F%20—-%20main%20loop%20—-%0A%09const%20run%20%3D%20()%20%3D%3E%20%7B%0A%09%09requestAnimationFrame(run)%3B%0A%09%09ctx.clearRect(0%2C%200%2C%20canvas.width%2C%20canvas.height)%3B%0A%09%09ctx.fillStyle%20%3D%20%22%23222%22%3B%0A%09%09ctx.fillRect(0%2C%200%2C%20canvas.width%2C%20canvas.height%20*%200.15)%3B%0A%09%09ctx.fillRect(0%2C%20canvas.height%20*%200.85%2C%20canvas.width%2C%20canvas.height%20*%200.15)%3B%0A%09%09for%20(const%20dancer%20of%20dancers)%20%7B%0A%09%09%09dancer.update()%3B%0A%09%09%09dancer.draw()%3B%0A%09%09%7D%0A%09%7D%3B%0A%09%2F%2F%20—-%20robot%20structure%20—-%0A%09const%20struct%20%3D%20%7B%0A%09%09points%3A%20%5B%0A%09%09%09%7B%0A%09%09%09%09x%3A%200%2C%0A%09%09%09%09y%3A%20-4%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.y%20-%3D%200.01%20*%20s%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%200%2C%0A%09%09%09%09y%3A%20-16%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.y%20-%3D%200.02%20*%20s%20*%20d%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%200%2C%0A%09%09%09%09y%3A%2012%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.y%20%2B%3D%200.02%20*%20s%20*%20d%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%20x%3A%20-12%2C%20y%3A%200%20%7D%2C%0A%09%09%09%7B%20x%3A%2012%2C%20y%3A%200%20%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%20-3%2C%0A%09%09%09%09y%3A%2034%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09if%20(d%20%3E%200)%20%7B%0A%09%09%09%09%09%09this.x%20%2B%3D%200.01%20*%20s%3B%0A%09%09%09%09%09%09this.y%20-%3D%200.015%20*%20s%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09this.y%20%2B%3D%200.02%20*%20s%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%203%2C%0A%09%09%09%09y%3A%2034%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09if%20(d%20%3E%200)%20%7B%0A%09%09%09%09%09%09this.y%20%2B%3D%200.02%20*%20s%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09this.x%20-%3D%200.01%20*%20s%3B%0A%09%09%09%09%09%09this.y%20-%3D%200.015%20*%20s%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%20-28%2C%0A%09%09%09%09y%3A%200%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.x%20%2B%3D%20this.vx%20*%200.035%3B%0A%09%09%09%09%09this.y%20-%3D%200.001%20*%20s%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%2028%2C%0A%09%09%09%09y%3A%200%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.x%20%2B%3D%20this.vx%20*%200.035%3B%0A%09%09%09%09%09this.y%20-%3D%200.001%20*%20s%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%20-3%2C%0A%09%09%09%09y%3A%2064%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.y%20%2B%3D%200.015%20*%20s%3B%0A%09%09%09%09%09if%20(d%20%3E%200)%20%7B%0A%09%09%09%09%09%09this.y%20-%3D%200.01%20*%20s%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09this.y%20%2B%3D%200.05%20*%20s%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%0A%09%09%09%7B%0A%09%09%09%09x%3A%203%2C%0A%09%09%09%09y%3A%2064%2C%0A%09%09%09%09f(s%2C%20d)%20%7B%0A%09%09%09%09%09this.y%20%2B%3D%200.015%20*%20s%3B%0A%09%09%09%09%09if%20(d%20%3E%200)%20%7B%0A%09%09%09%09%09%09this.y%20%2B%3D%200.05%20*%20s%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09this.y%20-%3D%200.01%20*%20s%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%5D%2C%0A%09%09links%3A%20%5B%0A%09%09%09%7B%20p0%3A%203%2C%20p1%3A%207%2C%20size%3A%2012%2C%20lum%3A%200.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%201%2C%20p1%3A%203%2C%20size%3A%2024%2C%20lum%3A%200.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%201%2C%20p1%3A%200%2C%20size%3A%2060%2C%20lum%3A%200.5%2C%20disk%3A%201%20%7D%2C%0A%09%09%09%7B%20p0%3A%205%2C%20p1%3A%209%2C%20size%3A%2016%2C%20lum%3A%200.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%202%2C%20p1%3A%205%2C%20size%3A%2032%2C%20lum%3A%200.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%201%2C%20p1%3A%202%2C%20size%3A%2050%2C%20lum%3A%201%20%7D%2C%0A%09%09%09%7B%20p0%3A%206%2C%20p1%3A%2010%2C%20size%3A%2016%2C%20lum%3A%201.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%202%2C%20p1%3A%206%2C%20size%3A%2032%2C%20lum%3A%201.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%204%2C%20p1%3A%208%2C%20size%3A%2012%2C%20lum%3A%201.5%20%7D%2C%0A%09%09%09%7B%20p0%3A%201%2C%20p1%3A%204%2C%20size%3A%2024%2C%20lum%3A%201.5%20%7D%0A%09%09%5D%0A%09%7D%3B%0A%09%2F%2F%20—-%20instanciate%20robots%20—-%0A%09for%20(let%20i%20%3D%200%3B%20i%20%3C%206%3B%20i%2B%2B)%20%7B%0A%09%09dancers.push(%0A%09%09%09new%20Robot(%0A%09%09%09%09i%20*%20360%20%2F%207%2C%0A%09%09%09%0980%2C%0A%09%09%09%09(window.location.href.indexOf(%22fullcpgrid%22)%20%3E%20-1)%20%3F%203%20%3A%204%2C%0A%09%09%09%09(i%20%2B%202)%20*%20canvas.width%20%2F%209%2C%0A%09%09%09%09canvas.height%20*%20ground%20-%20300%2C%0A%09%09%09%09struct%0A%09%09%09)%0A%09%09)%3B%0A%09%7D%0A%09run()%3B%0A%7D%0A“,“css“:“body%2C%20html%20%7B%0A%09position%3A%20absolute%3B%0A%09margin%3A%200%3B%0A%09padding%3A%200%3B%0A%09width%3A%20100%25%3B%0A%09height%3A%20100%25%3B%0A%09overflow%3A%20hidden%3B%0A%7D%0A%0Acanvas%20%7B%0A%09position%3A%20absolute%3B%0A%09width%3A%20100%25%3B%0A%09height%3A%20100%25%3B%0A%09background%3A%23000%3B%0A%09cursor%3A%20pointer%3B%0A%7D“}}”][snippet_preview_vc code=”{“settings“:{“resources“:`{“}`},“code“:{“html“:“IK%20Nu“,“js“:““,“css“:““}}”][snippet_preview_vc code=””][/vc_column][/vc_row]