JuliaGeometry / JuliaGeometry/Rotations.jl
Add `ComplexRotation <: Rotation{2}`
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 188
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
We now have two types for 2D rotations:
RotMatrix{2}stores four real values as a matrixAngle2dstores one real value as a rotation angle
However, a 2D rotation can be parametrized with two real values $(c,s)$ like
$$
R = \begin{pmatrix}c & -s \\ s & c\end{pmatrix}.
$$
This rotation is the same as a rotation by a complex number $c+is$, and can be implemented like this:
struct ComplexRotation{T} <: Rotation{2,T}
c::Complex{T}
end
This is sometimes useful when we need to generate a rotation from 2D vectors.
See rotation_between for example.
https://github.com/JuliaGeometry/Rotations.jl/blob/f00b07d9d809717bfb6b1d9fc3966e6be059af22/src/rotation_between.jl#L9-L15
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/rotation_between.jl at the linked lines, then compare how RotMatrix{2} and Angle2d implement the Rotation{2} interface. The issue is done when ComplexRotation{T} is added as the proposed Rotation{2,T} implementation and can support the 2D-vector rotation use case described by rotation_between.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100