0

As said in the title I have a collection consecutive of points on R²(x0, x1, x2, etc.), and I am trying to find one continuous function, that defines a graph that passes through all of them.

I've thought that I can always define a function by the collection of the distances between each consecutive point for their respective intervals(eg, x0=1,x1=2,any point between them could be described by y²=x²+x²), but that does not help me since I am trying to reduce the amount of data necessary to describe that given collection of points.

Is there a known method to solve this problem?

P.S.: I am not mathematician, just a Comp Sci grad student, so please bear with me. P.S.²: I am also not sure my tags are correct, if you guys could help me with them that would be great.

Althis
  • 113

3 Answers3

1

No you can't. I also had the same idea but there's a problem. For n points you require an equation of order n for n variables

You can form this equation. If you have 4 pts then y=ax^4+bx^3+.... To solve this equation replace x and y with the points you have. Solve 4 equations and you will get the requires equation. To do so preferably use Cramer's rule.

Now to store the data coefficients You require an array of n elements. So now your n data items simple replaced by n coefficient. Also for each set of data you require n coefficient elements

0

Look up Interpolation.

This is what you need.

JP McCarthy
  • 8,420
  • This is very interesting, but doesn't reduce the size of my data sample. It would still be simpler to just describe them as points. Is there a way to reduce functions resulting from polynomial or spline interpolation? – Althis Mar 18 '15 at 14:05
  • Say I have 5 points. I can find a curve function that goes through the first 3 points. Then I can find another curve function that connects the last 3 points and makes the tangent differentiable at point number 3(basically a spline). Can I combine these equations in such a way that I have one single function that describes the whole curve that goes through points 1 through 5? – Althis Mar 18 '15 at 14:21
0

You can join consecutive points by line segments, for example. Given two points $x_1,x_2\in\mathbb R^2$, a line segment from $x_1$ to $x_2$ can be defined via $\gamma:[0,1]\to\mathbb R^2,\ t\mapsto (1-t)x_1+tx_2$. If you have more than two points you can add these line segments together.

Example: Assume that $x_1,x_2,x_3,x_4$ are given. Joining $x_1,x_2$ and $x_2,x_3$ and $x_3,x_4$ will give us three line segments $\gamma_1(t)=(1-t)x_1+tx_2$ and $\gamma_2(t)=(1-t)x_2+tx_3$ and $\gamma_3(t)=(1-t)x_3+tx_4$. Two get the final function, you need to adjust the domains of the $\gamma's$: \begin{align*} \gamma:[0,3]\to\mathbb R^2,\ \mapsto\begin{cases}\gamma_1(t), & t\in[0,1]\\\gamma_2(t-1),&t\in[1,2]\\\gamma_3(t-2),&t\in[2,3]\end{cases}. \end{align*}

There are many other ways to join two points. You don't have to use line segments. For a more general idea be referred to Jp McCarthy's answer below.

sranthrop
  • 8,497
  • It doesn't make my data sample smaller though. This is basically the same as the distance example I've given.

    Though I have to say, you explain it marvelously better.

    – Althis Mar 18 '15 at 14:01
  • Ok so you want to find a function that approximates your points? Because if you want to have a path passing through all of the points then you will have to do something like I descriped here. However, you can reduce the amount of line segments, if some of the points lie on a line initially. – sranthrop Mar 18 '15 at 14:05
  • Splines are more akin to what I want. – Althis Mar 18 '15 at 14:16
  • Yeah, but then you don't reduce the amount of data, because a spline is a function like mine, but instead of using linear functions for $\gamma_i$, you use polynomials. You can imagine this as a car driving along a path through your points starting at $x_1$. Line segments make the care have different speeds between points, where polynomials provide a much smoother movement. – sranthrop Mar 18 '15 at 14:20
  • Say I have 5 points. I can find a curve function that goes through the first 3 points. Then I can find another curve function that connects the last 3 points and makes the tangent differentiable at point number 3(basically a spline). Can I combine these equations in such a way that I have one single function that describes the whole curve that goes through points 1 through 5? – Althis Mar 18 '15 at 14:22
  • I mean, there must be at least one polynomial of degree 3 that describes them, right? – Althis Mar 18 '15 at 14:25
  • Why don't you want to use polynomials of degree 3 for each segment? I mean a cubic $C^2$-spline? – sranthrop Mar 18 '15 at 14:47