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

Add more rotation_between methods for general dimensions #256

Closed
hyrodium opened this issue May 5, 2023 · 0 comments · Fixed by #257
Closed

Add more rotation_between methods for general dimensions #256

hyrodium opened this issue May 5, 2023 · 0 comments · Fixed by #257

Comments

@hyrodium
Copy link
Collaborator

hyrodium commented May 5, 2023

julia> using StaticArrays

julia> rotation_between(SVector(1,2,3,5),SVector(1,3,2,5))  # Can be `Rotation{4}`
ERROR: DimensionMismatch: No precise constructor for SVector{3} found. Size of input was (4,).
Stacktrace:
 [1] _no_precise_size(SA::Type, x::SVector{4, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:157
 [2] length_match_size(#unused#::Type{SVector{3}}, x::SVector{4, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:125
 [3] adapt_size(#unused#::Type{SVector{3}}, x::SVector{4, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:94
 [4] construct_type(#unused#::Type{SVector{3}}, x::SVector{4, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:87
 [5] StaticArray
   @ ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:166 [inlined]
 [6] rotation_between(from::SVector{4, Int64}, to::SVector{4, Int64})
   @ Rotations ~/.julia/packages/Rotations/qfW3h/src/unitquaternion.jl:320
 [7] top-level scope
   @ REPL[19]:1

julia> rotation_between(SVector(3,1),SVector(1,3))  # Can be `Rotation{2}`
ERROR: DimensionMismatch: No precise constructor for SVector{3} found. Size of input was (2,).
Stacktrace:
 [1] _no_precise_size(SA::Type, x::SVector{2, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:157
 [2] length_match_size(#unused#::Type{SVector{3}}, x::SVector{2, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:125
 [3] adapt_size(#unused#::Type{SVector{3}}, x::SVector{2, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:94
 [4] construct_type(#unused#::Type{SVector{3}}, x::SVector{2, Int64})
   @ StaticArrays ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:87
 [5] StaticArray
   @ ~/.julia/packages/StaticArrays/VLqRb/src/convert.jl:166 [inlined]
 [6] rotation_between(from::SVector{2, Int64}, to::SVector{2, Int64})
   @ Rotations ~/.julia/packages/Rotations/qfW3h/src/unitquaternion.jl:320
 [7] top-level scope
   @ REPL[20]:1

After this change, rotation_betewwn(::Vector, ::Vector) should be removed for consistency and type-stability.

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

Successfully merging a pull request may close this issue.

1 participant