-
Notifications
You must be signed in to change notification settings - Fork 159
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
eigenvalues and eigenvectors #321
Comments
Out of curiosity, what do you want to use them for? I have not seen eigenvalues and eigenvectors used in the context of game dev that I can recall. I don't mean to question adding them, I just like to understand the use case of features before adding them. |
I'm doing an animation drawing program not a game, and I'm computing the moment of inertia tensor to get a first guess as to the relative orientation of two frames. See https://github.com/droundy/sketch/blob/main/src/tween.rs#L205 |
Is this still relevant? I've implemented the methods myself in the past for this crate whenever I needed them and would be open to give it a try. However, I feel like implementing methods for calculating the Eigenpair might be not as simple as it might seem. Talking points
Currently, glam doesn't have a implementation for complex numbers (which it shouldn't IMO).
The Eigenpair implementation for 2x2 shouldn't be a big problem, 3x3 on the other hand might get ugly.
QR (and I think househoulder too) is implemented iterative. It is possible to find a upper bound for the error but we might want to agree on a error we allow for optimization reasons.
How do we respond to a 0 or close-to-0 matrix? Sure we could panic but this would be unpractical, considering that the user would need to make sure that the matrix is allowed.
We might end up with 'slightly complex' eigenvalues through numerical errors. Would we map them to a real number with the risk of returning eigenvalues that shouldn't be returned or do we make sure to only return real eigenvalues with the risk of loosing some through numerical errors. |
It would be nice to have methods to compute the eigenvalues and eigenvectors of matrices.
The text was updated successfully, but these errors were encountered: