Skip to content

Commit 3b289dd

Browse files
authored
Merge pull request #168 from JuliaPolyhedra/bl/doc_tranlate
Add doc for translate
2 parents 8a0d39a + 4442d35 commit 3b289dd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/src/utilities.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ intersect
99
intersect!
1010
convexhull
1111
convexhull!
12+
translate
1213
```
1314

1415
## Volume

src/repelemop.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ function vtranslate(p::VRep{T}, v::Union{AbstractVector{S}}) where {S, T}
2929
similar(p, d, Tout, vmap(f, d, Tout, p)...)
3030
end
3131

32+
"""
33+
translate(p::Polyhedra.Rep, v::AbstractVector)
34+
35+
Computes translation of the polyhedron `p` with the vector `v`.
36+
That is, computes
37+
```math
38+
\\{\\, x + v \\mid x \\in p \\,\\}.
39+
```
40+
By default, if the H-representation, it simply translates every hyperplanes and halfspace,
41+
otherwise, it translates every points of the V-representation.
42+
That is, this operation can be achieved both in the H-representation and V-representation
43+
hence does not trigger any representation conversion.
44+
"""
45+
function translate end
46+
3247
translate(p::HRep, v) = htranslate(p, v)
3348
translate(p::VRep, v) = vtranslate(p, v)
3449
function translate(p::Polyhedron, v)

0 commit comments

Comments
 (0)