How To Write The equation for a line given a set of co-ordinates

124 Views Asked by At

I'm trying to learn how can I write the equation for a line given all the points that belongs in the line.

I'm looking to find the equation for a curve.

An example set of points is:

$$\{ (24,11), (25,11), (25,12), (25,13), (25,14), (25,15), (24,16), (23,15), (23,14), (23,13), (24,12) \}$$

Thanks in advance for the help :)

EDIT:

SORRY, $$\{ (24,11), (25,11), (25,12), (25,13), (25,14), (25,15), (24,16), (23,15), (23,14), (23,13), (24,12) \}$$

I accidentally interchanged the $X,Y$ values :(

This is the new co-ordinates

$$\{ (11,24), (11,25), (12,25), (13,25), (14,25), (15,25), (16,24), (15,23), (14,23), (13,23), (12,24) \}$$

1

There are 1 best solutions below

3
On

From the picture we see that your coordinates create the picture:

enter image description here

and do not define a line. For all of your coordinates to define a line, there would have to be pairwise uniform $\frac{\Delta y}{\Delta x}$ between any $(x_i,y_i)$ and $(x_j,y_j)$ in your list, with $i\ne j$.



Here what is meant by $\frac{\Delta y}{\Delta x}$ is: $\dfrac{y_j-y_i}{x_j-x_i}$


For example: $\{(3,6),(2,5),(4,7),(5,8)\}$ define the line: $y=x+3$. Why?

The points are colinear because for any two points, you'll observe the same ratio of rise to run.

For example, the ratio of rise to run between the second coordinate and the third coordinate is: $$ \dfrac{y_3-y_2}{x_3-x_2}= \dfrac{7-5}{4-2} =\dfrac{2}{2} = 1 $$ Testing any other two points would yield the same result.

The ratio of rise to run is often called the slope of the line and is denoted by m
Since we have this uniform slope between any two points, we know for a particular point, $(x_0,y_0)$: $$ m = \frac{y-y_0}{x-x_0} $$ Where $x$ and $y$ are subject to choice.
Using this result, the equation of the line is thus: $$ y-y_0=m(x-x_0) $$ So in our example, let $(x_0,y_0) = (2,5)$
Then, $$ y-5=1(x-2) $$ and Voila! $$ y=x-3 $$

Other interpretations of your question such as a "line of best fit" or an interpolating polynomial would merit a different answer altogether.


The line of best fit is given by: $$ y = -0.125806x + 25.851613 $$ using your new coordinates.


The slope coefficient and $y$-intercept are given by: $$ m = \dfrac{\sum_{i=1}^{n}x_iy_i - n\bar{x}\bar{y}}{\sum_{i=1}^{n} x_i^2-n\bar{x}^{2}}\\ b= \bar{y} - m\bar{x} $$ Where $$ \bar{x}: \text{mean of}\;\; x\\ \bar{y}: \text{mean of}\;\; y\\ x_i: \text{the $i^{th}$ number of}\;\;x\\ y_i: \text{the $i^{th}$ number of}\;\; y\\ n:\text{total numbers of}\;\; x \;\;\text{or}\;\; y $$