   Solving for coefficients of a quadratic equation
  I need to solve for the coefficients of a quadratic equation f(x) where f(x)=ax^2 + bx + c.This is what I have:f(0) = qf(m) = rSo if f(x) = ax^2 + bx + c, then c=qAlso, r = a(m * m) + bm + qI can't figure out how to find a and b though.   
  I'm afraid that's as far as you can get. There's an infinite number of quadratic functions going through any two given points, thus there's an infinite number of solutions for a and b.   ;  Nuts.Well, is there any good way to come up with a quadratic equation such that f(0) = q and f(m) = r? As in, without trial and error?   ;  EDIT: Damn. I was misleaded due to "solving" and "quadratic equation", instead of reading the entire OP. The equation is of course not quadratic. It is instead a linear equation of 2 variables, namelyf(a,b) := c1 a + c2 b + c3 = 0withc1 := m2c2 := mc3 := q-rHence the only solution to get is a(b). As Morrandir already has stated, you cannot find a single solution as long as not one of a or b is chosen.The following (my original answer) is mathematically correct but plays no role w.r.t. the OPs problem. Solving for the variable of a quadratic function works as follows:Dividing the equation by a, so thata x2 + b x + c == 0 <=> x2 + (b/a) x + (c/a) == 0gives the standard form of the so-called p,q-formula (okay, at least here in Germany it is called so often) withp := b/aq := c/awhich has the resultsr1 = -p/2 + sqrt( p2/4 - q )r2 = -p/2 - sqrt( p2/4 - q )With p2/4 == q there is exactly 1 solutionr = -p/2and with p2/4 < q there are 2 imaginery solutions (or, since often only interested in real numbered solutions, there is no solution then)and with p2/4 > q there are 2 real numbered solutions.[Edited by - haegarr on March 7, 2009 1:51:55 PM];  You have one extra degree of freedom. If you had a third point, or a desired second derivative, or a desired slope at some point, there would be one solution instead of infinitely many. As it currently stands, a straight line could go through your two points (second derivative of 0).   ;Quote:Original post by Guy MehNuts.Well, is there any good way to come up with a quadratic equation such that f(0) = q and f(m) = r? As in, without trial and error?Coming up with any one solution is pretty easy. Just fix one of the variables and solve for the other. For example, if a=0, then b=(r-q)/m . This actually defines a straight line going trough the two points, in the geometrical sense.   