Page 1 of 1

Polynomial AnswerVector Creates a Different Trend Line

Posted: Tue Aug 10, 2004 1:59 pm
by 9078528
I have a sample VB6 project that demonstrates that the results ploted using the AnswerVector to recreate the polynomial function yields a different trend line than the one calculated by TeeChart 6 (latest version). I have also plotted the results from GetCurveYValue and this agrees with the TeeChart trend plot. If you would like me to upload or e-mail the project, I would be happy to do so, please provide me with the destination.

Posted: Tue Aug 10, 2004 11:41 pm
by Pep
Hi Dave,

yes please, send me it to pep@steema.com and we'll take a look.

Posted: Thu Aug 12, 2004 9:29 pm
by 9078528
I have e-mail you the sample project.

Posted: Fri Aug 13, 2004 2:51 pm
by Pep
Hi Dave,

ok thanks. We'll take a look and will back to you with results as soon as possible.

Posted: Tue Aug 17, 2004 9:10 pm
by Marc
Hello,

AnswerVector is the coefficient[s] less XValues.MinValue and YValues.MinValue.

There's a related to answer to this in a newsgroup correspondence (1999!)
http://groups.google.com/groups?q=teech ... com&rnum=1

The reason to subtract the MinValues is to reduce the possibility of an overflow caused by interim calculation values that go quite far off the scale.

Internally the GetCurveYValue function goes on to correctly calculate by adding the MinValues:
ie.
result:=CalcFitting(FPolyDegree,IAnswerVector,X-Source.XValues.MinValue)+IMinYValue;

Please let us know if that doesn't satisfactorily answer the question. I'll make a note for us to improve the related documentation.

Regards,
Marc Meumann