-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
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?