0
$\begingroup$

Considering the following dataset, how do I find the angle when the two lines intersect at time 4. Please not that the two lines don't represent a function, this is just a data set.

Time     Line 1     Line 2
0        20         19.95
1        20.5       20
2        21         20.05
3        20.5       20
4        22         23
5        23         25

Thanks for the help!

  • 2
    Fit either of the datasets to $y=m x +b$. The angle then is given by $|\arctan(m_2) -\arctan(m_1)|$.2011-05-06
  • 3
    You can do it with one arctangent evaluation instead of 2. Use the formula for the tangent of the difference of two angles.2011-05-06
  • 0
    I am not sure to understand how I could fit the two datasets to y=mx+b. The datasets aren't linear.2011-05-06
  • 0
    Could you provide more information on this. Your data set has some variability to it and inferring a best fit curve for the lines is a statistical problem. Just assuming that the line 1 and line 2 are straight lines between Time 3 and Time 4 makes this a simple geometry problem. Which way of looking at the problem most suits the issue you are looking at?2011-05-06
  • 0
    Ian, we can consider that line 1 and line 2 are straight lines between Time 3 and Time 4.2011-05-06
  • 0
    "we can consider that line 1 and line 2 are straight lines between Time 3 and Time 4" - then I suppose you can *interpolate* instead of *regressing*...2011-05-06

1 Answers 1

2

Use Ordinary Linear Regression to fit each data set to a line, and pay attention to the slope of the two lines. Then use arctan to extract the angle. Alternatively, parametrize the two lines and use the dot product to find the angle.

  • 0
    I note that Fabian and JM have posted comments of a similar vein - go them!2011-05-06
  • 0
    Note that the "angle" will depend on the units of measure for the vertical and horizontal/time axes. Taking these units to be consistent with the tabulated values, and assuming the question is narrowed as the last comment from Martin indicates, to the straight line intersection between Time 3 and Time 4, then the first line has slope 1.5 there and the second line slope 3. The difference in angles is then arctan(3) - arctan(1.5), or roughly 15.25 degrees (0.266252... radians).2011-05-06