Tetrahedron
LazySets.TetrahedronModule.Tetrahedron
— TypeTetrahedron{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
Operations
Base.:∈
— Method∈(x::AbstractVector, X::LazySet)
Check whether a point lies in a set.
Input
x
– point/vectorX
– set
Output
true
iff $x ∈ X$.
Base.:∈
— MethodExtended 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
LazySets.API.σ
— Methodσ(d::AbstractVector, X::LazySet)
Compute a support vector of a set in a given direction.
Input
d
– directionX
– set
Output
A support vector of X
in direction d
.
Notes
A convenience alias support_vector
is also available.
LazySets.API.σ
— MethodExtended help
σ(d::AbstractVector, T::Tetrahedron)
Algorithm
This method falls back to the VPolytope
implementation.
Undocumented implementations:
Inherited from LazySet
:
complement
area
concretize
constraints
convex_hull
copy(::Type{LazySet})
diameter
eltype
eltype
isoperation
norm
radius
rectify
reflect
singleton_list
surface
vertices
affine_map
exponential_map
is_interior_point
linear_map
sample
scale
ρ
translate
cartesian_product
convex_hull
exact_sum
≈
==
isequivalent
⊂
minkowski_difference
Inherited from ConvexSet
:
Inherited from AbstractPolyhedron
:
Inherited from AbstractPolytope
: