Page 1 of 1

Solving some 'math' problems

Posted: Fri Jul 15, 2011 10:27 am
by griffinmt
Here is the issue:
I have a set of x,y coordinates that plots a generic curve. What I need to do is determine additional x,y coordinates that are located midway between existing coordinates. For now I will assume that any three consecutive points are on a curve defines by the quadratic equation Ax^2 + Bx + C = y
starting with the three x,y values, how do I solve for the values A,B,C (programatically) so that I can insert a new x value and calculate its associated value(s) of y.

I will be doing this with PHP on the server side of a web connection.

Any assistance would be greatly appreciated!!

Re: Solving some 'math' problems

Posted: Fri Jul 15, 2011 10:55 am
by Weirdan

Re: Solving some 'math' problems

Posted: Mon Jul 18, 2011 7:10 pm
by beetree
x1, y1 = 1, 2
x2, y2 = 3, 4
x3, y3 = 5, 6

This would give you three equations:

A + B + C = 2
9*A + 3*B + C = 4
25*A + 5*B + C = 6

Then, you simply solve these three equations. If you don't know how to solve the equation system, you need to read up on your math. Or, just ask and I can solve the general case equation system and write it up in code for you...

/Johan