https://github.com/kahaaga/simplexintersection.jl
Compute exact intersection volumes and intersection points between N-dimensional simplices
https://github.com/kahaaga/simplexintersection.jl
intersection simplex
Last synced: 10 months ago
JSON representation
Compute exact intersection volumes and intersection points between N-dimensional simplices
- Host: GitHub
- URL: https://github.com/kahaaga/simplexintersection.jl
- Owner: kahaaga
- License: other
- Created: 2017-11-26T23:41:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T17:02:24.000Z (almost 6 years ago)
- Last Synced: 2025-01-22T03:32:56.566Z (11 months ago)
- Topics: intersection, simplex
- Language: Julia
- Homepage:
- Size: 306 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SimplexIntersection
Julia package for computing the intersection between simplices in N
dimensions. Computes both the intersecting volume and the points
in which the simplices intersect.
## Requirements
SimplexIntersection.jl requires Julia 0.6 to run. The package has currently only been tested on macOS. You can download the latest version of Julia from the official Julia [website](https://julialang.org/downloads/).
## Installation
To install the package, run the following command in the Julia console:
```julia
Pkg.clone("git@github.com:kahaaga/SimplexIntersection.jl.git")
```
This will create a local copy of the repository in your `~/.julia/v0.6/` directory. Make sure to install the dependencies that get listed during installation.
# Examples
```julia
# Load package
using SimplexIntersection
# Define two simplices that have som overlapping volume
simplex1 = [1.12545 0.0978862 0.401808 1.91521;
0.979468 -0.171237 0.0978862 1.12545;
0.491734 -0.452719 -0.171237 0.979468];
simplex2 = [0.979468 -0.171237 0.0978862 1.12545;
0.491734 -0.452719 -0.171237 0.979468;
0.401808 -0.537488 -0.452719 0.491734];
# Compute the volume. By default, a tuple of volume and vertices is returned.
# Here, we keep only the volume.
vol = simplexintersection(simplex1, simplex2)[1]
```
# R bindings
An R package, rSimplexIntersection, that wraps the functions in SimplexIntersection.jl is available [here](https://github.com/kahaaga/r-simplexintersection).