I know how to find the equation of a line which passes through two known points. But here, I have 10 points $(x,y)$ through which my line passes through. I know I can draw a graph and find then find the equation of the line, but is there a better way or online tool to do the task? The values are given below

  • 6
    $\begingroup$ Will not be possible in general. Look up linear regression. $\endgroup$ – Parcly Taxel Dec 7 '17 at 12:12
  • $\begingroup$ Side note, if your line is a straight line it certainly does NOT pass through ALL the points you just mentioned... $\endgroup$ – Gaurang Tandon Dec 7 '17 at 12:36
  • 1
    $\begingroup$ if it does not have to be a straight line, look up polynomial interpolation $\endgroup$ – Vasya Dec 7 '17 at 12:39
  • $\begingroup$ Well, assume a line exists, draw a line through any 2 distinct of them and it will pass through the remaining points. Otherwise the line just doesn't exists. $\endgroup$ – user202729 Dec 7 '17 at 13:01
  • $\begingroup$ As Parcly Taxel commented, this is related to data regression. Depending on the criteria, you will find the "best" linear approximation for this specific criteria. The problem is that, plotting the data, I cannot see something as a straight line. $\endgroup$ – Claude Leibovici Dec 7 '17 at 13:05

If all 10 points lie along a line, then you can pick any two points, find the equation for the line through those, and that line will pass through the other eight points. This is because "two points determine a line."

You should know, though, that 10 arbitrarily chosen points don't necessarily all lie along a line. Indeed the points in your question do not lie along a line:

Noncollinear points

You can get a line that approximates the points as nearly as possible by "linear regression". In R, you can get the intercept and slope of the regression line with the lm function (for "linear model"):

> mydata = read.csv("~/tmp/known-points.csv")
> lm(mydata)

lm(formula = mydata)

(Intercept)          ADC  
   17.29737      0.07425  
  • $\begingroup$ This is exactly what I was looking for. I used regression plug-in in excel and it did the same job. Thanks!! $\endgroup$ – Aswinth Raj Dec 8 '17 at 12:30

It's a simple Linear Regression problem, take a look here:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.