I have a set of X coordinates. I want to know how to calculate the Y coordinates such that they form a straight line hitting each X. How can I do this?
Example: $X_1 = \{-9,-12.75,-18.75,-40\}\\ X_2 = \{-6,-8.5,-12.5,-20\}\\X_3 = \{-3, -4.25, -6.25, -10\}\\X_4 = \{0, 0, 0, 0\}$
As you can see, I want a straight line going through all 4 $x$ points. All $x_1$ are evenly spaced 3 apart, $x_2$ 4.25 apart, $x_3$ 6.25 apart, and $x_4$ 10 apart. How can I calculate the corresponding $y$ values to give me straight lines?
A straight line can be represented by the equation: $$ y = kx + n $$ Where $ k $ is the slope of the line and $ n $ is the y coordinate where the line cuts the y axis. Take arbitrary values for $k$ and $n$ and input your x coordinates, you will get the y coordinate so you have your straight line.