Finding The Equations of Lines

  • Thread starter daniel350
  • Start date
  • Tags
    Lines
In summary, the conversation discusses the need to simplify a large amount of if statements in programming using a simple equation. The focus is on determining the equation of a line and finding a more regulated method to do so. The speaker is willing to learn and is looking for hints or tips on how to approach this problem. They also mention using Excel's trend line option to check the equation of the smoothed line. A suggestion is made to do a wiki search on "least squares" for the necessary computations to find the best fit line equation.
  • #1
daniel350
13
0
So I'm doing some programming, and to simplify a very large amount of if statements, I've decided to put it down to a few lines with a simple equation, I've done this before with other things, but it was very much trial and error.

Therefore I'd like to see how it can be done in a more 'regulated' method. Determining the equation of a line. I'm willing to learn and spend hours reading and doing, just need to know what it is I'm looking for (calculus?).

My data
75 0 82 0 0
125 0 84 0 1
170 0 88 0 1
210 1 92 0 1
245 2 94 0 2
275 3 94 0 2
300 4 100 1 2
320 5 106 1 2
335 6 112 2 3
345 7 118 2 3
350 8 124 3 4
>350 8 130 4 5

I simply want to make an equation that relates these equations, I'm focusing firstly on the first one, which has a decrement of 5 for each iteration, the others may be easier to find.

I'm not looking for an exact solution, just some hints or tips or directions on where to learn how to do this; as they are not (at least not always) linear.

regards,

Daniel

PS: If this helps, also, is there a way to check the equation of the 'smoothed' line in EXCEL?
http://img697.imageshack.us/img697/1875/54459250.gif
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
In Excel look at the option tap of the trend line menu, check the box to show the equation.


Do a wiki search on "least squares" for the computations necessary to compute the equation of the best fit line.
 
  • #3
Thanks!
 

1. What is the equation of a straight line?

The equation of a straight line is typically written in the form y = mx + b, where m represents the slope of the line and b represents the y-intercept (the point where the line crosses the y-axis).

2. How do I find the slope of a line?

The slope of a line is found by taking the difference in the y-coordinates of two points on the line and dividing it by the difference in the x-coordinates. This can be represented by the formula (y2 - y1) / (x2 - x1).

3. What is the point-slope form of a line?

The point-slope form of a line is y - y1 = m(x - x1), where (x1, y1) represents a point on the line and m represents the slope. This form is useful for finding the equation of a line when the slope and one point on the line are known.

4. Can I find the equation of a line if I only know two points on the line?

Yes, you can use the slope formula to find the slope of the line, and then use the point-slope form or the slope-intercept form (y = mx + b) to find the equation of the line.

5. How do I graph a line using its equation?

To graph a line using its equation, first identify the y-intercept (b) and plot this point on the y-axis. Then use the slope (m) to find one or more additional points on the line, and connect these points to create the line.

Similar threads

  • General Math
Replies
4
Views
818
Replies
11
Views
490
  • General Math
Replies
12
Views
1K
Replies
2
Views
2K
  • General Math
Replies
8
Views
1K
Replies
3
Views
487
Replies
5
Views
966
Replies
4
Views
965
Replies
1
Views
832
  • General Math
Replies
3
Views
1K
Back
Top