# OCR: some App to calculate the derivative on a line graph with iPhone/iPad?

Problem

I have a set of points like the ones shown on the right hand side of the image. So for each 'Ships Head' there is a corresponding value for 'Deviation'. In this example we can treat west as negative and east as positive values.

On the left of the image there is a graph made from the points on the right. What I need to do is find a way of using a setup like this to work out the deviation for any given point on the graph. So for example, given the value of 10 degrees, we should be able to calculate the deviation as something around 3.8 degrees.

Obviously its easy to manually draw a graph and then read off values however I need a way of doing this in code. I have never had to solve a problem like this before and I don't know where to start. I was thinking I could make use of trigonometry and maybe some sort of cosine wave but i don't know how to do this.

What is the way of calculating the deviation for a given degree value based on the values on the right hand side of the image?

-

Are you asking how to calculate a derivative? – Cake Jun 27 '12 at 14:03
Welcome to math.SE. Do you mean you'd like to perform a regression on the given table of values? – user2468 Jun 27 '12 at 15:38

## 2 Answers

It looks like a sine wave, so I would just use Deviation (deg E) = $6 \cos (heading - 135^\circ )$.

-

I understand your want as a procedure below. There are different options for it, I cover both scenarios below.

Procedure

1. shoot photo from the picture

2. you move your finger along the graph where the program tells you the derivative along the curve

Options

1. if you have some software, it may have OCR -capabilities to do this but now no mention about the software

2. try to find out some OCR -software which calculates the derivation along the curve

I haven't yet found anything like this, perhaps such software will emerge after this feature-request and app-request. DocScan -app basically has similar technology to do this but meant for storing notes, not for analyzing photos and certain details about it. I am still investigating whether some math -software with OCR -capabilities exist.

You can find here a similar question but for formulae, not for graphs -- anyway the same problems with cluster-analysis, feature-extraction, feature-selection, image-processing, pre-processingg and decision-making.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9466300010681152, "perplexity_flag": "head"}