-
Notifications
You must be signed in to change notification settings - Fork 44
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
Use internal inverse function instead of Base.inv #274
Comments
The current usage in this package julia> using Rotations
julia> r = QuatRotation(2,1,0,0)
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.894427, 0.447214, 0.0, 0.0)):
1.0 0.0 0.0
0.0 0.6 -0.8
0.0 0.8 0.6
julia> r * inv(r)
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(1.0, 0.0, 0.0, 0.0)):
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0 |
It makes sense if we think of rotations as matrix multiplication always.
Feel free to close the issue if inv is intended.
Em ter., 7 de nov. de 2023 00:09, Yuto Horikawa ***@***.***>
escreveu:
… Base.inv is an inverse operation about the binary operator *, and
InverseFunctions.inverse is an inverse operation about the binary
operator ∘ (\circle).
The current usage in this package inv(::Rotation) is related to *, so we
don't have to switch to InverseFunctions.inverse.
julia> using Rotations
julia> r = QuatRotation(2,1,0,0)3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.894427, 0.447214, 0.0, 0.0)):
1.0 0.0 0.0
0.0 0.6 -0.8
0.0 0.8 0.6
julia> r * inv(r)3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(1.0, 0.0, 0.0, 0.0)):
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
—
Reply to this email directly, view it on GitHub
<#274 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3KC5EYZG7DRF26DBC3YDGQ6ZAVCNFSM6AAAAAA7AB3RHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJXGQYTSOJTGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently
Base.inv
is only intended for multiplicative inverses:We recently learned about InverseFunctions.jl, which introduces a
inverse
function for inverse functions. Rotations.jl could use the same function or add an internal nameinverse
that is not exported by default.We are fixing all our packages to avoid the misuse of
Base.inv
.The text was updated successfully, but these errors were encountered: