What is a good technique for finding a simple formula to fit a series of three points? I have three points:


*

*0: 595

*90: 1480

*180: 2440


(The first value is an angle in degrees, the second is the pulse-width in milliseconds that produces that angle on a particular servo-motor.)
As you can see, the line described by these points is not quite linear. (I assume the intermediate points will be roughly on the line though.)
What I would like to do is find a formula that fits the line and gives me the pulse-width for a desired angle. What is a good strategy for doing this? I think I could arrive at something like:
pw = ((angle * <a multiplier>) + (angle * <a coefficient>)) + 595
by crude trial and error, but I am sure there must be a more elegant way.
 A: If you believe that your three points are (essentially) exactly right you can join them by a broken line. That's the linear interpolation in the comment from @PeterForeman . If they are approximate measurements use linear regression to find the straight line that best fits all three, on average. 
I'd be surprised if Python didn't have packages for both.
A: According to my calculator the linear regression equation is $$y=582.5+10.25x$$
Where $x$ is the angle in degrees and $y$ is puls width 
A quadratic regression equation is $$y=0.004629x^2+9.4166x+595$$
A: To flesh out the other answers, I discovered two ways of doing this (implemented in Python).
I can create two lists:
angles = [-90, 0, 90]
pulse_widths = [595, 1480, 2440]

numpy.polyfit
Then, using numpy.polyfit I can:
>>> import numpy
>>> numpy.polyfit(angles, pulse_widths, 2)
array([4.62962963e-03, 9.41666667e+00, 5.95000000e+02])

And the values it returns can be used to construct the equation I need:
pulse_width = 4.62962963e-03 * angle ** 2 + 9.41666667 * angle + 595

Lagrange polynomial
Or I can use a Lagrange polynomial.
pw = (pulse_widths[0] * (angle - angles[1]) * (angle - angles[2])) / ((angles[0] - angles[1]) * (angles[0] - angles[2])) + \
    (pulse_widths[1] * (angle - angles[0]) * (angle - angles[2])) / ((angles[1] - angles[0]) * (angles[1] - angles[2])) + \
    (pulse_widths[2] * (angle - angles[0]) * (angle - angles[1])) / ((angles[2] - angles[0]) * (angles[2] - angles[1]))

