JuliaDiff / JuliaDiff/DualNumbers.jl
Argument of a Dual Number
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 80
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
The following method always seems to return 0 + 0ɛ for positive duals.
angle{T<:Real}(z::DualNumbers.Dual{T})
angle{T<:Real}(z::Dual{T}) = z ≥ 0 ? zero(z) : one(z)*π
This is a lot different than the definition of argument that I'm familiar with. In the generalized complex numbers, parameterized by p and q:
z = x + iy (x, y ∈ R) where i^2 =iq + p (q, p ∈ R)
(so i, ɛ, λ, whatever we call the imaginary unit)
Ignoring q and setting it to zero, and setting p = 0 we get the Dual numbers, p = 1 gives Double numbers, and p = -1 giving the regular Complex numbers. There is a general definition for angle or argument, magnitude or norm, and a very weird concept of unit circle, that is only actually what you would call a circle for p = -1.

So the unit "circle" is everywhere ||z|| = 1, which for duals is just at 1 and -1.
So for duals the argument is y / x. I will link to a paper, and just paste an image of the relevant part here.

Here is a link to the paper this is from:
https://people.rit.edu/harkin/research/articles/generalized_complex_numbers.pdf
The paper also shows how to implement the sinp, cosp, and tanp trig functions for any value of p.
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 at the angle{T<:Real}(z::DualNumbers.Dual{T}) method shown in the issue and read the linked generalized-complex-numbers paper. Compare the current dual-number argument behavior with the proposed definition, and consider the related sinp, cosp, and tanp functions; done means the argument behavior is defined and covered consistently for dual numbers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100