add an example of using quadratic programming to get the same result, thanks to Evan Drumwright.