MCPcopy
hub / github.com/mudler/LocalAI / connectParticles

Function connectParticles

core/http/static/p2panimation.js:60–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60function connectParticles() {
61 for (let i = 0; i < particles.length; i++) {
62 for (let j = i + 1; j < particles.length; j++) {
63 const distance = Math.hypot(particles[i].x - particles[j].x, particles[i].y - particles[j].y);
64 if (distance < 150) {
65 ctx.beginPath();
66 ctx.moveTo(particles[i].x, particles[i].y);
67 ctx.lineTo(particles[j].x, particles[j].y);
68 ctx.strokeStyle = `rgba(0, 255, 204, ${1 - distance / 150})`;
69 ctx.stroke();
70 }
71 }
72 }
73}
74
75function initParticles(num) {
76 for (let i = 0; i < num; i++) {

Callers 1

animateFunction · 0.85

Calls 1

strokeMethod · 0.45

Tested by

no test coverage detected