Skip to content

geometric-systems/unit-distance-pattern-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit-Distance Pattern Browser

A Rust example app that uses the public erdos-unit-distance crate against a public point dataset.

The app fetches the USGS Earthquake GeoJSON feed, projects latitude/longitude into local kilometers, generates unit-distance templates, and ranks the best matching clusters by normalized pairwise-distance spectra.

Why This Exists

erdos-unit-distance gives engineers certified point-set constructions. This example shows how an application can use those constructions as templates for real-world spatial data:

  • generate unit-distance templates with erdos-unit-distance
  • load a public dataset
  • normalize point clusters
  • score best matches
  • display the dataset and selected match in Rust

Run

cargo run

The app opens a native egui window. Press Fetch and match to refresh the public dataset.

Browser Demo

python3 -m http.server 8080 --directory web

Open:

http://127.0.0.1:8080

Public Dataset

Default source:

https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojson

The USGS feed is GeoJSON and does not require an API key.

Matching Method

For each point in the dataset, the app takes the nearest n neighboring points, where n is the selected template size. It then:

  1. centers the candidate cluster,
  2. scales it by median pairwise distance,
  3. sorts all pairwise distances,
  4. compares that distance spectrum to the selected unit-distance template.

Lower score means the candidate cluster is closer to the template shape. This is a practical shape-search demo, not a mathematical certificate.

Templates

  • Moser spindle
  • 3x3 square grid
  • 10-point triangular grid

All templates come from the published erdos-unit-distance Rust crate.

About

Rust app matching unit-distance templates against public point datasets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors