# Hyperplane

LazySets.HyperplaneType
Hyperplane{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)
source
LazySets.dimMethod
dim(hp::Hyperplane)

Return the dimension of a hyperplane.

Input

• hp – hyperplane

Output

The ambient dimension of the hyperplane.

source
LazySets.ρMethod
ρ(d::AbstractVector, hp::Hyperplane)

Evaluate the support function of a hyperplane in a given direction.

Input

• d – direction
• hp – hyperplane

Output

The support function of the hyperplane. If the set is unbounded in the given direction, the result is Inf.

source
LazySets.σMethod
σ(d::AbstractVector, hp::Hyperplane)

Return the support vector of a hyperplane.

Input

• d – direction
• hp – hyperplane

Output

The support vector in the given direction, which is only defined in the following two cases:

1. The direction has norm zero.
2. The direction is the hyperplane's normal direction or its opposite direction.

In all cases, the result is any point on the hyperplane. Otherwise this function throws an error.

source
Base.:∈Method
∈(x::AbstractVector, hp::Hyperplane)

Check whether a given point is contained in a hyperplane.

Input

• x – point/vector
• hp – hyperplane

Output

true iff $x ∈ hp$.

Algorithm

We just check if $x$ satisfies $a⋅x = b$.

source
LazySets.an_elementMethod
an_element(hp::Hyperplane)

Return some element of a hyperplane.

Input

• hp – hyperplane

Output

An element on the hyperplane.

source
Base.randMethod
rand(::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 dispatch
• N – (optional, default: Float64) numeric type
• dim – (optional, default: 2) dimension
• rng – (optional, default: GLOBAL_RNG) random number generator
• seed – (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.

source
LazySets.isboundedMethod
isbounded(hp::Hyperplane)

Determine whether a hyperplane is bounded.

Input

• hp – hyperplane

Output

true iff hp is one-dimensional.

source
LazySets.isuniversalFunction
isuniversal(hp::Hyperplane, [witness]::Bool=false)

Check whether a hyperplane is universal.

Input

• P – hyperplane
• witness – (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.

source
Base.isemptyMethod
isempty(hp::Hyperplane)

Return if a hyperplane is empty or not.

Input

• hp – hyperplane

Output

false.

source
LazySets.constrained_dimensionsMethod
constrained_dimensions(hp::Hyperplane)

Return the indices in which a hyperplane is constrained.

Input

• hp – hyperplane

Output

A vector of ascending indices i such that the hyperplane is constrained in dimension i.

Examples

A 2D hyperplane with constraint $x1 = 0$ is constrained in dimension 1 only.

source
LazySets.constraints_listMethod
constraints_list(hp::Hyperplane)

Return the list of constraints of a hyperplane.

Input

• hp – hyperplane

Output

A list containing two half-spaces.

source
LazySets.translateMethod
translate(hp::Hyperplane, v::AbstractVector; share::Bool=false)

Translate (i.e., shift) a hyperplane by a given vector.

Input

• hp – hyperplane
• v – translation vector
• share – (optional, default: false) flag for sharing unmodified parts of the original set representation

Output

A translated hyperplane.

Notes

The normal vectors 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$.

source
LinearAlgebra.normalizeMethod
normalize(H::Hyperplane{N}, p=N(2)) where {N}

Normalize a hyperplane.

Input

• H – hyperplane
• p – (optional, default: 2) norm

Output

A new hyperplane whose normal direction $a$ is normalized, i.e., such that $‖a‖_p = 1$ holds.

source
ReachabilityBase.Arrays.distanceMethod
distance(x::AbstractVector, H::Hyperplane{N}) where {N}

Compute the distance between point x and hyperplane H with respect to the Euclidean norm.

Input

• x – vector
• H – hyperplane

Output

A scalar representing the distance between point x and hyperplane H.

source
LazySets.reflectMethod
reflect(x::AbstractVector, H::Hyperplane)

Reflect (mirror) a vector in a hyperplane.

Input

• x – vector
• H – hyperplane

Output

The reflection of x in H.

Algorithm

The reflection of a point $p$ in the hyperplane $a ⋅ x = b$ is

$$$p − 2 rac{p ⋅ a − c}{a ⋅ a} a$$$

where $x · y$ denotes the dot product.

source
LazySets.projectMethod
project(x::AbstractVector, hp::Hyperplane)

Project a point onto a hyperplane.

Input

• x – point
• hp – hyperplane

Output

The projection of x onto hp.

Algorithm

The projection of $x$ onto the hyperplane of the form $a⋅x = b$ is

$$$x - \dfrac{a (a⋅x - b)}{‖a‖²}$$$
source

Inherited from ConvexSet: