Closed mikmoore closed 1 year ago
I'm planning to remove the function in https://github.com/JuliaGeometry/Quaternions.jl/issues/86. Do you have any thoughts on this?
The function was removed in https://github.com/JuliaGeometry/Quaternions.jl/pull/111.
Return type is always
Vector{Float64}
whenangle(q)
is zero orNaN
, leading to a type instability.I'd have made a PR but am not at a machine where I can do so right now. I think something like
will fix the instability and also allow
NaN
propagation. This still doesn't fix the case where only one imaginary componentisinf
, where we could give a reasonable answer (assuming we care to haveaxis
defined for infinite quaternions), but that was broken under the old version too.EDIT: Alternatively,
would be more accurate, propagate
NaN
on only the imaginary part, and would return a well-defined vector for the zero quaternion. If we don't want zero (or any not-convincingly unit quaternion?) to be a valid input, then I'd suggest aDomainError
.