# Finding the vertices of a hypercube

**URL:** <https://discourse.julialang.org/t/finding-the-vertices-of-a-hypercube/57078>\
**Category:** New to Julia\
**Tags:** linearalgebra\
**Created:** [March 13, 2021, 3:10pm UTC](https://discourse.julialang.org/t/finding-the-vertices-of-a-hypercube/57078 "2021-03-13T15:10:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [March 13, 2021, 4:32pm UTC](https://discourse.julialang.org/t/finding-the-vertices-of-a-hypercube/57078/6 "2021-03-13T16:32:38Z")

</div>

`Iterators.product` returns multi-dimensional object. You can add `vec` to flatten it

```julia
julia> vec(collect(Iterators.product(zip(box.min_bounds, box.max_bounds)...)))
8-element Vector{Tuple{Float32, Float32, Float32}}:
 (1.0, 2.0, 3.0)
 (4.0, 2.0, 3.0)
 (1.0, 5.0, 3.0)
 (4.0, 5.0, 3.0)
 (1.0, 2.0, 6.0)
 (4.0, 2.0, 6.0)
 (1.0, 5.0, 6.0)
 (4.0, 5.0, 6.0)

```

---

_[View the full topic](https://discourse.julialang.org/t/finding-the-vertices-of-a-hypercube/57078)._
