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

Fix the argument type of perpendicular_vector #268

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

hyrodium
Copy link
Collaborator

This PR fixes #265.

Before this PR

julia> using Rotations, StaticArrays

julia> u = MVector(1,0,0)
3-element MVector{3, Int64} with indices SOneTo(3):
 1
 0
 0

julia> v = MVector(-1,0,0)
3-element MVector{3, Int64} with indices SOneTo(3):
 -1
  0
  0

julia> rotation_between(u,v)
ERROR: MethodError: no method matching perpendicular_vector(::MVector{3, Int64})

Closest candidates are:
  perpendicular_vector(::SVector{3})
   @ Rotations ~/.julia/dev/Rotations/src/util.jl:8

Stacktrace:
 [1] rotation_between(u::MVector{3, Int64}, v::MVector{3, Int64})
   @ Rotations ~/.julia/dev/Rotations/src/rotation_between.jl:23
 [2] top-level scope
   @ REPL[4]:1

After this PR

julia> using Rotations, StaticArrays

julia> u = MVector(1,0,0)
3-element MVector{3, Int64} with indices SOneTo(3):
 1
 0
 0

julia> v = MVector(-1,0,0)
3-element MVector{3, Int64} with indices SOneTo(3):
 -1
  0
  0

julia> rotation_between(u,v)
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.0, 0.0, 1.0, 0.0)):
 -1.0  0.0   0.0
  0.0  1.0   0.0
  0.0  0.0  -1.0

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #268 (d8845ef) into master (4240829) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #268   +/-   ##
=======================================
  Coverage   89.93%   89.93%           
=======================================
  Files          17       17           
  Lines        1619     1619           
=======================================
  Hits         1456     1456           
  Misses        163      163           
Files Changed Coverage Δ
src/util.jl 89.47% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hyrodium hyrodium merged commit f6ff1c6 into JuliaGeometry:master Sep 21, 2023
10 checks passed
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 this pull request may close these issues.

Problems with using subtypes of StaticArrays.FieldVector in perpendicular_vector()
1 participant