Tetrahedron

LazySets.TetrahedronModule.TetrahedronType
Tetrahedron{N, VN<:AbstractVector{N}, VT<:AbstractVector{VN}} <: AbstractPolytope{N}

Type that represents a (3-dimensional) tetrahedron in vertex representation.

Fields

  • vertices – list of vertices

Examples

A tetrahedron can be constructed by passing the list of vertices. The following builds the tetrahedron with edge length 2 from the wikipedia page Tetrahedron:

julia> vertices = [[1, 0, -1/sqrt(2)], [-1, 0, -1/sqrt(2)], [0, 1, 1/sqrt(2)], [0, -1, 1/sqrt(2)]];

julia> T = Tetrahedron(vertices);

julia> dim(T)
3

julia> zeros(3) ∈ T
true

julia> σ(ones(3), T)
3-element Vector{Float64}:
 0.0
 1.0
 0.7071067811865475
source

Operations

Base.:∈Method
∈(x::AbstractVector, X::LazySet)

Check whether a point lies in a set.

Input

  • x – point/vector
  • X – set

Output

true iff $x ∈ X$.

source
Base.:∈Method

Extended help

∈(x::AbstractVector, T::Tetrahedron)

Algorithm

For each plane of the tetrahedron, we check if the point x is on the same side as the remaining vertex. We need to check this for each plane [1].

[1] https://stackoverflow.com/questions/25179693/how-to-check-whether-the-point-is-in-the-tetrahedron-or-not

source
LazySets.API.σMethod
σ(d::AbstractVector, X::LazySet)

Compute a support vector of a set in a given direction.

Input

  • d – direction
  • X – set

Output

A support vector of X in direction d.

Notes

A convenience alias support_vector is also available.

source
LazySets.API.σMethod

Extended help

σ(d::AbstractVector, T::Tetrahedron)

Algorithm

This method falls back to the VPolytope implementation.

source

Undocumented implementations:

Inherited from LazySet:

Inherited from ConvexSet:

Inherited from AbstractPolyhedron:

Inherited from AbstractPolytope: