Function reference

Function reference

Intersection

  simplexintersection(S1::Array{Float64, 2}, S2::Array{Float64, 2};
    tolerance::Float64 = 1/10^10) -> Float64

Computes the volume of intersection between two n-dimensional simplices by boundary triangulation. The simplices S1 and S2 are arrays of (n, n+1), where each column is a vertex.

How are intersections computed?

Intersections are computed as follows:

  1. Find minimal set of points generating the intersection volume. These points form

a convex polytope Pᵢ.

  1. Triangulate the faces of Pᵢ into simplices.

  2. Combine each boundary simplex with an interior point in Pᵢ. The set of

all such combinations form a triangulation of Pᵢ.

  1. Calculate the volume of each simplex in the resulting triangulation. The

sum of these volumes is the volume of the intersection.

source

Generate (non)intersecting simplices/points

insidepoints(npts::Int, parentsimplex::Array{T, 2}) where {T<:Number}

Generates npts points that located inside parentsimplex.

source
outsidepoint(parentsimplex::Array{T, 2}) where {T<:Number}

Generate a single point that is guaranteed to lie outside parentsimplex.

source
outsidepoints(npts::Int, parentsimplex::Array{T, 2}) where T <: Number

Generates npts points that located outside parentsimplex.

source
childsimplex(parentsimplex::Array{T, 2}) where {T<:Number} -> Array{Float64, 2}

Generates a random simplex which is entirely contained within parentsimplex, which is a (dim+1)-by-dim array.

source
simplices_sharing_vertices(dim::Int) -> Array{Float64, 2}

Genereate a set of non-trivially intersecting dim-dimensional simplices (i.e. they don't intersect along boundaries or vertices only).

source
nontrivially_intersecting_simplices(dim::Int) -> Array{Float64, 2}

Genereate a set of non-trivially intersecting dim-dimensional simplices (i.e. they don't intersect along boundaries or vertices only).

source

Properties of simplices

orientation(simplex::Array{T, 2}) where {T<:Number} -> Float64

Compute orientation of a simplex, represented by a Array{Float64, 2} of size (dim+1)-by-dim.

source
Simplices.volumeMethod.
volume(simplex::Array{T, 2}) where {T<:Number} -> Float64

Compute the volume of a simplex, represented by a Array{Float64, 2} of size (dim+1)-by-dim.

source
Simplices.radiusMethod.
radius(s::Array{T, 2}) where {T<:Number} -> Float64

Compute radius of a simplex s, represented by a Array{Float64, 2} of size (dim+1)-by-dim.

source
Simplices.radiusMethod.
radius(simplex::Array{T, 2}, centroid::Array{T, 2}) where {T<:Number}

Compute radius of a simplex ((dim+1)-by-dim sized Array{Float64, 2} given its centroid (1-by-dim sized Array{Float64, 2}).

source
Simplices.centroidMethod.
centroid(simplex::Array{Float64, 2}) where {T<:Number} -> Array{Float64, 2}

Computes the centroid of a simplex given by (dim+1)-by-dim array, where each row is a vertex. Returns the centroid as a vertex (a 1-by-dim two-dimensional array).

source