-
Notifications
You must be signed in to change notification settings - Fork 37
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
What is n::Bool in the Quaternion constructor? #36
Comments
The Quaternions.jl/src/Quaternion.jl Lines 1 to 7 in 01d45b4
It includes a field to indicate whether the quaternion has unit length. The killer app for quaternions is that a unit-length quaternion can represent a rotations in 3D. You might think of it as a way to cache the computation of computing the length. FYI, not many libraries implement quaternions in this way from what I see. |
The problem with this implementation is (or was, at least) that one could create a non-unit quaternion and set |
The point is to avoid unnecessary computation, so I don't see a way around that problem. |
The constructor should check it a passed quadruple can represent a unit quaternion. |
That "check" is exactly the unnecessary computation I mean. There are cases where you know that the quadruple has unit length. For example, if you wanted to ignore floating point issues, you might want to assert that multiplying two unit-length quaternions produces a unit-length quaternion. |
The |
What is
n::Bool=false
in the Quaternion constructor? What does it represent?The text was updated successfully, but these errors were encountered: