Goal: to create a class with methods to be able to pass in x,y pairs and get back a curve fitted using the
proper forumla (suggested: ax2 + by + c). Pass back the a, b, c values.
Part 2: Be able to pass to another function the abc values, and new x coordinate and
get back the y value.
See example. ...for developer to do... is the part I need done.
C#
class InputPairs
{
public double x;
public double y;
public InputPairs(double dx, double dy)
{
x = dx;
y = dy;
}
}
class clsLeastSquaresVarsCurve
{
...for developer to do...
}
ArrayList inputs = new ArrayList();
InputPairs p1 = new InputPairs(1.0, .40);
[login to view URL](p1);
InputPairs p2 = new InputPairs(2.0, .45);
[login to view URL](p2);
InputPairs p3 = new InputPairs(3.0, .48);
[login to view URL](p3);
InputPairs p4 = new InputPairs(4.0, .42);
[login to view URL](p4);
InputPairs p5 = new InputPairs(5.0, .50);
[login to view URL](p5);
clsLeastSquaresVars vars = GetLeastSquaresVarsCurve(inputs);
double newX = 6.0;
double newY = GetNewValue(vars, newX);
public clsLeastSquaresVars GetLeastSquaresVarsCurve(ArrayList input)
{
// find correct quadratic equation
// return variables
// ... for developer to do ...
}
public double GetNewValue(clsLeastSquaresVars vars, double XValue)
{
// using quadratic variables
// using XValue
// return calculated Y value
// ... for developer to do ...
## Deliverables
1) Complete and fully-functional working sample Visual Studio 2003 project with complete source code of all work done.
2) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Microsoft .NET C#, Visual Studio 2003 project.