Solving some 'math' problems

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
griffinmt
Forum Commoner
Posts: 35
Joined: Sun Jul 16, 2006 8:37 pm
Location: Michigan

Solving some 'math' problems

Post 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!!
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Solving some 'math' problems

Post by Weirdan »

beetree
Forum Commoner
Posts: 26
Joined: Mon Jul 18, 2011 6:30 pm
Location: Peninsula

Re: Solving some 'math' problems

Post 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
Post Reply