www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/03/11:31:47

From: (M. Adnan Ali)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A useful class I made for producing formulas
Date: 31 Jul 1997 08:13:31 GMT
Organization: University of Western Ontario, London, Ont. Canada
Lines: 43
Message-ID: <5rphfb$orc@falcon.ccs.uwo.ca>
References: <01bc9ae9$7bc81960$32f282c1 AT damien>
NNTP-Posting-Host: pineapple.apmaths.uwo.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <01bc9ae9$7bc81960$32f282c1 AT damien>,
Richard Birch <richardbirch AT dial DOT pipex DOT com> wrote:
>Anyone interested in a class that gives you a formula when you give it a
>set of results. e.g. give it x=1 when y=1, x=2 when y=4, x=3 when y=9, the
>class will give you the formula y=x^2. 

there is an enormous body of mathematical software to do exactly what you
propose, just do a web-search for curve fitting.

to be useful, you should make obvious which algorithm you use to produce
your fitted function.

I was pretty proud of myself when i discovered a parametric equation
describing such curves 6 years ago, back in highschool.  it took almost a
year before i discovered lagrange came up with the same a few hundred years 
ago.  more importantly, mine are completely useless for orders above 8, 
mostly useless above 4, since the curves would "go crazy", that is, have 
extreme derivatives unless the data was _very_ nice.

>That was a VERY simple example - it
>will work given *any* real numbers, and produces formulas up to the order
>of 50. It uses Shawn Hargreaves' ALLEGRO for graphics manipulation so it
>needs that to compile. It produces the formula using simultaneous
>equations.
>Other functions are:
>
>- drawing the graph of the formula on the screen or to a bitmap
>- setting the scale, axis etc to your needs
>- giving a y result given an x by running x through the formula
>
>If *anyone* is interested, e-mail me and I'll reply attaching the source
>code (one 16KB header). I'm quite proud of this as this is the only code of
>this nature I know of, and would be pleased to receive ideas for
>improvement.
>

b-splines are among the most useful algorithms for such applications.
ability to use higher dimensions are always welcome.

good luck & have fun,

adnan.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019