delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/03/18:49:44

From: "Richard Birch" <richardbirch AT dial DOT pipex DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: A useful class I made for producing formulas
Date: 28 Jul 1997 00:04:08 GMT
Organization: UUNET
Lines: 18
Message-ID: <01bc9ae9$7bc81960$32f282c1@damien>
NNTP-Posting-Host: ac050.du.pipex.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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. 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.

- Raw text -


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