Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2008-09-28 23:01:07

Tredici
Member
Registered: 2005-12-12
Posts: 28

What I Would Consider Quite Complex Interpolation [2]

Hi guys,

I'm writing an algorithm for a property matching website.

Originally, I needed a function which produces a y value of 0 when x is 350, 100 when x is 500, and 0 when x is 550. So:


By polynomial interpolation I have:

Then I realised that I needed

to be the maximum point of the curve.

Thankfully, Cushydom came to the rescue with the following:

Which works tremendously. However, I now realise I need a general function which can work with any y values, provided that:

,
,
, and
are positive,
is the maximum point of the curve, and

Is this possible? Any help at all would be hugely appreciated.

Last edited by Tredici (2008-09-28 23:50:59)

Offline

#2 2008-09-28 23:33:50

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: What I Would Consider Quite Complex Interpolation [2]

You can find a polynomial of degree n-1 that goes through n number of points by using Lagrange polynomials.  Is this what you want?  In other words, if you come up to me and say:

"I want a polynomial that goes through (1, 3), (2, 10), (5, 200), and (1000, 13)"

I could run an algorithm and tell you a 3rd degree polynomial that does.  If this is what you need but you can't understand the Wikipedia page, just say so and I can help you with the algorithm.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#3 2008-09-28 23:55:45

Tredici
Member
Registered: 2005-12-12
Posts: 28

Re: What I Would Consider Quite Complex Interpolation [2]

Thanks for your reply Ricky.

I've just noticed I screwed up the last couple of paragraphs in this post. They've been updated now, and basically, what I'm looking for is a function which produces a curve which passes through (x1, 0), (x2, 100), (x3, 0), the maximum point of the curve is 100, and x1 < x2 < x3.

Is this possible?

Offline

Board footer

Powered by FluxBB