[ot|[spam][crazy] Struggles with OOP and Trees

Undiscussed Horrific Abuse, One Victim of Many gmkarl at gmail.com
Fri Mar 18 05:49:13 PDT 2022


Maybe it's nice to assume I already implemented a data structure.

Something I played with when an adolescent was simple particle systems.

Local updates:
# particle
def update(self, ms):
  self.vel += self.accel * ms
  self.pos += self.vel * ms

# container
def update(self, ms):
  for particle in self.particles:
    particle.update(ms)


Global updates:
def update(self, ms):
  for particle in self.particles:
    particle.vel += particle.accel * ms
    particle.pos += particle.vel * ms

How could we apply graphs to it?
Maybe we could handle more particles at once by updating only those within
a moving region. Would this use graphs? what would be needed ...

- each particle would have a time of last update
- the update function would use calculus
- updates would generate and destroy batches of particles based on lifetime

Seems more like lists than graphs. What if there are multiple windows? No,
just makes multiple lists.

We'd better make the particles have a hierarchy of reference frames, to use
a graph structure I suppose.

I'm happy I wrote the particle update code above. Quite hard for me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/html
Size: 1888 bytes
Desc: not available
URL: <https://lists.cpunks.org/pipermail/cypherpunks/attachments/20220318/b0b9d04c/attachment.txt>


More information about the cypherpunks mailing list