Graph data extraction;
I have written a simple excel formula that does the below data extraction. I would like to have this done so that I can use it as an IPAD App and have a nicer user interface for teaching.
This App extracts a Y value from a given graph. The graph itself is an old black & white scan image. I have already digitized the graph lines and can provide this data to be used in the App. However, for the App I would like to use the actual image of the graph as a background for the lines to be drawn showing the calculation.
At the moment based on how I have done it (and that may not he the most efficient or pretty way of doing it) there are two separate functions: one for straight line graphs and one for curved graphs. You may have a much better way of doing this.
Function 1: Given an X value (Parameter A) and a Graph Value (Parameter B) calculate the Y value.
2 Input Parameters: X Value (Parameter A) and a Graph Value (Parameter B)
1 Output: Y Value
We are given the data (X,Y values) for 5 straight line graphs (0, 10, 20, 30 , 40 and 50). However, Parameter B can be any integer between 0 to 50. Basically you can imagine that there are 9 other graph lines in between each of the shown graphs (with similar orientations etc). Therefore, we need to extrapolate the graph for the given value of Parameter B. For example if Parameter B is 15, then we need to extrapolate the graph line that lies half way in between the 10 and 20 graphs. We don’t need to extrapolate ALL the X, Y values for this graph, but only the Y value which corresponds to the given value X (Parameter A).
I have a very simple formula that can extrapolate this based on the X,Y value of the 5 given graphs.
Once this is done Function 1 outputs the value of Y.
Function 2: Same as Function 1, however the graphs are not straight line graphs and are curved.
The only difference between the 2 functions is that in function 1, because the graphs are straight lines we only to store the X,Y coordinates for the start of each line and the end of each line (2 X,Y values each). We can use simple interpolation formula to draw the 5 given graphs and consequently extrapolate the Parameter B graph from these.
However, in Function 2, given that the 5 given graphs are curved we need to have a database of the X,Y coordinate for each of these 5 graphs (approximately 100 X,Y coordinates for each graph; 500 X,Y total). We then use this database to extrapolate the Parameter B Graph.
In the example:
X (Parameter A) = 25
Parameter B = 15
Calculated Y = 27
I also require this app to be modular. That means that I can use the calculated Y value as one of the inputs to another graph (with different data set), but using Function 1 or 2.
2 input boxes for entering Parameter A & B
1 box to display calculated Y.
Also the App should draw the blue line (which is the calculation)