# Mathematics: Generating an equation from 3 cartesian point values

**URL:** <https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398>\
**Category:** Factual Questions\
**Created:** [February 10, 2004, 6:07am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398 "2004-02-10T06:07:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [February 10, 2004, 6:07am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/1 "2004-02-10T06:07:53Z")

</div>

Is it possible to determine an equation if you are given 3 points in two-dimensional space? (Example (4,3) (5,2) (6,4) - I just made those up - do NOT work on that specifically).  
Would there only be one equation that could be generated from the 3 points or could be more than one ?  
How would the “order” of the equation be determined from 3 points?  
I have a feeling the answer to this is probably very complex.

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [February 10, 2004, 6:22am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/2 "2004-02-10T06:22:09Z")

</div>

No, three points (or any finite number of points) is not enough to determine an equation. The fact that if you graph those finitely many points, there are infinitely many ways to “connect the dots”, should give you an idea of why finitely many points is not enough.

On the other hand, if I have n points of a function, those points _do_ uniquely describe a polynomial of degree n-1 or less. For example, your three points (4,3), (5,2), (6,4) define a quadratic polynomial (or possibly lesser degree) of the form:

f(x) = ax[sup]2[/sup] + bx + c

To find a, b, and c, use the three given points:

16a + 4b + c = 3  
25a + 5b + c = 2  
36a + 6b + c = 4

Solve for a, b, and c.

---

<div class="post-metadata">

**Author:** ![RayMan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@RayMan](https://boards.straightdope.com/u/RayMan)\
**Post date:** [February 10, 2004, 7:45am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/3 "2004-02-10T07:45:55Z")

</div>

Cabbage, a set of n points in the Cartesian coordinate plane determine a unique polynomial of degree at most n-1 if and only if no pair of points lie on a vertical line. Should a pair of points lie on the same vertical line, then no polynomial (indeed, no function) can be fit to this set of points.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [February 10, 2004, 7:53am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/4 "2004-02-10T07:53:40Z")

</div>

Function with a vertical line: f(y) = y + 1;

😉

---

<div class="post-metadata">

**Author:** ![RayMan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@RayMan](https://boards.straightdope.com/u/RayMan)\
**Post date:** [February 10, 2004, 8:04am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/5 "2004-02-10T08:04:49Z")

</div>

Friedo, we’re assuming standard mathematical convention here that f: **R** -\> **R** is a function whose domain contains the x-coordinates of our points, and whose codomain contains the y-coordinates of our points. In your example, you’ve swapped your domain and codomain.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [February 10, 2004, 8:12am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/6 "2004-02-10T08:12:28Z")

</div>

I suppose you could always say the points represent a line, then define that line using least-squares estimators on the three points. 🙂

[http://www.itl.nist.gov/div898/handbook/pmd/section4/pmd431.htm](http://www.itl.nist.gov/div898/handbook/pmd/section4/pmd431.htm)

---

<div class="post-metadata">

**Author:** ![RayMan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@RayMan](https://boards.straightdope.com/u/RayMan)\
**Post date:** [February 10, 2004, 8:35am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/7 "2004-02-10T08:35:47Z")

</div>

Linear regression can be applied to the points in the plane to provide a best least squares approximation of a linear function. Of course this makes sense only if your points (approximately) lie along a line! And the function generated won’t fit all your points unless they are indeed colinear. If you have three points in the plane that roughly form a triangle, linear regression would not provide a reasonable approximation of a function that fits these three points.

There are lots of regression techniques that provide good approximations of functions that fit points in the plane. It is possible to approximate a complex function using linear combinations of elementary functions; Fourier analysis is an example that works well for approximating functions that are periodic. In general, though, you need to know more about the function you are attempting to approximate. Fitting a polynomial through a small number of points is easy and may reasonably describe our function. As the number of points grows larger, though, we must look for patterns in our data to guide our search for the best approximating function.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [February 10, 2004, 9:14am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/8 "2004-02-10T09:14:18Z")

</div>

> [@RayMan](#):
>
> Friedo, we’re assuming standard mathematical convention here that f: **R** -\> **R** is a function whose domain contains the x-coordinates of our points, and whose codomain contains the y-coordinates of our points. In your example, you’ve swapped your domain and codomain.

I know that; I was just being a smartass.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [February 10, 2004, 2:38pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/9 "2004-02-10T14:38:53Z")

</div>

> [@RayMan](#):
>
> Linear regression can be applied to the points in the plane to provide a best least squares approximation of a linear function. Of course this makes sense only if your points (approximately) lie along a line! And the function generated won’t fit all your points unless they are indeed colinear. If you have three points in the plane that roughly form a triangle, linear regression would not provide a reasonable approximation of a function that fits these three points.

I could nitpick and say the OP wanted a function “generated” by the three points, not necessarily “containing” the three points, but I won’t. 🙂

The linear regression model would generate a unique linear equation for any set of 2 or more points on the plane.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [February 10, 2004, 2:56pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/10 "2004-02-10T14:56:31Z")

</div>

Hmm … I think I wanted to say …

The linear regression model would generate a DISTINCT linear equation for any set of 2 or more points on the plane.

I say distinct rather than unique because you could define an infinite number of point-sets on the plane for each linear regression.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [February 10, 2004, 3:02pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/11 "2004-02-10T15:02:23Z")

</div>

> [@RayMan](#):
>
> Of course this makes sense only if your points (approximately) lie along a line! And the function generated won’t fit all your points unless they are indeed colinear. If you have three points in the plane that roughly form a triangle, linear regression would not provide a reasonable approximation of a function that fits these three points.

If the three points are not collinear, they will form a triangle, no roughly about it. 🙂

> [@friedo](#):
>
> I know that; I was just being a smartass.

I knew that.

So, at the risk of getting myself in a quagmire, I gotta ask, in what sense is your function f(y)=y+1 vertical? Did you mean f(y)=1?

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [February 10, 2004, 3:21pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/12 "2004-02-10T15:21:38Z")

</div>

> [@Cabbage](#):
>
> 16a + 4b + c = 3  
> 25a + 5b + c = 2  
> 36a + 6b + c = 4
> 
> Solve for a, b, and c.

a = 1.5  
b = -14.5  
c = 37

😃

(No, I didn’t work it out by hand. I could, but my HP-48GX was sitting right there and, since the OP said to _not_ work out something for those points, the temptation was too great. ;))

---

<div class="post-metadata">

**Author:** ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)\
**Post date:** [February 10, 2004, 3:45pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/13 "2004-02-10T15:45:48Z")

</div>

> [@](#):
>
> Friedo, we’re assuming standard mathematical convention here that f:R-\>R is a function whose domain contains the x-coordinates of our points, and whose codomain contains the y-coordinates of our points. In your example, you’ve swapped your domain and codomain.

Hold on there! The OP didn’t say anything about a function from from x -\> y. He said “equation” from points on a cartesian “two-dimensional space”. That brings to my mind analytic geometry.

And to answer the OP: there’s exactly one circle that goes through any three points on the cartesian plane. (Assuming they’re not co-linear.) Three point isn’t enough to uniquely determine a parabola or hyperbola (unless you “cheat” and assume a particular orientation).

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [February 10, 2004, 4:33pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/14 "2004-02-10T16:33:06Z")

</div>

Even if three points don’t determine a function, they are all elements of a relation. No function has a circle as its graph, but we haven’t excluded those from discussion.

---

<div class="post-metadata">

**Author:** ![RayMan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@RayMan](https://boards.straightdope.com/u/RayMan)\
**Post date:** [February 10, 2004, 6:26pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/15 "2004-02-10T18:26:34Z")

</div>

Pleonast, three distinct points in the plane lie on the same unique circle if and only if their perpendicular bisectors, respectively, intersect at a distinct point. In general, three distinct points in the plane do not necessarily lie on the same circle. You are correct, though, in stating that three points (or, indeed, any finite number of points) do not uniquely determine a polynomial _function_. There are infinitely many ways to fit any finite number of points in the plane with a curve generated by a polynomial and rotated and reoriented in the plane. Such a curve would not, in general, define a function, but I realize now that **wolf\_meister** did not specify a function.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 10, 2004, 6:55pm UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/16 "2004-02-10T18:55:41Z")

</div>

> [@RayMan](#):
>
> Pleonast, three distinct points in the plane lie on the same unique circle if and only if their perpendicular bisectors, respectively, intersect at a distinct point.

You’re right about that…

> [@](#):
>
> In general, three distinct points in the plane do not necessarily lie on the same circle.

…but not about that. The condition you gave holds true for any three noncollinear points. If the three points are noncollinear, the perpendicular bisectors will meet at a point called the [circumcenter](http://mathworld.wolfram.com/Circumcenter.html).

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [February 11, 2004, 12:23am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/17 "2004-02-11T00:23:07Z")

</div>

**Derleth**  
And the solution to the resulting equation is  
4.8333333333… ± 1.1426091000668405 i

Anyway, thanks to everyone for responding to my posting. I think **Cabbage** answered my question but thanks to all for such a rigorous analysis. Heck, keep up the discussion.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [February 11, 2004, 3:00am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/18 "2004-02-11T03:00:06Z")

</div>

> [@wolf\_meister](#):
>
> **Derleth**  
> And the solution to the resulting equation is  
> 4.8333333333… ± 1.1426091000668405 i

This set me back a bit, but I think you’re talking about solutions to the equation 0=ax2 + bx + c

Those solutions would be the x-intercepts for the parabola. That is, not.

---

<div class="post-metadata">

**Author:** ![tinactin](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@tinactin](https://boards.straightdope.com/u/tinactin)\
**Post date:** [February 11, 2004, 4:56am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/19 "2004-02-11T04:56:36Z")

</div>

Lets consider the following, we wish to find a quadratic :

ax^2 + bxy + cy^2 + dx + ey + f =0 (#)

passing through the points (x1,y1) (x2,y2) and (x3,y3). First lets settle  
existence. As has been pointed out above, if the points are not colinear  
we can use a circle. If the points are colinear then consider one line through  
the 3 points and some other line. The union of the two is a quadratic  
(union = multiplying the equations), so it will do.

Next question, how many such quadratics are there? Plugging  
into our three points into (#) we obtain a system of 3 equations in 6 unkowns.  
The coefficents are the unknowns here. We have too many unkowns and  
too few equations. More precisely, the solutions are the kernel of a  
linear transform  
R^6 -\> R^3  
so it has dimension at least three. The upshot, our system has infinitely  
many solutions. To answer the question, we need to observe that we excluded  
the possibility of the only solutions being of the form a=b=c=0 in the  
first paragraph. A little more linear algebra shows that in fact there  
are infinitely many solutions not of the form a=b=c=0.

What about 6 points? Probably the answer can be found in some text on  
classical algebraic geometry. There will be some need to be some condition  
on the points, I have no idea what it is. For example if three are colinear  
and the other three are random then it is not possible.

---

<div class="post-metadata">

**Author:** ![tinactin](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@tinactin](https://boards.straightdope.com/u/tinactin)\
**Post date:** [February 11, 2004, 5:06am UTC](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398/20 "2004-02-11T05:06:07Z")

</div>

Should’ve previewed. Depending on how you view things there is an  
error in the above. Scalar multiples of an equation define the same curve.

So the interesting case is 5 points.

[Next page](https://boards.straightdope.com/t/mathematics-generating-an-equation-from-3-cartesian-point-values/228398.md?page=2)
