Jonas Ernst wrote:

Hi,

Can somebody give me some hints how to do a line interpolation without using

floating point arithemtics?

The function shall do a linear interpolation between 2 points (line interp?)

and it shall return the y value to any x value given.

e.g. p1: (0,0)

p2 (1000,50)

y value to calculate at x=600

Is there a way to implement this not using any FP arithmetics in C? Perhaps

"scaling up" or sth like this?

Any help would be great

Thanks in advance

J. Ernst

1. Don't post separately to multiple newsgroups. If you are

going to crosspost, append them to the "Newsgroup:" section

of your post. For example, there are different replies to

your post in news:comp.lang.c++ than this one.

CC: news:comp.lang.c++ (for thread consistency)

Followup-To: news:comp.programming

2. Your issue is about an algorithm or the process of getting

something done (such as interpolation). The newsgroup

news:comp.programming is an excellent place for algorithmic

questions. Most all algorithms are language independent.

3. This also happens to be a mathematics issue, again independent

of the programming language. Also try a newsgroup with the

term "sci.math" in its name.

4. How do you want the interpolation performed?

Linear Interpolation?

Binomial Interpolation?

Other?

5. Your issue may also fall under the relm of "curve fitting",

which is the subject of determining the best equation to

describe a set of points. If you have the equation then

determining any other point is easy. However, determining

the equation is not always easy.

--

Thomas Matthews

C++ newsgroup welcome message:

http://www.slack.net/~shiva/welcome.txt
C++ Faq:

http://www.parashift.com/c++-faq-lite
C Faq:

http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:

http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:

http://www.josuttis.com -- C++ STL Library book