News for hackers. Stuff that matters.
Re:Build a simple 2D physics engine for JavaScript games (2012) by nileshtrivedi on Wednesday August 24, 2022 @05:31AM (#32576965)
With the right algebra (PGA2D which adds an additional dimension whose unit vector squares to 0), rigid body physics simulation with collision detection/response can be implemented in < 50 lines of Javascript: https://bivector.net/PGADYN.html

Basically in PGA2D, rotations, angular velocity/acceleration, torque etc automatically get handled by geometric product of multivectors. The additional dimension makes all rotations centered at origin, which makes them compose much more nicely.

Re:Build a simple 2D physics engine for JavaScript games (2012) by cyber_kinetist on Wednesday August 24, 2022 @11:16AM (#32580524)
I previous had some exposure to rigid body dynamics using the more conventional Lie group notation used in robotics (as seen here: http://hades.mech.northwestern.edu/index.php/Modern_Robotics and https://www.cs.cmu.edu/~junggon/tools/liegroupdynamics.pdf). But I felt the Lie group theory surrounding it were hard to understand (I don't have that much exposure to abstract algebra, I wasn't a mathematics major).

So you think would PGA aid in understanding the weird properties of SO(3) and SE(3) (and its tangent spaces), as well as writing simulation code with it? I know that people use various representations for rigid transformations (screws vs. dual quaternions vs. exponential maps vs. motors), but I am interested which method would work the best in both a theoretical sense (in understanding the kinematics and dynamics more abstractly) and in a pragmatic sense (difficulty of writing and reading actual simulation code, amount of operations used, SIMD-friendliness, etc.)

Re:Build a simple 2D physics engine for JavaScript games (2012) by nileshtrivedi on Wednesday August 24, 2022 @11:51AM (#32581063)
I'm not qualified enough to answer your question. What I understand is that PGA is not the only game in town. This framework lets one handle algebra with any number of positive, negative and zero dimensions.

You might find Professor Lasenby's 2020 talk (among others at Bivector Youtube channel) useful: https://www.youtube.com/watch?v=m7v2IUJtC3g

https://www.youtube.com/user/EnkiOrigami/videos

Re:Build a simple 2D physics engine for JavaScript games (2012) by joshspankit on Wednesday August 24, 2022 @08:08AM (#32578283)
That website has one of the most elegant simple “wow” moments I’ve ever seen.

I didn’t even notice at first. I just thought “oh that’s cool: they’ve primed the physics so it bounces through neat patterns before settling”. But my brain was gently tapping my shoulder... When I listened to it I noticed it was a hypercube, saw “n-dimensional“, and WOW

Re:Build a simple 2D physics engine for JavaScript games (2012) by cancandan on Wednesday August 24, 2022 @02:07PM (#32583406)
This is great, thanks for the link.