Hyperplane
LazySets.HyperplaneModule.Hyperplane
— TypeHyperplane{N, VN<:AbstractVector{N}} <: AbstractPolyhedron{N}
Type that represents a hyperplane of the form $a⋅x = b$.
Fields
a
– normal direction (non-zero)b
– constraint
Examples
The plane $y = 0$:
julia> Hyperplane([0, 1.], 0.)
Hyperplane{Float64, Vector{Float64}}([0.0, 1.0], 0.0)
Operations
LazySets.API.an_element
— Methodan_element(H::Hyperplane)
Return some element of a hyperplane.
Input
H
– hyperplane
Output
An element on the hyperplane.
LazySets.constrained_dimensions
— Methodconstrained_dimensions(H::Hyperplane)
Return the dimensions in which a hyperplane is constrained.
Input
H
– hyperplane
Output
A vector of ascending indices i
such that the hyperplane is constrained in dimension i
.
Examples
A 2D hyperplane with constraint $x_1 = 0$ is constrained in dimension 1 only.
LazySets.API.constraints_list
— Methodconstraints_list(H::Hyperplane)
Return the list of constraints of a hyperplane.
Input
H
– hyperplane
Output
A list containing two half-spaces.
LazySets.API.dim
— Methoddim(H::Hyperplane)
Return the dimension of a hyperplane.
Input
H
– hyperplane
Output
The ambient dimension of the hyperplane.
LazySets.API.isbounded
— Methodisbounded(H::Hyperplane)
Check whether a hyperplane is bounded.
Input
H
– hyperplane
Output
true
iff H
is one-dimensional.
Base.isempty
— Methodisempty(H::Hyperplane)
Check whether a hyperplane is empty.
Input
H
– hyperplane
Output
false
.
LazySets.API.isuniversal
— Functionisuniversal(H::Hyperplane, [witness]::Bool=false)
Check whether a hyperplane is universal.
Input
P
– hyperplanewitness
– (optional, default:false
) compute a witness if activated
Output
- If
witness
option is deactivated:false
- If
witness
option is activated:(false, v)
where $v ∉ P$
Algorithm
A witness is produced by adding the normal vector to an element on the hyperplane.
LinearAlgebra.normalize
— Methodnormalize(H::Hyperplane{N}, p::Real=N(2)) where {N}
Normalize a hyperplane.
Input
H
– hyperplanep
– (optional, default:2
) norm
Output
A new hyperplane whose normal direction $a$ is normalized, i.e., such that $‖a‖_p = 1$ holds.
Base.rand
— Methodrand(::Type{Hyperplane}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
[rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)
Create a random hyperplane.
Input
Hyperplane
– type for dispatchN
– (optional, default:Float64
) numeric typedim
– (optional, default: 2) dimensionrng
– (optional, default:GLOBAL_RNG
) random number generatorseed
– (optional, default:nothing
) seed for reseeding
Output
A random hyperplane.
Algorithm
All numbers are normally distributed with mean 0 and standard deviation 1. Additionally, the constraint a
is nonzero.
ReachabilityBase.Arrays.distance
— Methoddistance(x::AbstractVector, H::Hyperplane{N}) where {N}
Compute the distance between point x
and hyperplane H
with respect to the Euclidean norm.
Input
x
– vectorH
– hyperplane
Output
A scalar representing the distance between point x
and hyperplane H
.
Base.:∈
— Method∈(x::AbstractVector, H::Hyperplane)
Check whether a given point is contained in a hyperplane.
Input
x
– point/vectorH
– hyperplane
Output
true
iff $x ∈ H$.
Algorithm
We just check whether $x$ satisfies $a⋅x = b$.
LazySets.API.project
— Methodproject(x::AbstractVector, H::Hyperplane)
Project a point onto a hyperplane.
Input
x
– pointH
– hyperplane
Output
The projection of x
onto H
.
Algorithm
The projection of $x$ onto the hyperplane of the form $a⋅x = b$ is
\[ x - \dfrac{a (a⋅x - b)}{‖a‖²}\]
LazySets.API.reflect
— Methodreflect(x::AbstractVector, H::Hyperplane)
Reflect (mirror) a vector in a hyperplane.
Input
x
– point/vectorH
– hyperplane
Output
The reflection of x
in H
.
Algorithm
The reflection of a point $x$ in the hyperplane $a ⋅ x = b$ is
\[ x − 2 \frac{x ⋅ a − b}{a ⋅ a} a\]
where $u · v$ denotes the dot product.
LazySets.API.ρ
— Methodρ(d::AbstractVector, H::Hyperplane)
Evaluate the support function of a hyperplane in a given direction.
Input
d
– directionH
– hyperplane
Output
The support function of the hyperplane. If the set is unbounded in the given direction, the result is Inf
.
LazySets.API.σ
— Methodσ(d::AbstractVector, H::Hyperplane)
Return a support vector of a hyperplane.
Input
d
– directionH
– hyperplane
Output
A support vector in the given direction, which is only defined in the following two cases:
- The direction has norm zero.
- The direction is the hyperplane's normal direction or its opposite direction.
In all cases, any point on the hyperplane is a solution. Otherwise this function throws an error.
LazySets.API.translate
— Methodtranslate(H::Hyperplane, v::AbstractVector; share::Bool=false)
Translate (i.e., shift) a hyperplane by a given vector.
Input
H
– hyperplanev
– translation vectorshare
– (optional, default:false
) flag for sharing unmodified parts of the original set representation
Output
A translated hyperplane.
Notes
The normal vector of the hyperplane (vector $a$ in $a⋅x = b$) is shared with the original hyperplane if share == true
.
Algorithm
A hyperplane $a⋅x = b$ is transformed to the hyperplane $a⋅x = b + a⋅v$. In other words, we add the dot product $a⋅v$ to $b$.
Inherited from LazySet
:
Inherited from AbstractPolyhedron
: