-
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
rotation_between
for general dimensions
#257
rotation_between
for general dimensions
#257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #257 +/- ##
==========================================
+ Coverage 89.51% 89.84% +0.32%
==========================================
Files 15 17 +2
Lines 1593 1615 +22
==========================================
+ Hits 1426 1451 +25
+ Misses 167 164 -3
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
What about making this helper function a new rotation type instead? Maybe a simple |
What's the benefit of the new type julia> range(1,2,3)
1.0:0.5:2.0
julia> range(1,3)
1:3
julia> range(1,2,3) |> typeof
StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
julia> range(1,3) |> typeof
UnitRange{Int64} julia> rotation_between(SVector(1,2), SVector(2,1))
2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(-0.643501):
0.8 0.6
-0.6 0.8
julia> rotation_between(SVector(1,2,3), SVector(2,1,3))
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.981981, 0.109109, 0.109109, -0.109109)):
0.952381 0.238095 0.190476
-0.190476 0.952381 -0.238095
-0.238095 0.190476 0.952381
julia> rotation_between(SVector(1,2), SVector(2,1)) |> typeof
Angle2d{Float64}
julia> rotation_between(SVector(1,2,3), SVector(2,1,3)) |> typeof
QuatRotation{Float64}
Julia style guide, blue style, and sciml style recommend using |
Makes sense. Feel free to ignore the suggestion. Looking forward to seeing
it merged.
Em dom., 14 de mai. de 2023 12:30, Yuto Horikawa ***@***.***>
escreveu:
… What about making this helper function a new rotation type instead? Maybe
a simple Between(u, v)? That would avoid using the naming convention with
underscore.
What's the benefit of the new type Between?
The role of rotation_between is similar to range. These functions return
various types which depend on their inputs.
julia> range(1,2,3)1.0:0.5:2.0
julia> range(1,3)1:3
julia> range(1,2,3) |> typeof
StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
julia> range(1,3) |> typeof
UnitRange{Int64}
julia> rotation_between(SVector(1,2), SVector(2,1))2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(-0.643501):
0.8 0.6
-0.6 0.8
julia> rotation_between(SVector(1,2,3), SVector(2,1,3))3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.981981, 0.109109, 0.109109, -0.109109)):
0.952381 0.238095 0.190476
-0.190476 0.952381 -0.238095
-0.238095 0.190476 0.952381
julia> rotation_between(SVector(1,2), SVector(2,1)) |> typeof
Angle2d{Float64}
julia> rotation_between(SVector(1,2,3), SVector(2,1,3)) |> typeof
QuatRotation{Float64}
That would avoid using the naming convention with underscore.
Julia style guide <https://docs.julialang.org/en/v1/manual/style-guide/>, blue
style <https://github.com/invenia/BlueStyle>, and sciml style
<https://github.com/SciML/SciMLStyle> recommend using snake_case, so
there's no problem with underscores.
—
Reply to this email directly, view it on GitHub
<#257 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3IMDBSIHRZ6M5IT6HDXGD3CBANCNFSM6AAAAAAXXEETEA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This PR fixes #256.