-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mul<Bivec3>
implementation for Mat3
#30
Comments
Hmm... |
Not a user of this language repo, but mathematically speaking, there are two possibilities for interpreting a matrix times a bivector. In one interpretation, you convert the bivector to a vector and do a standard multiply. In the other intepretation, you would think of the matrix as a dyadic tensor (column vectors nested inside a vector), and then use the Grassmann interior product as a tensor contraction. Maybe there is another way you can think of it also. |
If you diagonalize your inertia tensor you don't need a matrix multiply. Haven't thought through what you do with that diagonalized tensor though. The start of this paper has some info: https://marctenbosch.com/ndphysics/NDrigidbody.pdf |
@Emiluren just for reference, I posted this issue in a geometric algebra related discord recently as I'm a bit out of my depth (I know next to nothing about physics simulation) and these nice people decided to weigh in... if you read that paper and figure out what it is that you need ultraviolet to do, I'm happy to implement it (or you could yourself if you wish!) |
@chakravala and I both pretty much suggested converting from/to bivector to/from vector and doing a matrix multiply with the inertia tensor as the simplest solution. For that I think @termhn you just need a
|
I don't think you want to take the dual and transform that, that results in the wrong transformation - you'll end up with a transformed bivector not matching the bivector formed from wedging two transformed vectors. Instead, you should take an outermorphism of the matrix, which in 3d is a matrix with (some permutation of) columns |
I'm with @mewertd2 here, diagonalising the inertia tensor is definitely the way to go, then you are basically just applying a scaling to the components of the bivector. If you are after an easy way of calculating the inertia tensor and inverse and applying it to a bivector (and you are using an axis aligned body frame) then take these formulae: https://slides.com/hugohadfield/game2020#/54 and ignore all the t^i and t_i bits. |
Thank you all for the suggestions! As soon as I have time I'm going to have to see if I can write some code based on this. |
No, it probably shouldn't. The natural thing to do here is the outermorphism, i.e. |
I am currently writing a physics engine (just to learn) and I happened to find
ultraviolet
while looking for a linear algebra library. I had never heard of geometric algebra before so learning about bivectors and rotors was interesting.I managed to figure out that torque should probably be represented by a bivector but I ran into a problem when I was going to calculate the angular acceleration. I am assuming that the inverse of the inertia tensor can still be represented by a 3x3 matrix but I noticed that there is no implementation of
Mul<Bivec3>
forMat3
. Should there be one or am I going about this in the wrong way?I am also considering using a
Bivec3
(which I noticed has an implementation ofMul<Bivec3>
) for the inertia tensor but I guess this would only let me have the equivalent of a diagonal matrix.The text was updated successfully, but these errors were encountered: