Link to home
Start Free TrialLog in
Avatar of personal design
personal design

asked on

Scattered data interpolation in Java/Android

I have a set of points and if I draw them on a paper, I have a diagram like the image in attached file.
I want to find any almost horizontal curve/line in the scattered points, something like another image in the attached files, the image with red diagram.
the result will be like below image:

In fact what I want as output is an array of points that are on the line/curve, or the equation which gives me the y component of the point if I set the x value.

I searched for a Java/Android library or code that does the job but didn't find any. I would appreciate if you let me know about the exact mathematical process or any Java/Android library or class that does the job.

Thanks in advance.
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

It should be possible - although probably long winded and possibly dramatically slow - to use Java’s Robot class and Raster class to determine the pixel colours and positions, which you’d then have to iterate and measure for the linearity you require. I’ve certainly never done this but it looks feasible.

Of course if you make your dots electronically in the first place, rather than on paper, then you'll be able to short-circuit that approach quite a bit.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.