You are not logged in.
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, andIs this possible? Any help at all would be hugely appreciated.
Last edited by Tredici (2008-09-28 23:50:59)
Offline
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
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