R code for distance distributions on a plane-bounded convex set (Iwata 2025)

Published: 5 March 2026| Version 1 | DOI: 10.17632/tcm5n5sc9t.1
Contributor:

Description

This dataset contains an R script and auxiliary files to compute and plot distance distributions (Euclidean, Manhattan, Hilbert) for point pairs within a plane-bounded convex set. Code version: v0.1.0. See README.md for Quick Start, examples, and outputs. Primary reference: Iwata, K. (2025). Journal of Computational Science, 85, 102494. https://doi.org/10.1016/j.jocs.2024.102494

Files

Steps to reproduce

Environment - OS: Any (tested on Linux/macOS/Windows) - R: version 4.2 or later - R packages: ggplot2, gridExtra, scales Setup 1) Download and unzip `distributiondist_v0.1.0.zip` to a writable folder. 2) In R, install packages once: install.packages(c("ggplot2", "gridExtra", "scales")) 3) Source the script: source("distributiondist.R") Quick Reproduction (matches the paper’s default settings) x <- runif(7, 0, 5); y <- runif(7, 0, 5) ix <- chull(x, y) plot.ddlinespoints(x[ix], y[ix], pdivn = 10, tdivn = 6, n = 600, alllines = FALSE) Expected Outputs - PDFs saved in the working directory: `chords.pdf`, `euclid.pdf`, `manhattan.pdf`, `hilbert.pdf`, `all.pdf` - (optional) `points.pdf` if `plot.ddpoints()` is used Notes - The default parameters reproduce the results reported in the paper. - For denser integration, set `alllines = TRUE`; for Hilbert range, adjust `xrange`. - For exact reproducibility, always set a seed before random sampling.

Institutions

Categories

Applied Mathematics, Data Visualization, Computational Geometry, Computing

Funders

Licence