ABRG-Models / morphologica

A library of supporting code for numerical modelling (JSON config, HDF5 data, Modern OpenGL visualization)
https://abrg-models.github.io/morphologica/
Apache License 2.0
255 stars 29 forks source link

Adding indexFromCoord function to CartGrid class #151

Closed blenk13 closed 11 months ago

blenk13 commented 11 months ago

CartGrid already has a findRectNearest function for finding the nearest grid location to a supplied 2D (x, y) coordinate. This PR adds a similar function that is faster and simpler for use solely with rectangular grids.