diff --git a/docs/src/utilities.md b/docs/src/utilities.md index c3843e94..7cfd81a7 100644 --- a/docs/src/utilities.md +++ b/docs/src/utilities.md @@ -9,6 +9,7 @@ intersect intersect! convexhull convexhull! +translate ``` ## Volume diff --git a/src/repelemop.jl b/src/repelemop.jl index 135a3d91..6060027f 100644 --- a/src/repelemop.jl +++ b/src/repelemop.jl @@ -29,6 +29,21 @@ function vtranslate(p::VRep{T}, v::Union{AbstractVector{S}}) where {S, T} similar(p, d, Tout, vmap(f, d, Tout, p)...) end +""" + translate(p::Polyhedra.Rep, v::AbstractVector) + +Computes translation of the polyhedron `p` with the vector `v`. +That is, computes +```math +\\{\\, x + v \\mid x \\in p \\,\\}. +``` +By default, if the H-representation, it simply translates every hyperplanes and halfspace, +otherwise, it translates every points of the V-representation. +That is, this operation can be achieved both in the H-representation and V-representation +hence does not trigger any representation conversion. +""" +function translate end + translate(p::HRep, v) = htranslate(p, v) translate(p::VRep, v) = vtranslate(p, v) function translate(p::Polyhedron, v)