Code Monkey home page Code Monkey logo

delaunay-find's Introduction

delaunay-find

Finds the nearest point based on a delaunay diagram

Maintenance Status

Archived: This project is no longer maintained by Formidable. We are no longer responding to issues or pull requests unless they relate to security concerns. We encourage interested developers to fork this project and make it their own!

delaunay-find's People

Contributors

boygirl avatar dependabot[bot] avatar jpdriver avatar ryan-roemer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delaunay-find's Issues

Wrong result returned in certain cases

Hi,

I have been having some issues with victory-voronoi-container and have found a potential issue with delaunay-find.

For nearly the same values of x and y, in one case delaunay.find returns 0 and in another it returns the correct value.

I have tried different combinations of x and y and haven't really been able to find a pattern as to why the result it not the same.

Examples:

const Delaunay = require("delaunay-find").default;

var scaled_data = [
  [60    ,17113.1],
  [106.5 ,17113.1],
  [153   ,17113.1],
  [199.5 ,17113.1],
  [246   ,17113.1],
  [292.5 ,17113.1],
  [339   ,17113.1],
  [385.5 ,17113.1]]

let delaunay = Delaunay.from(scaled_data)

delaunay.find(300, 17113.1)  // returns 0
const Delaunay = require("delaunay-find").default;

var scaled_data = [
  [60    ,17113.2],
  [106.5 ,17113.2],
  [153   ,17113.2],
  [199.5 ,17113.2],
  [246   ,17113.2],
  [292.5 ,17113.2],
  [339   ,17113.2],
  [385.5 ,17113.2]]

let delaunay = Delaunay.from(scaled_data)

delaunay.find(300, 17113.2)  // returns 5

Infra: Add lint

  • Add lint
  • Add prettier (might just be part of lint) (if desired) (?)
  • Add commands to package.json:scripts.check

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.