lonestar108 commited on
Commit
c397312
·
verified ·
1 Parent(s): dcefd47

Manual changes saved

Browse files
Files changed (1) hide show
  1. index.html +7 -7
index.html CHANGED
@@ -178,7 +178,7 @@
178
 
179
  if (distance > params.minDistance && distance < params.maxDistance) {
180
  // Primary phase-based force
181
- const force = Math.cos(this.phase) * params.interactionStrength / distance;
182
  fx += force * dx;
183
  fy += force * dy;
184
 
@@ -192,9 +192,9 @@
192
  other.primeFactors.includes(factor));
193
 
194
  if (sharedFactors.length > 0) {
195
- const magneticForce = sharedFactors.length * 0.5 / distance;
196
- this.vx += magneticForce * dx * 0.1;
197
- this.vy += magneticForce * dy * 0.1;
198
  }
199
  }
200
  }
@@ -203,7 +203,7 @@
203
  if (nearbyParticles > 0) {
204
  const avgPhase = totalPhase / nearbyParticles;
205
  const avgDistance = totalDistance / nearbyParticles;
206
- const phaseInfluence = (nearbyParticles * avgPhase) / avgDistance * 0.01;
207
  this.phase = (this.phase + phaseInfluence) % (2 * Math.PI);
208
  if (this.phase < 0) this.phase += 2 * Math.PI;
209
  }
@@ -213,8 +213,8 @@
213
  this.vy += fy * 0.01;
214
 
215
  // Velocity damping
216
- this.vx *= 0.99;
217
- this.vy *= 0.99;
218
 
219
  // Update color based on new phase
220
  this.color = this.getPhaseColor();
 
178
 
179
  if (distance > params.minDistance && distance < params.maxDistance) {
180
  // Primary phase-based force
181
+ const force = Math.PI + Math.cos(this.phase) * params.interactionStrength / distance;
182
  fx += force * dx;
183
  fy += force * dy;
184
 
 
192
  other.primeFactors.includes(factor));
193
 
194
  if (sharedFactors.length > 0) {
195
+ const magneticForce = sharedFactors.length * 0.05 / distance;
196
+ this.vx += magneticForce * dx * 0.01;
197
+ this.vy += magneticForce * dy * 0.01;
198
  }
199
  }
200
  }
 
203
  if (nearbyParticles > 0) {
204
  const avgPhase = totalPhase / nearbyParticles;
205
  const avgDistance = totalDistance / nearbyParticles;
206
+ const phaseInfluence = (nearbyParticles * avgPhase) / avgDistance * 0.1;
207
  this.phase = (this.phase + phaseInfluence) % (2 * Math.PI);
208
  if (this.phase < 0) this.phase += 2 * Math.PI;
209
  }
 
213
  this.vy += fy * 0.01;
214
 
215
  // Velocity damping
216
+ this.vx *= 0.96;
217
+ this.vy *= 0.96;
218
 
219
  // Update color based on new phase
220
  this.color = this.getPhaseColor();