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
{{ message }}
Repository navigation
Move SphericalCoordinate here and use for eltype of spheres? #183
It might be handy to have SphericalCoordinate in this package, but I never saw the domaineltype of sphere being SVector{3,T} as problematic. It is a valid description of the types of elements of the domain, which lives in 3D, just like 2*Unitsphere(). On the other hand, it feels superfluous to use SphericalCoordinate, since the element encodes the domain. You can already use FullSpace{T}() to represent the domain itself.
I agree it would be convenient to have in order to actually represent points on the unit sphere. I'm just not convinced that it should be the default element type of the unit sphere, since there are many other lower dimensional subsets of spaces with the same issue. What would be the element type of 2*UnitSphere()? It feels a bit random to treat this one case.
Then again, I did not think it through. Would it be a breaking change or not?
Also, seems we already have DomainPoint and, more specifically, SpherePoint:
The DomainSets way, if there is such a thing, for generating points on a domain would be to generate them in a parameter domain (parameterdomain) and map them. In this case, the result being of type SVector{3,Float64}, these points would still fail the in test, at least without a tolerance.
There is no parameter domain for a UnitSphere, but there is one for UnitCircle:
julia> d =UnitCircle()
UnitCircle()
julia>parameterdomain(d)
0.0..1.0 (Unit)
julia> m =mapfrom_parameterdomain(d)
FunctionMaps.UnitCircleMap{Float64}()
julia>m(0.4)
2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):-0.80901699437494730.5877852522924732
Ideally, the maps go into FunctionMaps.jl or they are borrowed from an existing package.
Activity
daanhb commentedon Jun 17, 2026
It might be handy to have SphericalCoordinate in this package, but I never saw the
domaineltypeof sphere beingSVector{3,T}as problematic. It is a valid description of the types of elements of the domain, which lives in 3D, just like2*Unitsphere(). On the other hand, it feels superfluous to useSphericalCoordinate, since the element encodes the domain. You can already useFullSpace{T}()to represent the domain itself.dlfivefifty commentedon Jun 17, 2026
SphericalCoordinate <: StaticVector{3} unlike FullSpace
The difference is every spherical coordinate is on the sphere whereas very few of SVector{3} are
daanhb commentedon Jun 17, 2026
I agree it would be convenient to have in order to actually represent points on the unit sphere. I'm just not convinced that it should be the default element type of the unit sphere, since there are many other lower dimensional subsets of spaces with the same issue. What would be the element type of
2*UnitSphere()? It feels a bit random to treat this one case.Then again, I did not think it through. Would it be a breaking change or not?
Also, seems we already have
DomainPointand, more specifically,SpherePoint:DomainSets.jl/src/applications/coordinates.jl
Line 21 in f095869
Yet these types are not <: StaticVector{3}.
dlfivefifty commentedon Jun 17, 2026
Here is the actual issue I'm facing:
I probably mean make it
SphericalCoordinate(r, θ, φ), i.e., the unit sphere is whenr == 1dlfivefifty commentedon Jun 17, 2026
Though I'm not sure how to make a 4D or 5D spherical coordinate ....
In any case I've managed to work around it in HarmonicOrthogonalPolynomials.jl
daanhb commentedon Jun 18, 2026
The DomainSets way, if there is such a thing, for generating points on a domain would be to generate them in a parameter domain (
parameterdomain) and map them. In this case, the result being of typeSVector{3,Float64}, these points would still fail theintest, at least without a tolerance.There is no parameter domain for a UnitSphere, but there is one for UnitCircle:
Ideally, the maps go into FunctionMaps.jl or they are borrowed from an existing package.