Simplices.jl documentation

Julia package for computing exact intersection volumes between n-dimensional simplices.

Usage

Simplex intersections are computed by calling simplexintersection with the simplices in question. The simplices must be arrays of size (dim, dim + 1), so that each vertex of the simplex is a column vector.

Simplex properties, e.g. the radius or centroid, can also be computed for individual simplices. There are also some functions that can be used to generate pairs of simplices that overlap in certain ways, or points that lie either outside or inside a simplex (insidepoints and outsidepoints).

3D example

julia> using Simplices

julia> s₁, s₂ = rand(3, 4), rand(3, 4)
([0.616395696370579 0.14671821436480514 0.31370248249135035 0.6651672459661078; 0.871958703176918 0.06935068958425505 0.0029556973527744557 0.879327050384104; 0.40496384509989736 0.7909251090046354 0.44819235278328784 0.20774547015543376], [0.018017212458455667 0.7184157397063102 0.0450117981455922 0.5132384223752198; 0.4811824776995446 0.7727338471902416 0.9866295272784169 0.5283714665467991; 0.25545232698658205 0.14687237331196346 0.9896697691976601 0.6451458949919755])

julia> simplexintersection(s₁, s₂)
0.0036820119679255225

5D example

julia> using Simplices

julia> s₃, s₄ = rand(4, 5), rand(4, 5)
([0.8674089260729394 0.5627645761386033 … 0.21164366460085482 0.6522968988086024; 0.4207436357529286 0.04494153554966607 … 0.4743272673090617 0.08321377070532643; 0.9531991485774147 0.9642747659047786 … 0.8636132856782199 0.5450659062940406; 0.7583636615825962 0.11364869873765726 … 0.2715936784184829 0.4556361706942307], [0.3758967631498633 0.7531763201553767 … 0.7337621362687878 0.9366164011924019; 0.07664711841040739 0.08891501281806335 … 0.5180173797523029 0.8532755513681787; 0.1343268666839763 0.03494782628604476 … 0.23526205919178467 0.8390980173321665; 0.3710836315336774 0.5640679624245002 … 0.17278051868496935 0.5957435352423095])

julia> simplexintersection(s₃, s₄)
0.0