You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
angle refers to the argument in the complex plane, and so the current definition is correct as the argument does not change if we perturb a real number by a small real ε perturbation. Two other examples:
angle(dual(im,im)) # returns π/2+0ε as the argument stays fixedangle(dual(1,im)) # returns 0+ε as the argument changes
Your proposed angle could be implemented as a separate function DualNumbers.dualangle. Overriding Base.angle would be confusing in the context of complex numbers. This confusion is the reason that Base.real overrides were replaced with DualNumbers.realpart.
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
andq
: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 settingp = 0
we get the Dual numbers,p = 1
gives Double numbers, andp = -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 forp = -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
.The text was updated successfully, but these errors were encountered: