-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support complex domains (e.g., circle in the complex plane) #1
Comments
The original idea was to support this by identifying R^2 with C. This way, any 2D domain can be used as a subset of the complex plane. As a matter of fact, this is currently working, but it is not user-friendly yet and it does result in a very strange object (a unit disk with an affine map to set the radius, and an embedding map for identifying with the plane). Of course, for popular domains such as circles and, say, Bernstein ellipses, there could be a special-purpose type as well with a straightforward implementation. |
I think that would be confusing, and one should only support conversion: in(d::Domain{T}, x) where T = in(d, convert(T, x)) This would throw an error if I would rewrite the circle code to support non- struct UnitSphere{N,T} <: Domain{T}
end
const Circle{T} = UnitSphere{2,T}
const Sphere{T} = UnitBall{3,T}
circle(::Type{T} = Float64) where {T} = Circle{SVector{2,T}}() Then a complex-valued unit circle could be represented as |
Sorry, calling convert doesn't work: one wants to actually do the following: function in(x, d::Domain)
T = promote_type(typeof(x), eltype(d))
T == Any && return false
in(convert(T, x), convert(Domain{T}, d))
end so that we can do |
PS I'm going to just make the changes I want to make in the branch |
I think this makes sense: change it to struct UnitHyperSphere{T} <: Domain{T} end
const UnitCircle{T} = UnitHyperSphere{SVector{2,T}}
const UnitSphere{T} = UnitHyperSphere{SVector{3,T}}
const ComplexUnitCircle{T} = UnitHyperSphere{Complex{T}} Here the definition of |
Old issue but still relevant. With the current generic definitions of balls and spheres, I'm adding: const ComplexUnitCircle{T} = FixedUnitSphere{Complex{T}}
const ComplexUnitDisk{T,C} = FixedUnitBall{Complex{T},C}
ComplexUnitCircle() = ComplexUnitCircle{Float64}()
ComplexUnitDisk() = ComplexUnitDisk{Float64}()
ComplexUnitDisk{Float64}() = ComplexUnitDisk{Float64,:closed}() The open complex unit disk can be made, if one is so inclined, using |
No description provided.
The text was updated successfully, but these errors were encountered: