Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

enter image description here

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?

share|improve this question

migrated from stackoverflow.com Jun 27 '12 at 14:40

This question came from our site for professional and enthusiast programmers.

    
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 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.