I'm trying to find some Java lib, code example (or a starting point) to help me figure out how can I interpolate a list of 2d points with a weight to generate a interpolation with level curves.
Googling I figure out that there is several algorithms available to do this, and i found some explanations with interesting content. The first algorithm that I want to try is the Inverse Distance Weighted interpolation.
But with all this information i have some basic doubts:
To generate one picture like the picture below, i have to do a pixel matrix (with weight), interpolate the data, group pixels together (by color range) and then join the points do draw the curves and put the reference text values like this?
If i need to do this pixel matrix, it will be very expensive for a giant interpolation, so can I do less points and use splines to join then to create the color levels?
Example data:
+-------------------+
| X | Y | WEIGHT|
+-------------------+
| 2 | 5 | 30 |
| 7 | 3 | 25 |
| 1 | 1 | 10 |
| 5 | 6 | 45 |
| 7 | 9 | 15 |
+-------------------+
Example Rules:
- Value between 00-10: Blue
- Value between 10-20: Green
- Value between 20-30: Yellow
- Value between 30-40: Red
Example results:
The example data, rules and results are not compatible, are just random examples to explain my prblem.
Here is my final test class: http://pastebin.com/nD6MT8eS