0

i have a lot of point-sets. all having a x and a y coordinate. what i need is a way in vb.net to find out a polynomial function that describes as closely as possible these points. does anybody have an idea on how to do this?

each set has 18 points!

Nicholas Wilson
  • 9,435
  • 1
  • 41
  • 80
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97

2 Answers2

0

It's not a language specific problem, and there's probably no API that can help you solve this directly.

However, the problem can be modeled as solving linear system, with which you could hopefully get some help from some linear algebra library.

Have a look at here.

FrostNovaZzz
  • 802
  • 3
  • 10
  • 22
  • yep it is a language specific problem, since it asks if in this language there are some premade tools to solve this.. :) and your answer is no, so i mark it as accepted. thanks for your help! – sharkyenergy Apr 16 '13 at 09:53
0

This is a well-known problem, and there are a number of solutions depending on what you're after. Using Chebyshev polynomials is one popular solution. It all depends on the nature of your points: although you can happily brute-force out a minimal-order fit (seventeenth-order in your case) it'll usually oscillate wildly and probably isn't what you want. The degree of smoothing you need though is problem-dependant.

In Matlab, Mathematica, and even Python there are methods for doing this sort of thing:

You'll probably have to roll your own in VB.net. Start by reading wikipedia; the maths isn't particularly heavy-duty if you just want to implement this stuff.

Community
  • 1
  • 1
Nicholas Wilson
  • 9,435
  • 1
  • 41
  • 80
  • PS. Have you already got your 18 points, or are you going to sample them? If you already have them, then it's harder. If you're trying to create a polynomial interpolation of a function you're about to sample though, you can use the Chebyshev polynomial to get the best points to sample at. Otherwise, for a first cut, you'll probably find the Lagrange polynomial the easiest to compute. – Nicholas Wilson Apr 16 '13 at 10:05