Closed schillic closed 6 years ago
where x
is a point? for polygons we should check point in polygon algorithms.
agreed for overloading in
.. still we can use is_contained
in the mathematical sense, as for #69
Yes, x
is a point. Should it be a Vector
or a Singleton
?
We can provide a convenience conversion function for the other combination.
we can implement it with sets, i.e. using Singleton
, and also provide the shortcut for x
being a Vector.
I thought about it and I think it is more efficient to unwrap a Singleton
(which is anyway what has to be done) in one case than to wrap a vector in a Singleton
in the other case.
So I want to implement it for AbstractVector
and provide a conversion function for Singleton
.
Where would we define the conversion function? Inside LazySets.jl
? Maybe we should create a new file for general LazySet
functions (we already have norm
/radius
/diameter
in box_approximations.jl
, so we could move them there as well).
for polygons we should check point in polygon algorithms.
Thanks for this pointer. I will implement the "dot product" solution from the bottom of the page.
The algorithms in this link work for nonconvex polygons, and at the bottom it is said "Simpler algorithms are possible for [...] convex polygons [...]."
We also already have an implementation for HPolygon
using support vectors. Not sure if this is "optimal", though.
We can always add better algorithms later, for now I just want one solution.
We are not 100% sure that the Zonotope implementation works in all cases, but keep it for now. @schillic expects it to fail for linearly dependent generators only.
Most types are now supported by #74. Eventually we can continue in #77 with the missing ones.
Add a containment check
∈(x, S)
for all sets.For some we already have
is_contained
. I preferin
instead (the Julia alias for∈
).