Skip to content
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

Possible bug in Quaternion #117

Open
SerafeimBakalakos opened this issue Dec 29, 2018 · 2 comments
Open

Possible bug in Quaternion #117

SerafeimBakalakos opened this issue Dec 29, 2018 · 2 comments
Labels

Comments

@SerafeimBakalakos
Copy link
Member

In class ISAAR.MSolve.Numerical.LinearAlgebra.Quaternion methods ApplyIncrementalRotation(Vector incrementalRotation) and ApplyIncrementalRotationToNew(Vector incrementalRotation), note the segment:

        Vector updatedVectorPart = this.vectorPart;
        updatedVectorPart.Scale(scalarPartIncrement);
        updatedVectorPart.Add(scalarPart * vectorPartIncrement);
        Vector incrementCrossVectorPart = vectorPartIncrement ^ this.vectorPart;
        updatedVectorPart.Add(incrementCrossVectorPart);

The first line above does NOT copy the vector in C#. It only creates a new reference to the same vector. This means that as updatedVectorPart is scaled, added, etc, the original this.vectorPart does as well.

The question is: Is this code still correct, taking the above into consideration?

@SerafeimBakalakos
Copy link
Member Author

SerafeimBakalakos commented Dec 29, 2018

Also I do not know if anyone has experience with quaternions. If you do, please assign yourselves.

@vpapado
Copy link
Collaborator

vpapado commented Dec 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants