Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maybe there is an issue in function hasAllSeedsInside if it is not a same width rectangle #2

Open
Sieyalixnet opened this issue Apr 6, 2023 · 4 comments

Comments

@Sieyalixnet
Copy link

dependence:
"natninter": "^0.1.3"

function hasAllSeedsInside() { var size = this._output; return this._seeds.every(function (s) { return s.x >= 0 && s.y >= 0 && s.x < size.width && s.y < size.width; }); }

x and y are ALL compared to the size.width. But setOutputSize sets this._output.width and this._output.height.
The y should be compared to size.height instead?

@johanatan
Copy link

johanatan commented Oct 8, 2023

Not only this but I think the README example has seeds that fail this test (i.e., 300 > 256). The example led me to believe that x-min and y-min would be computed from the seeds but however (as is shown in the code pasted above) the mins seem to be assumed to be "zero". Thus the user will need to translate his data to the origin (and then do the reverse translate on the output [for a general use case]).

@Sieyalixnet
Copy link
Author

Thank you, I understand now.
I tried to use this lib to interpolate the height with given some measured points. While other libraries such as Kriging interpolation can be used in a range with NOT same width and height. So I felt curious about that.

@johanatan
Copy link

johanatan commented Oct 12, 2023

I think this should not have been closed. If this check is fixed, the actual logic does the correct thing for rectangles. I’m using it successfully in my fork. So this was just a simple typo it seems.

@johanatan
Copy link

The readme is still wrong with the seed points that lie outside the bounds however.

@Sieyalixnet Sieyalixnet reopened this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants